40 lines
693 B
C
40 lines
693 B
C
#if !defined(LD_GAME_NAV_H_)
|
|
#define LD_GAME_NAV_H_
|
|
|
|
#include "core/types.h"
|
|
#include "core/macros.h"
|
|
|
|
#define NAV_MAX_PATH 1024
|
|
#define NAV_MAX_CONNECTIONS 8
|
|
#define NAV_MAX_NODES 4800
|
|
|
|
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);
|
|
|
|
#endif
|