mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Server: create new core NavMesh types
Create new types which will be used to refactor the current Detour implementation in the SDK.
This commit is contained in:
parent
089dddf2c4
commit
e638cc9323
38
src/public/game/server/ai_agent.h
Normal file
38
src/public/game/server/ai_agent.h
Normal file
@ -0,0 +1,38 @@
|
||||
//=============================================================================//
|
||||
//
|
||||
// Purpose: defines the agent types for AI
|
||||
//
|
||||
//=============================================================================//
|
||||
#ifndef AI_AGENT_H
|
||||
#define AI_AGENT_H
|
||||
|
||||
// The traverse types determine the animations, they also determine the jump
|
||||
// links that can be taken (e.g. ANIMTYPE_FRAG_DRONE can take far more jumps
|
||||
// than ANIMTYPE_STALKER. This is determined during the creation of the static
|
||||
// pathing data in the NavMesh.
|
||||
enum TraverseAnimType_e
|
||||
{
|
||||
// NAVMESH_SMALL
|
||||
ANIMTYPE_HUMAN = 0,
|
||||
ANIMTYPE_SPECTRE,
|
||||
ANIMTYPE_STALKER,
|
||||
ANIMTYPE_FRAG_DRONE,
|
||||
ANIMTYPE_PILOT,
|
||||
|
||||
// NAVMESH_MED_SHORT
|
||||
ANIMTYPE_PROWLER,
|
||||
|
||||
// NAVMESH_MEDIUM
|
||||
ANIMTYPE_SUPER_SPECTRE,
|
||||
|
||||
// NAVMESH_LARGE
|
||||
ANIMTYPE_TITAN,
|
||||
|
||||
// NAVMESH_EXTRA_LARGE
|
||||
ANIMTYPE_GOLIATH,
|
||||
|
||||
// Not an anim type!
|
||||
ANIMTYPE_COUNT
|
||||
};
|
||||
|
||||
#endif // AI_AGENT_H
|
53
src/public/game/server/ai_navmesh.h
Normal file
53
src/public/game/server/ai_navmesh.h
Normal file
@ -0,0 +1,53 @@
|
||||
//=============================================================================//
|
||||
//
|
||||
// Purpose: defines the NavMesh types for AI
|
||||
//
|
||||
//=============================================================================//
|
||||
#ifndef AI_NAVMESH_H
|
||||
#define AI_NAVMESH_H
|
||||
|
||||
#include "ai_agent.h"
|
||||
|
||||
enum NavMeshType_e
|
||||
{
|
||||
NAVMESH_SMALL = 0,
|
||||
NAVMESH_MED_SHORT,
|
||||
NAVMESH_MEDIUM,
|
||||
NAVMESH_LARGE,
|
||||
NAVMESH_EXTRA_LARGE,
|
||||
|
||||
// Not a NavMesh!
|
||||
NAVMESH_COUNT
|
||||
};
|
||||
|
||||
inline const char* const g_navMeshNames[NAVMESH_COUNT] = {
|
||||
"small",
|
||||
"med_short",
|
||||
"medium",
|
||||
"large",
|
||||
"extra_large"
|
||||
};
|
||||
|
||||
inline const char* NavMesh_GetNameForType(const NavMeshType_e navMeshType)
|
||||
{
|
||||
Assert(navMeshType >= 0 && navMeshType < NAVMESH_COUNT);
|
||||
return g_navMeshNames[navMeshType];
|
||||
}
|
||||
|
||||
inline const int g_traverseAnimTypeSetTableIndices[ANIMTYPE_COUNT] = {
|
||||
// NAVMESH_SMALL has 5 reachability tables, so each traverse anim type indexes
|
||||
// into its own.
|
||||
0, 0, 0, 0, 0,
|
||||
|
||||
// All other navmeshes have 1 reachability table, so we need to subtract the
|
||||
// number from the enumerant to index into the first one.
|
||||
-5, -6, -7, -8
|
||||
};
|
||||
|
||||
inline int NavMesh_GetReachabilityTableIndexForTraverseAnimType(const TraverseAnimType_e animType)
|
||||
{
|
||||
Assert(animType >= 0 && animType < V_ARRAYSIZE(g_traverseAnimTypeSetTableIndices));
|
||||
return animType + g_traverseAnimTypeSetTableIndices[animType];
|
||||
}
|
||||
|
||||
#endif // AI_NAVMESH_H
|
Loading…
x
Reference in New Issue
Block a user