JoltPhysics3D: Update for v4

This commit is contained in:
SirLynix 2023-11-15 08:08:45 +01:00
parent ddf0dc88bc
commit f5df12e740
3 changed files with 8 additions and 8 deletions

View File

@ -137,12 +137,12 @@ namespace Nz
float JoltDistanceConstraint3D::GetDamping() const
{
return GetConstraint<JPH::DistanceConstraint>()->GetDamping();
return GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mDamping;
}
float JoltDistanceConstraint3D::GetFrequency() const
{
return GetConstraint<JPH::DistanceConstraint>()->GetFrequency();
return GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mFrequency;
}
float JoltDistanceConstraint3D::GetMaxDistance() const
@ -157,7 +157,7 @@ namespace Nz
void JoltDistanceConstraint3D::SetDamping(float damping)
{
GetConstraint<JPH::DistanceConstraint>()->SetDamping(damping);
GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mDamping = damping;
}
void JoltDistanceConstraint3D::SetDistance(float minDist, float maxDist)
@ -167,7 +167,7 @@ namespace Nz
void JoltDistanceConstraint3D::SetFrequency(float frequency)
{
GetConstraint<JPH::DistanceConstraint>()->SetFrequency(frequency);
GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mFrequency = frequency;
}
void JoltDistanceConstraint3D::SetMaxDistance(float maxDist)

View File

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

View File

@ -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