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

Method RemoveActor

Source/Engine/Level/Scene/SceneRendering.cpp:217–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void SceneRendering::RemoveActor(Actor* a, int32& key)
218{
219 CHECK_SCENE_EDIT_ACCESS();
220 const int32 category = a->_drawCategory;
221 ScopeWriteLock lock(Locker);
222 auto& list = Actors[category];
223 if (list.Count() > key || key < 0) // Ignore invalid key softly (eg. list after batch clear during scene unload)
224 {
225 auto& e = list.Get()[key];
226 if (e.Actor == a)
227 {
228 for (auto* listener : _listeners)
229 listener->OnSceneRenderingRemoveActor(a);
230 e.Actor = nullptr;
231 e.LayerMask = 0;
232 FreeActors[category].Add(key);
233 }
234 }
235 key = -1;
236}
237
238#define FOR_EACH_BATCH_ACTOR const int64 count = _drawListSize; while (true) { const int64 index = Platform::InterlockedIncrement(&_drawListIndex); if (index >= count) break; auto e = _drawListData[index];
239#define CHECK_ACTOR ((view.RenderLayersMask.Mask & e.LayerMask) && (e.NoCulling || FrustumsListCull(e.Bounds, _drawFrustumsData)))

Callers 15

OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45
OnDisableMethod · 0.45

Calls 4

CountMethod · 0.45
GetMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected