| 211 | } |
| 212 | |
| 213 | void BridgeObject::AssignSectors(const ItemInfo& item) |
| 214 | { |
| 215 | // Get AABB and OBB. |
| 216 | auto aabb = item.GetAabb(); |
| 217 | auto obb = item.GetObb(); |
| 218 | |
| 219 | // Assign to sectors. |
| 220 | unsigned int searchDepth = (unsigned int)ceil(std::max({ obb.Extents.x, obb.Extents.y, obb.Extents.z }) / BLOCK(1)); |
| 221 | auto sectors = GetNeighborSectors(item.Pose.Position, item.RoomNumber, searchDepth); |
| 222 | for (auto* sector : sectors) |
| 223 | { |
| 224 | // Test if AABB intersects sector. |
| 225 | if (!aabb.Intersects(sector->Aabb)) |
| 226 | continue; |
| 227 | |
| 228 | // Test if OBB intersects sector. |
| 229 | if (!obb.Intersects(sector->Aabb)) |
| 230 | continue; |
| 231 | |
| 232 | sector->AddBridge(item.Index); |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | void BridgeObject::DeassignSectors(const ItemInfo& item) const |
| 237 | { |
nothing calls this directly
no test coverage detected