Files
ld58/code/game/nav.h

40 lines
693 B
C
Raw Permalink Normal View History

2025-10-04 21:08:52 +01:00
#if !defined(LD_GAME_NAV_H_)
#define LD_GAME_NAV_H_
#include "core/types.h"
#include "core/macros.h"
2025-10-04 21:08:52 +01:00
#define NAV_MAX_PATH 1024
#define NAV_MAX_CONNECTIONS 8
2025-10-06 18:23:47 +01:00
#define NAV_MAX_NODES 4800
2025-10-04 21:08:52 +01:00
typedef struct NavNode NavNode;
typedef struct NavConnection NavConnection;
struct NavConnection{
F32 Cost;
U32 NodeIndex;
};
struct NavNode {
V2f pos;
U8 connectionCount;
NavConnection connections[NAV_MAX_CONNECTIONS];
};
typedef struct NavPath NavPath;
struct NavPath {
U32 nodeCount;
U32 indexes[NAV_MAX_PATH];
};
typedef struct NavMesh NavMesh;
struct NavMesh{
U32 nodeCount;
NavNode nodes[NAV_MAX_NODES];
};
function NavPath Nav_Path(NavMesh *mesh, U32 start, U32 end);
2025-10-04 21:08:52 +01:00
#endif