| 22 | constexpr auto EVENT_STATE_MASK = SHRT_MAX; |
| 23 | |
| 24 | bool TestVolumeContainment(const TriggerVolume& volume, const BoundingOrientedBox& box, int roomNumber) |
| 25 | { |
| 26 | float color = !volume.StateQueue.empty() ? 1.0f : 0.4f; |
| 27 | |
| 28 | switch (volume.Type) |
| 29 | { |
| 30 | case VolumeType::Box: |
| 31 | if (roomNumber == Camera.pos.RoomNumber) |
| 32 | { |
| 33 | DrawDebugBox(volume.Box, |
| 34 | Vector4(color, 0.0f, color, 1.0f), RendererDebugPage::CollisionStats); |
| 35 | } |
| 36 | return volume.Box.Intersects(box); |
| 37 | |
| 38 | case VolumeType::Sphere: |
| 39 | if (roomNumber == Camera.pos.RoomNumber) |
| 40 | { |
| 41 | DrawDebugSphere(volume.Sphere.Center, volume.Sphere.Radius, |
| 42 | Vector4(color, 0.0f, color, 1.0f), RendererDebugPage::CollisionStats); |
| 43 | } |
| 44 | return volume.Sphere.Intersects(box); |
| 45 | |
| 46 | default: |
| 47 | TENLog(fmt::format("Unsupported volume type encountered in room {}.", roomNumber), LogLevel::Error); |
| 48 | return false; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | BoundingOrientedBox ConstructRoughBox(ItemInfo& item, const CollisionSetupData& coll) |
| 53 | { |
no test coverage detected