jcornaz / heron

[DISCONTINUED] An ergonomic physics API for bevy games
MIT License
292 stars 44 forks source link

Fixed KinematicVelocityBased not moving #146

Closed eric556 closed 3 years ago

eric556 commented 3 years ago

Fixed KinematicVelocityBased not moving and added an example. Not entirely sure if set_position is the right thing to do there but its gets objects moving.

Possible fix for #145

jcornaz commented 3 years ago

Hi, Thanks for the contribution :-)

The way I remember it, set_position updates the position but doesn't update the velocity of the object, wich makes non-realistic simulation in case a dynamic object hits the kinematic body.

But that may have changed since the introduction of velocity-based kinematic bodies. I have to look at that.

eric556 commented 3 years ago

I can test it out against dynamic bodies some time today to see if thats still working. Ill add some dynamic objects in the example that you can push around. When I was digging around it looked like body.position() was never returning anything but the initial value that it was set to in the spawn startup_system. So it looks like when we set the next kinematic position it isnt being propagated to the actual position

edgarssilva commented 3 years ago

This can leave to unexpected behaviour specially in collision detection. Also talked about it in here.

eric556 commented 3 years ago

Im going to close this one in favor of #148