Attempt to fix kinematic not generating collision callbacks

This commit is contained in:
Antoine Pilote
2024-09-09 00:09:04 -04:00
parent 22a859b3e1
commit 0f14e303b2

View File

@@ -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();