mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
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:
parent
9d4bfec4d1
commit
c9bc7aa6cb
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue