heron
heron copied to clipboard
Allow to apply velocity to any entity (not only dynamic/kinematic bodies)
A sensor is NOT an actual physics body. But that doesn't mean we don't want to move or rotate it. There are plenty of use-case where we may want to move some sensor without having to make it a "dynamic" body. It would be much easier if I could simply use the velocity component for them.
Thinking about it, the Velocity could work for any entity. And the behavior would be:
- For dynamic bodies: Apply the velocity, and let rapier continue the simulation (incl. mutating the velocity)
- For kinematic bodies: Update the
next_positionat each steap and let rapier continue the simulation (not mutating the velocity) - For static bodies and sensors: Teleport the body each frame at the desired velocity ignoring physics rules.
- For an entity without the
Bodycomponent: Update theTransformeach frame at the desired velocity.