Cache angular impulse to use in force limits
This commit is contained in:
parent
c0b614ec1c
commit
2e4e37be8a
|
@ -199,7 +199,8 @@ void JoltPhysicsConstraint::SetAngularMotor( float rotSpeed, float maxAngularImp
|
||||||
pConstraint->SetTargetAngularVelocity( rotSpeed );
|
pConstraint->SetTargetAngularVelocity( rotSpeed );
|
||||||
|
|
||||||
JPH::MotorSettings &motorSettings = pConstraint->GetMotorSettings();
|
JPH::MotorSettings &motorSettings = pConstraint->GetMotorSettings();
|
||||||
motorSettings.SetForceLimits( -fabsf( maxAngularImpulse ), fabsf( maxAngularImpulse ) );
|
const float angularImpulse = fabsf( maxAngularImpulse );
|
||||||
|
motorSettings.SetForceLimits( -angularImpulse, angularImpulse );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue