MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / DeassignSectors

Method DeassignSectors

TombEngine/Objects/Generic/Object/BridgeObject.cpp:236–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234 }
235
236 void BridgeObject::DeassignSectors(const ItemInfo& item) const
237 {
238 // Deassign from sectors.
239 unsigned int searchDepth = (unsigned int)ceil(std::max({ _prevAabb.Extents.x, _prevAabb.Extents.y, _prevAabb.Extents.z }) / BLOCK(1));
240 auto sectors = GetNeighborSectors(_prevTransform.Position, _prevRoomNumber, searchDepth);
241 for (auto* sector : sectors)
242 {
243 // Test if previous AABB intersects sector.
244 if (!_prevAabb.Intersects(sector->Aabb))
245 continue;
246
247 // Test if previous OBB intersects sector.
248 if (!_prevObb.Intersects(sector->Aabb))
249 continue;
250
251 sector->RemoveBridge(item.Index);
252 }
253 }
254
255 const BridgeObject& GetBridgeObject(const ItemInfo& item)
256 {

Callers

nothing calls this directly

Calls 3

GetNeighborSectorsFunction · 0.85
IntersectsMethod · 0.80
RemoveBridgeMethod · 0.80

Tested by

no test coverage detected