void IDuringForcesUpdateable.Update(float dt)
{
if (Entity != LinearMotor.Entity)
throw new InvalidOperationException(
"EntityMover's entity differs from EntityMover's motors' entities. Ensure that the moved entity is only changed by setting the EntityMover's entity property.");
if (Entity.IsDynamic)
{
LinearMotor.IsActive = true;
LinearMotor.Settings.Servo.Goal = TargetPosition;
}
else
{
LinearMotor.IsActive = false;
Vector3 worldMovedPoint = Vector3.Transform(LocalOffset, entity.WorldTransform);
Entity.LinearVelocity = GetLinearVelocity(worldMovedPoint, TargetPosition, dt);
}
}
}