summaryrefslogtreecommitdiff
path: root/src/physics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/physics.cpp')
-rw-r--r--src/physics.cpp10
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,