mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-18 11:44:51 +02:00
Added recast navmesh.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user