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
+31
View File
@@ -175,6 +175,9 @@ idAASLocal::DefaultSearchBounds
============
*/
const idBounds &idAASLocal::DefaultSearchBounds( void ) const {
if ( recastNavMesh.IsLoaded() ) {
return recastNavMesh.GetSettings()->boundingBoxes[0];
}
return file->GetSettings().boundingBoxes[0];
}
@@ -184,6 +187,10 @@ idAASLocal::ShowArea
============
*/
void idAASLocal::ShowArea( const idVec3 &origin ) const {
if ( recastNavMesh.IsLoaded() ) {
recastNavMesh.ShowArea( origin );
return;
}
static int lastAreaNum;
int areaNum;
const aasArea_t *area;
@@ -242,6 +249,10 @@ idAASLocal::ShowWalkPath
============
*/
void idAASLocal::ShowWalkPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const {
if ( recastNavMesh.IsLoaded() ) {
recastNavMesh.ShowPath( origin, goalAreaNum, goalOrigin );
return;
}
int i, areaNum, curAreaNum, travelTime;
idReachability *reach;
idVec3 org, areaCenter;
@@ -288,6 +299,10 @@ idAASLocal::ShowFlyPath
============
*/
void idAASLocal::ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const {
if ( recastNavMesh.IsLoaded() ) {
recastNavMesh.ShowPath( origin, goalAreaNum, goalOrigin );
return;
}
int i, areaNum, curAreaNum, travelTime;
idReachability *reach;
idVec3 org, areaCenter;
@@ -476,6 +491,22 @@ idAASLocal::Test
*/
void idAASLocal::Test( const idVec3 &origin ) {
if ( recastNavMesh.IsLoaded() ) {
if ( aas_showRecastNavMesh.GetInteger() > 0 ) {
recastNavMesh.DebugDraw( aas_showRecastNavMesh.GetInteger() );
}
if ( aas_showAreas.GetBool() ) {
ShowArea( origin );
}
if ( aas_showPath.GetInteger() > 0 ) {
ShowWalkPath( origin, aas_showPath.GetInteger(), AreaCenter( aas_showPath.GetInteger() ) );
}
if ( aas_showFlyPath.GetInteger() > 0 ) {
ShowFlyPath( origin, aas_showFlyPath.GetInteger(), AreaCenter( aas_showFlyPath.GetInteger() ) );
}
return;
}
if ( !file ) {
return;
}