JoltPhysics3D: Update for v4
This commit is contained in:
parent
ddf0dc88bc
commit
f5df12e740
|
|
@ -137,12 +137,12 @@ namespace Nz
|
||||||
|
|
||||||
float JoltDistanceConstraint3D::GetDamping() const
|
float JoltDistanceConstraint3D::GetDamping() const
|
||||||
{
|
{
|
||||||
return GetConstraint<JPH::DistanceConstraint>()->GetDamping();
|
return GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mDamping;
|
||||||
}
|
}
|
||||||
|
|
||||||
float JoltDistanceConstraint3D::GetFrequency() const
|
float JoltDistanceConstraint3D::GetFrequency() const
|
||||||
{
|
{
|
||||||
return GetConstraint<JPH::DistanceConstraint>()->GetFrequency();
|
return GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
float JoltDistanceConstraint3D::GetMaxDistance() const
|
float JoltDistanceConstraint3D::GetMaxDistance() const
|
||||||
|
|
@ -157,7 +157,7 @@ namespace Nz
|
||||||
|
|
||||||
void JoltDistanceConstraint3D::SetDamping(float damping)
|
void JoltDistanceConstraint3D::SetDamping(float damping)
|
||||||
{
|
{
|
||||||
GetConstraint<JPH::DistanceConstraint>()->SetDamping(damping);
|
GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mDamping = damping;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JoltDistanceConstraint3D::SetDistance(float minDist, float maxDist)
|
void JoltDistanceConstraint3D::SetDistance(float minDist, float maxDist)
|
||||||
|
|
@ -167,7 +167,7 @@ namespace Nz
|
||||||
|
|
||||||
void JoltDistanceConstraint3D::SetFrequency(float frequency)
|
void JoltDistanceConstraint3D::SetFrequency(float frequency)
|
||||||
{
|
{
|
||||||
GetConstraint<JPH::DistanceConstraint>()->SetFrequency(frequency);
|
GetConstraint<JPH::DistanceConstraint>()->GetLimitsSpringSettings().mFrequency = frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JoltDistanceConstraint3D::SetMaxDistance(float maxDist)
|
void JoltDistanceConstraint3D::SetMaxDistance(float maxDist)
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ namespace Nz
|
||||||
|
|
||||||
UInt32 JoltPhysWorld3D::GetActiveBodyCount() const
|
UInt32 JoltPhysWorld3D::GetActiveBodyCount() const
|
||||||
{
|
{
|
||||||
return m_world->physicsSystem.GetNumActiveBodies();
|
return m_world->physicsSystem.GetNumActiveBodies(JPH::EBodyType::RigidBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3f JoltPhysWorld3D::GetGravity() const
|
Vector3f JoltPhysWorld3D::GetGravity() const
|
||||||
|
|
@ -468,7 +468,7 @@ namespace Nz
|
||||||
std::size_t stepCount = 0;
|
std::size_t stepCount = 0;
|
||||||
while (m_timestepAccumulator >= m_stepSize && stepCount < m_maxStepCount)
|
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)
|
for (JoltPhysicsStepListener* stepListener : m_stepListeners)
|
||||||
stepListener->PostSimulate();
|
stepListener->PostSimulate();
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
JPH::MassProperties massProperties = m_body->GetShape()->GetMassProperties();
|
JPH::MassProperties massProperties = m_body->GetShape()->GetMassProperties();
|
||||||
massProperties.ScaleToMass(mass);
|
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();
|
JPH::MassProperties massProperties = m_body->GetShape()->GetMassProperties();
|
||||||
massProperties.ScaleToMass(mass);
|
massProperties.ScaleToMass(mass);
|
||||||
m_body->GetMotionProperties()->SetMassProperties(massProperties);
|
m_body->GetMotionProperties()->SetMassProperties(JPH::EAllowedDOFs::All, massProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue