Files
ld58/code/game/nav.h
James Bulman e4c1bc0a1c Merge branch 'main' of yibble.dev:bulmanator/ld58
Fixed conflicts
Added "code" directory for include to make it easier to include core
headers
Stopped warnings (probably cl specific)
2025-10-04 21:58:14 +01:00

41 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 4096
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