hoping someone could explain something about these engines

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
TheSparrow
Posts: 1
Joined: Mon Nov 19, 2012 4:48 pm

hoping someone could explain something about these engines

Post by TheSparrow »

Hi, I came here to see if someone could solve a mystery that's been bugging me about physics engines since I knew about them.

Coding physics gives me a bigger kick than cocaine, and seeing videos like the fast multiphysics one on the main page feels like the second coming.

I am busy coding some simple physics just for the fun of it and I need some help. Say an arrow strikes a target, as the arrow penetrates and travels into the target, it decelerates, and the target accelerates. The arrow applies a force on the box, and the box a force on the arrow. This is all fine and well for our minds since we don't work in time steps, but in a physics engine, such as Bullet, it can't imagine a continuous force and deceleration.

If I had to do a very simple collision I would just do conservation of momentum on both objects, but this doesn't simulate deceleration. If I had to simulate a collision in bullet and slow down time, I wouldn't see the objects gradually changing velocity right? It would be an instantaneous change in velocity. But I know for a fact that a physics engine like bullet works on a list of forces acting on a body and not transfer of momentum.

can someone tell me what steps the engine takes to solve this? Does it calculate change in kinetic energy? Does it use impulse of a collision? If so, how does it know how long a collision takes to complete? If it works out a force, how does it know how long to apply that force for. And how the hell to these amazing pieces of code keep stacked objects from freaking out, or for that matter even keep an object on a floor from vibrating like crazy due to rounding error from canceling the normal and gravitational?

I don't know exactly how to ask this, but if I'm not being clear I'll happily try and clarify.

And to the people who code these things... Sirs, I give you my deepest respects.
Post Reply