MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnBoundsChanged

Method OnBoundsChanged

Source/Engine/Navigation/NavModifierVolume.cpp:64–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void 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

Callers

nothing calls this directly

Calls 6

IsActiveInHierarchyFunction · 0.85
HasStaticFlagFunction · 0.85
BuildNavMeshFunction · 0.85
GetSceneFunction · 0.85
CanAutoBuildNavMeshMethod · 0.80
MergeFunction · 0.50

Tested by

no test coverage detected