Merge pull request #1625 from Azaezel/alpha41/navmeshDefaults
Some checks failed
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Has been cancelled
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Has been cancelled
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Has been cancelled

navmesh creation default fixes
This commit is contained in:
Brian Roberts 2025-12-18 19:15:18 -06:00 committed by GitHub
commit 16d7a5f0f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

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

View file

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