navmesh creation default fixes

fx navmesh scale detection
fill in mission file based .nav file name
account for walkableclimb having more filter weight than walkableslope when it comes to slanted quads generating navmesh data
This commit is contained in:
AzaezelX 2025-12-18 13:56:28 -06:00
parent 9d4bfec4d1
commit c9bc7aa6cb
2 changed files with 9 additions and 6 deletions

View file

@ -195,9 +195,9 @@ NavMesh::NavMesh()
mCellSize = mCellHeight = 0.2f;
mWalkableHeight = 2.0f;
mWalkableClimb = 0.3f;
mWalkableClimb = 0.5f;
mWalkableRadius = 0.5f;
mWalkableSlope = 40.0f;
mWalkableSlope = 45.0f;
mBorderSize = 1;
mDetailSampleDist = 6.0f;
mDetailSampleMaxError = 1.0f;

View file

@ -352,6 +352,7 @@ function CreateNewNavMeshDlg::create(%this)
%mesh = 0;
%navFileLoc = filePath($Client::MissionFile) @ "/" @ fileBase($Client::MissionFile) @".nav";
if(MeshMissionBounds.isStateOn())
{
if(!isObject(getScene(0)))
@ -362,14 +363,15 @@ function CreateNewNavMeshDlg::create(%this)
// Get maximum extents of all objects.
%box = MissionBoundsExtents(getScene(0));
%pos = GetBoxCenter(%box);
%scale = (GetWord(%box, 3) - GetWord(%box, 0)) / 2 + 5
SPC (GetWord(%box, 4) - GetWord(%box, 1)) / 2 + 5
SPC (GetWord(%box, 5) - GetWord(%box, 2)) / 2 + 5;
%scale = (GetWord(%box, 3) - GetWord(%box, 0)) + 1
SPC (GetWord(%box, 4) - GetWord(%box, 1)) + 1
SPC (GetWord(%box, 5) - GetWord(%box, 2)) + 1;
%mesh = new NavMesh(%name)
{
position = %pos;
scale = %scale;
fileName = %navFileLoc;
};
}
else
@ -378,6 +380,7 @@ function CreateNewNavMeshDlg::create(%this)
{
position = %this-->MeshPosition.getText();
scale = %this-->MeshScale.getText();
fileName = %navFileLoc;
};
}
getScene(0).add(%mesh);