| 62 | } |
| 63 | |
| 64 | void NavModifierVolume::OnBoundsChanged(const BoundingBox& prevBounds) |
| 65 | { |
| 66 | #if COMPILE_WITH_NAV_MESH_BUILDER |
| 67 | // Auto-rebuild modified navmesh area |
| 68 | if ( |
| 69 | IsDuringPlay() && IsActiveInHierarchy() && HasStaticFlag(StaticFlags::Navigation) && |
| 70 | ( |
| 71 | // Build at runtime for dynamic modifiers |
| 72 | !HasStaticFlag(StaticFlags::Transform) |
| 73 | #if USE_EDITOR |
| 74 | // Build in editor when using auto-rebuild option |
| 75 | || (!Editor::IsPlayMode && Editor::Managed->CanAutoBuildNavMesh()) |
| 76 | #endif |
| 77 | )) |
| 78 | { |
| 79 | BoundingBox dirtyBounds; |
| 80 | BoundingBox::Merge(prevBounds, _box, dirtyBounds); |
| 81 | #if USE_EDITOR |
| 82 | const float timeoutMs = ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs; |
| 83 | #else |
| 84 | const float timeoutMs = 0.0f; |
| 85 | #endif |
| 86 | Navigation::BuildNavMesh(dirtyBounds, GetScene(), timeoutMs); |
| 87 | } |
| 88 | #endif |
| 89 | } |
| 90 | |
| 91 | #if USE_EDITOR |
| 92 |
nothing calls this directly
no test coverage detected