Added recast navmesh.

This commit is contained in:
Justin Marshall
2026-05-22 21:59:30 -07:00
parent d24553b366
commit b0788b922e
31 changed files with 11241 additions and 20 deletions
+26 -9
View File
@@ -7,9 +7,9 @@
This file has been generated with the Type Info Generator v1.1 (c) 2004 id Software
1186 constants
1188 constants
133 enums
581 classes/structs/unions
583 classes/structs/unions
38 templates
7 max inheritance level for 'idAI_Vagary'
@@ -643,6 +643,8 @@ static constantInfo_t constantInfo[] = {
{ "int", "CONTACT_EDGE", "1" },
{ "int", "CONTACT_MODELVERTEX", "2" },
{ "int", "CONTACT_TRMVERTEX", "3" },
{ "static const recastNavHandle_t", "RECAST_NAV_HANDLE_INVALID", "-1" },
{ "static const int", "MAX_RECAST_PATH_AREAS", "256" },
{ "int", "ALLOW_YES", "0" },
{ "int", "ALLOW_BADPASS", "1" },
{ "int", "ALLOW_NOTYET", "2" },
@@ -655,7 +657,7 @@ static constantInfo_t constantInfo[] = {
{ "int", "TEST_PARTICLE_MUZZLE", "2" },
{ "int", "TEST_PARTICLE_FLIGHT", "3" },
{ "int", "TEST_PARTICLE_SELECTED", "4" },
{ "const int", "GAME_API_VERSION", "8" },
{ "const int", "GAME_API_VERSION", "9" },
{ "static const int", "MAX_LOGGED_STATS", "60*120" },
{ "int", "MSG_OK", "0" },
{ "int", "MSG_ABORT", "1" },
@@ -4870,6 +4872,18 @@ static classVariableInfo_t idAASFileManager_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t recastPath_t_typeInfo[] = {
{ "idVec3", "moveGoal", (intptr_t)(&((recastPath_t *)0)->moveGoal), sizeof( ((recastPath_t *)0)->moveGoal ) },
{ "idVec3", "secondaryGoal", (intptr_t)(&((recastPath_t *)0)->secondaryGoal), sizeof( ((recastPath_t *)0)->secondaryGoal ) },
{ "int", "moveAreaNum", (intptr_t)(&((recastPath_t *)0)->moveAreaNum), sizeof( ((recastPath_t *)0)->moveAreaNum ) },
{ "int", "travelTime", (intptr_t)(&((recastPath_t *)0)->travelTime), sizeof( ((recastPath_t *)0)->travelTime ) },
{ NULL, 0 }
};
static classVariableInfo_t idRecastNavigationManager_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t gameReturn_t_typeInfo[] = {
{ "char[1024]", "sessionCommand", (intptr_t)(&((gameReturn_t *)0)->sessionCommand), sizeof( ((gameReturn_t *)0)->sessionCommand ) },
{ "int", "consistencyHash", (intptr_t)(&((gameReturn_t *)0)->consistencyHash), sizeof( ((gameReturn_t *)0)->consistencyHash ) },
@@ -4914,6 +4928,7 @@ static classVariableInfo_t gameImport_t_typeInfo[] = {
{ "idUserInterfaceManager *", "uiManager", (intptr_t)(&((gameImport_t *)0)->uiManager), sizeof( ((gameImport_t *)0)->uiManager ) },
{ "idDeclManager *", "declManager", (intptr_t)(&((gameImport_t *)0)->declManager), sizeof( ((gameImport_t *)0)->declManager ) },
{ "idAASFileManager *", "AASFileManager", (intptr_t)(&((gameImport_t *)0)->AASFileManager), sizeof( ((gameImport_t *)0)->AASFileManager ) },
{ "idRecastNavigationManager *", "RecastNavigationManager", (intptr_t)(&((gameImport_t *)0)->RecastNavigationManager), sizeof( ((gameImport_t *)0)->RecastNavigationManager ) },
{ "idCollisionModelManager *", "collisionModelManager", (intptr_t)(&((gameImport_t *)0)->collisionModelManager), sizeof( ((gameImport_t *)0)->collisionModelManager ) },
{ NULL, 0 }
};
@@ -5201,11 +5216,11 @@ static classVariableInfo_t frameLookup_t_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t class_285_class_285_typeInfo[] = {
// { "const idSoundShader *", "soundShader", (intptr_t)(&((class_285::class_285 *)0)->soundShader), sizeof( ((class_285::class_285 *)0)->soundShader ) },
// { "const function_t *", "function", (intptr_t)(&((class_285::class_285 *)0)->function), sizeof( ((class_285::class_285 *)0)->function ) },
// { "const idDeclSkin *", "skin", (intptr_t)(&((class_285::class_285 *)0)->skin), sizeof( ((class_285::class_285 *)0)->skin ) },
// { "int", "index", (intptr_t)(&((class_285::class_285 *)0)->index), sizeof( ((class_285::class_285 *)0)->index ) },
static classVariableInfo_t class_287_class_287_typeInfo[] = {
// { "const idSoundShader *", "soundShader", (intptr_t)(&((class_287::class_287 *)0)->soundShader), sizeof( ((class_287::class_287 *)0)->soundShader ) },
// { "const function_t *", "function", (intptr_t)(&((class_287::class_287 *)0)->function), sizeof( ((class_287::class_287 *)0)->function ) },
// { "const idDeclSkin *", "skin", (intptr_t)(&((class_287::class_287 *)0)->skin), sizeof( ((class_287::class_287 *)0)->skin ) },
// { "int", "index", (intptr_t)(&((class_287::class_287 *)0)->index), sizeof( ((class_287::class_287 *)0)->index ) },
{ NULL, 0 }
};
@@ -8815,6 +8830,8 @@ static classTypeInfo_t classTypeInfo[] = {
{ "idAASSettings", "", sizeof(idAASSettings), idAASSettings_typeInfo },
{ "idAASFile", "", sizeof(idAASFile), idAASFile_typeInfo },
{ "idAASFileManager", "", sizeof(idAASFileManager), idAASFileManager_typeInfo },
{ "recastPath_t", "", sizeof(recastPath_t), recastPath_t_typeInfo },
{ "idRecastNavigationManager", "", sizeof(idRecastNavigationManager), idRecastNavigationManager_typeInfo },
{ "gameReturn_t", "", sizeof(gameReturn_t), gameReturn_t_typeInfo },
{ "idGame", "", sizeof(idGame), idGame_typeInfo },
{ "refSound_t", "", sizeof(refSound_t), refSound_t_typeInfo },
@@ -8851,7 +8868,7 @@ static classTypeInfo_t classTypeInfo[] = {
{ "jointAnimInfo_t", "", sizeof(jointAnimInfo_t), jointAnimInfo_t_typeInfo },
{ "jointMod_t", "", sizeof(jointMod_t), jointMod_t_typeInfo },
{ "frameLookup_t", "", sizeof(frameLookup_t), frameLookup_t_typeInfo },
// { "class_285::class_285", "", sizeof(class_285::class_285), class_285_class_285_typeInfo },
// { "class_287::class_287", "", sizeof(class_287::class_287), class_287_class_287_typeInfo },
{ "frameCommand_t", "", sizeof(frameCommand_t), frameCommand_t_typeInfo },
{ "animFlags_t", "", sizeof(animFlags_t), animFlags_t_typeInfo },
{ "idModelExport", "", sizeof(idModelExport), idModelExport_typeInfo },
+47
View File
@@ -30,6 +30,7 @@ If you have questions concerning this license or the applicable additional terms
#pragma hdrstop
#include "../Game_local.h"
#include "../ai/RecastNavMesh.h"
#include "TypeInfo.h"
@@ -1476,6 +1477,51 @@ static void Cmd_AASStats_f( const idCmdArgs &args ) {
}
}
/*
==================
Cmd_RecastNavBuild_f
==================
*/
static void Cmd_RecastNavBuild_f( const idCmdArgs &args ) {
if ( !gameLocal.CheatsOk( false ) ) {
return;
}
if ( args.Argc() < 2 || args.Argc() > 3 ) {
gameLocal.Printf( "usage: recastNavBuild <mapfile> [aasType|all]\n" );
return;
}
const idStr mapName = args.Argv( 1 );
const idStr requestedType = args.Argc() > 2 ? args.Argv( 2 ) : "all";
bool builtAny = false;
if ( requestedType.Icmp( "all" ) != 0 ) {
common->SetRefreshOnPrint(true);
builtAny = idRecastNavMesh::BuildMapFile( mapName, requestedType );
common->SetRefreshOnPrint(false);
} else {
const idDict *dict = gameLocal.FindEntityDefDict( "aas_types", false );
if ( !dict ) {
gameLocal.Warning( "Unable to find entityDef for 'aas_types'" );
return;
}
common->SetRefreshOnPrint(true);
for ( const idKeyValue *kv = dict->MatchPrefix( "type" ); kv != NULL; kv = dict->MatchPrefix( "type", kv ) ) {
if ( idRecastNavMesh::BuildMapFile( mapName, kv->GetValue() ) ) {
builtAny = true;
}
}
common->SetRefreshOnPrint(false);
}
if ( builtAny ) {
gameLocal.Printf( "Recast navmesh build complete for %s\n", mapName.c_str() );
} else {
gameLocal.Warning( "Recast navmesh build failed for %s", mapName.c_str() );
}
}
/*
==================
Cmd_TestDamage_f
@@ -2366,6 +2412,7 @@ void idGameLocal::InitConsoleCommands( void ) {
cmdSystem->AddCommand( "reloadanims", Cmd_ReloadAnims_f, CMD_FL_GAME|CMD_FL_CHEAT, "reloads animations" );
cmdSystem->AddCommand( "listAnims", Cmd_ListAnims_f, CMD_FL_GAME, "lists all animations" );
cmdSystem->AddCommand( "aasStats", Cmd_AASStats_f, CMD_FL_GAME, "shows AAS stats" );
cmdSystem->AddCommand( "recastNavBuild", Cmd_RecastNavBuild_f, CMD_FL_GAME|CMD_FL_CHEAT, "builds Recast navmesh data for a map" );
cmdSystem->AddCommand( "testDamage", Cmd_TestDamage_f, CMD_FL_GAME|CMD_FL_CHEAT, "tests a damage def", idCmdSystem::ArgCompletion_Decl<DECL_ENTITYDEF> );
cmdSystem->AddCommand( "weaponSplat", Cmd_WeaponSplat_f, CMD_FL_GAME|CMD_FL_CHEAT, "projects a blood splat on the player weapon" );
cmdSystem->AddCommand( "saveSelected", Cmd_SaveSelected_f, CMD_FL_GAME|CMD_FL_CHEAT, "saves the selected entity to the .map file" );
+1
View File
@@ -296,6 +296,7 @@ idCVar g_flushSave( "g_flushSave", "0", CVAR_GAME | CVAR_BOOL, "1 = don
idCVar aas_test( "aas_test", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showAreas( "aas_showAreas", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar aas_showRecastNavMesh( "aas_showRecastNavMesh", "0", CVAR_GAME | CVAR_INTEGER, "0 = off, 1 = draw Recast navmesh, 2 = also draw dynamic blockers" );
idCVar aas_showPath( "aas_showPath", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showFlyPath( "aas_showFlyPath", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showWallEdges( "aas_showWallEdges", "0", CVAR_GAME | CVAR_BOOL, "" );
+1
View File
@@ -224,6 +224,7 @@ extern idCVar g_flushSave;
extern idCVar aas_test;
extern idCVar aas_showAreas;
extern idCVar aas_showRecastNavMesh;
extern idCVar aas_showPath;
extern idCVar aas_showFlyPath;
extern idCVar aas_showWallEdges;