From 0f14e303b2fd663486116c0f51589ae8aa1049d2 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Mon, 9 Sep 2024 00:09:04 -0400 Subject: [PATCH] Attempt to fix kinematic not generating collision callbacks --- Nuake/src/Physics/DynamicWorld.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Nuake/src/Physics/DynamicWorld.cpp b/Nuake/src/Physics/DynamicWorld.cpp index b3a5ee4c..d3d85df5 100644 --- a/Nuake/src/Physics/DynamicWorld.cpp +++ b/Nuake/src/Physics/DynamicWorld.cpp @@ -206,7 +206,7 @@ namespace Nuake case Layers::MOVING: return true; case Layers::SENSORS: - return inLayer2 == BroadPhaseLayers::MOVING;; + return inLayer2 == BroadPhaseLayers::MOVING; default: return false; } @@ -384,6 +384,11 @@ namespace Nuake bodySettings.mCollideKinematicVsNonDynamic = true; } + if (rb->GetForceKinematic()) + { + bodySettings.mCollideKinematicVsNonDynamic = true; + } + bodySettings.mAllowedDOFs = (JPH::EAllowedDOFs::All); if (rb->GetLockXAxis()) @@ -451,7 +456,7 @@ namespace Nuake } bodySettings.mUserData = cc->Owner.GetHandle(); - + bodySettings.mCollideKinematicVsNonDynamic = true; // Create the actual rigid body JPH::BodyID body = _JoltBodyInterface->CreateAndAddBody(bodySettings, JPH::EActivation::Activate); // Note that if we run out of bodies this can return nullptr uint32_t bodyIndex = body.GetIndexAndSequenceNumber();