void IDuringForcesUpdateable.Update(float dt)
{
if (Entity != AngularMotor.Entity)
throw new InvalidOperationException(
"EntityRotator's entity differs from EntityRotator's motor's entities. Ensure that the moved entity is only changed by setting the EntityRotator's entity property.");
if (Entity.IsDynamic)
{
AngularMotor.IsActive = true;
AngularMotor.Settings.Servo.Goal = TargetOrientation;
}
else
{
AngularMotor.IsActive = false;
Entity.AngularVelocity = GetAngularVelocity(Entity.Orientation, TargetOrientation, dt);
}
}
}