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

Method OnBoundsChanged

Source/Engine/Navigation/NavMeshBoundsVolume.cpp:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51#if USE_EDITOR
52
53void NavMeshBoundsVolume::OnBoundsChanged(const BoundingBox& prevBounds)
54{
55 // Auto-rebuild modified navmesh area
56 if (IsDuringPlay() && IsActiveInHierarchy() && !Editor::IsPlayMode && Editor::Managed->CanAutoBuildNavMesh())
57 {
58 if (_box.Intersects(prevBounds))
59 {
60 // Bounds were moved a bit so merge into a single request (for performance reasons)
61 BoundingBox dirtyBounds;
62 BoundingBox::Merge(prevBounds, _box, dirtyBounds);
63 Navigation::BuildNavMesh(dirtyBounds, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs);
64 }
65 else
66 {
67 // Dirty each bounds in separate
68 Navigation::BuildNavMesh(prevBounds, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs);
69 Navigation::BuildNavMesh(_box, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs);
70 }
71 }
72}
73
74void NavMeshBoundsVolume::OnActiveInTreeChanged()
75{

Callers

nothing calls this directly

Calls 5

IsActiveInHierarchyFunction · 0.85
BuildNavMeshFunction · 0.85
CanAutoBuildNavMeshMethod · 0.80
MergeFunction · 0.50
IntersectsMethod · 0.45

Tested by

no test coverage detected