From f5df12e740a8fb8a8b40be1ba4dc58ce4b504e70 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Wed, 15 Nov 2023 08:08:45 +0100 Subject: [PATCH] JoltPhysics3D: Update for v4 --- src/Nazara/JoltPhysics3D/JoltConstraint3D.cpp | 8 ++++---- src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp | 4 ++-- src/Nazara/JoltPhysics3D/JoltRigidBody3D.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Nazara/JoltPhysics3D/JoltConstraint3D.cpp b/src/Nazara/JoltPhysics3D/JoltConstraint3D.cpp index c4f70dbf5..9a9205086 100644 --- a/src/Nazara/JoltPhysics3D/JoltConstraint3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltConstraint3D.cpp @@ -137,12 +137,12 @@ namespace Nz float JoltDistanceConstraint3D::GetDamping() const { - return GetConstraint()->GetDamping(); + return GetConstraint()->GetLimitsSpringSettings().mDamping; } float JoltDistanceConstraint3D::GetFrequency() const { - return GetConstraint()->GetFrequency(); + return GetConstraint()->GetLimitsSpringSettings().mFrequency; } float JoltDistanceConstraint3D::GetMaxDistance() const @@ -157,7 +157,7 @@ namespace Nz void JoltDistanceConstraint3D::SetDamping(float damping) { - GetConstraint()->SetDamping(damping); + GetConstraint()->GetLimitsSpringSettings().mDamping = damping; } void JoltDistanceConstraint3D::SetDistance(float minDist, float maxDist) @@ -167,7 +167,7 @@ namespace Nz void JoltDistanceConstraint3D::SetFrequency(float frequency) { - GetConstraint()->SetFrequency(frequency); + GetConstraint()->GetLimitsSpringSettings().mFrequency = frequency; } void JoltDistanceConstraint3D::SetMaxDistance(float maxDist) diff --git a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp index 82478a2ec..fef957a92 100644 --- a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp @@ -325,7 +325,7 @@ namespace Nz UInt32 JoltPhysWorld3D::GetActiveBodyCount() const { - return m_world->physicsSystem.GetNumActiveBodies(); + return m_world->physicsSystem.GetNumActiveBodies(JPH::EBodyType::RigidBody); } Vector3f JoltPhysWorld3D::GetGravity() const @@ -468,7 +468,7 @@ namespace Nz std::size_t stepCount = 0; while (m_timestepAccumulator >= m_stepSize && stepCount < m_maxStepCount) { - m_world->physicsSystem.Update(stepSize, 1, 1, &m_world->tempAllocator, &jobSystem); + m_world->physicsSystem.Update(stepSize, 1, &m_world->tempAllocator, &jobSystem); for (JoltPhysicsStepListener* stepListener : m_stepListeners) stepListener->PostSimulate(); diff --git a/src/Nazara/JoltPhysics3D/JoltRigidBody3D.cpp b/src/Nazara/JoltPhysics3D/JoltRigidBody3D.cpp index 95cfa40bc..f90b170c8 100644 --- a/src/Nazara/JoltPhysics3D/JoltRigidBody3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltRigidBody3D.cpp @@ -214,7 +214,7 @@ namespace Nz { JPH::MassProperties massProperties = m_body->GetShape()->GetMassProperties(); massProperties.ScaleToMass(mass); - m_body->GetMotionProperties()->SetMassProperties(massProperties); + m_body->GetMotionProperties()->SetMassProperties(JPH::EAllowedDOFs::All, massProperties); } } } @@ -244,7 +244,7 @@ namespace Nz { JPH::MassProperties massProperties = m_body->GetShape()->GetMassProperties(); massProperties.ScaleToMass(mass); - m_body->GetMotionProperties()->SetMassProperties(massProperties); + m_body->GetMotionProperties()->SetMassProperties(JPH::EAllowedDOFs::All, massProperties); } } else