فهرست منبع

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

AzaezelX 3 هفته پیش
والد
کامیت
c9bc7aa6cb
2فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 2 2
      Engine/source/navigation/navMesh.cpp
  2. 7 4
      Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui

+ 2 - 2
Engine/source/navigation/navMesh.cpp

@@ -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;

+ 7 - 4
Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui

@@ -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);