Browse Source

Exclude nodes with Obstacle components from navigation mesh geometry collection

JSandusky 10 years ago
parent
commit
29d9892e9b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/Urho3D/Navigation/NavigationMesh.cpp

+ 3 - 0
Source/Urho3D/Navigation/NavigationMesh.cpp

@@ -834,6 +834,9 @@ void NavigationMesh::CollectGeometries(Vector<NavigationGeometryInfo>& geometryL
     // Make sure nodes are not included twice
     if (processedNodes.Contains(node))
         return;
+    // Exclude obstacles from consideration
+    if (node->HasComponent<Obstacle>())
+        return;
     processedNodes.Insert(node);
 
     Matrix3x4 inverse = node_->GetWorldTransform().Inverse();