JoltPhysics3D: Rework RigidBody wrapper

- Add a clear way to setup dynamic/kinematic or static bodies
- Body registration to the world is batched (all bodies created before a physics step are added together, which is what Jolt is optimized for)
- Added support for empty shapes (= rigid bodies without collision) using a very small shape and tagging the body as sensor
This commit is contained in:
SirLynix
2023-04-05 08:50:39 +02:00
committed by Jérôme Leclercq
parent 67b1710adb
commit d610baf920
14 changed files with 472 additions and 157 deletions

View File

@@ -24,6 +24,7 @@ namespace Nz
JPH::CharacterSettings settings;
settings.mShape = shapeResult.Get();
settings.mLayer = 1;
m_character = std::make_unique<JPH::Character>(&settings, ToJolt(position), ToJolt(rotation), 0, m_physicsWorld.GetPhysicsSystem());
m_character->AddToPhysicsSystem();
@@ -108,7 +109,7 @@ namespace Nz
m_character->Activate(false);
}
void JoltCharacter::PreSimulate(float elapsedTime)
void JoltCharacter::PreSimulate(float /*elapsedTime*/)
{
}