diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2024-01-10 19:24:12 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2024-01-10 19:24:12 -0500 |
| commit | f07294ca65143fac8b1b426d1854212403721226 (patch) | |
| tree | 2edeb8f2c9beea1cbb065f69910d53957ebda0ce /src/physics.cpp | |
| parent | 294c85f91ac5b2ff9e4ad3d99588ed0d1a72e6b7 (diff) | |
checkpoint - handle breaking ECS changes - compiles
Diffstat (limited to 'src/physics.cpp')
| -rw-r--r-- | src/physics.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/physics.cpp b/src/physics.cpp index 4825955..88c8139 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -28,7 +28,7 @@ btBroadphaseInterface *btBroadphase = nullptr; btConstraintSolver *btSolver = nullptr; struct EntityCollision { - EntityHandle a, b; + CompInstance *a, *b; }; PkeArray<EntityCollision> collisionsThisTick{}; @@ -80,11 +80,9 @@ struct CollisionHandlerStruct : public btOverlapFilterCallback { const auto *col0 = static_cast<btCollisionObject *>(proxy0->m_clientObject); const auto *col1 = static_cast<btCollisionObject *>(proxy1->m_clientObject); if (col0 && col1) { - EntityHandle ent0{}; - ent0.hash = reinterpret_cast<uint64_t>(col0->getUserPointer()); - EntityHandle ent1{}; - ent1.hash = reinterpret_cast<uint64_t>(col1->getUserPointer()); - if (ent0 != EntityHandle_MAX && ent1 != EntityHandle_MAX) { + CompInstance *ent0 = reinterpret_cast<CompInstance *>(col0->getUserPointer()); + CompInstance *ent1 = reinterpret_cast<CompInstance *>(col1->getUserPointer()); + if (ent0 != nullptr && ent1 != nullptr) { PkeArray_Add<EntityCollision>(&collisionsThisTick, { .a = ent0, .b = ent1, |
