WittyUserName
25-02-2010 03:11:52
Hi all,
(I posted this sort of question in the Bullet forums last week, but nobody has responded over there, so I'm asking here; my apologies for the Bullet-specificness of my question.)
I set up a simple test scene with two spheres of equal size/mass, both with restitution of 1.0; one is at rest, the other is moving such that it will collide head-on with the other. There is zero gravity. Momentum is conserved in the collision, but about half the energy is lost--both spheres are moving forward after the collision with roughly half the velocity of the original moving sphere. In a real elastic collision like this, 100% energy conservation would leave the originally moving sphere at rest, with the other moving off at the velocity the other sphere had before the collision.
Is there any way to make Bullet conserve energy during collisions? I tried adjusting the velocities of the spheres in a collision callback, and this works for simple collisions between two objects, but with situations in which an object might contact multiple objects during a single tick, this doesn't seem to work well, because (I think) the object positions were updated with incorrect velocities between collision time and the end of the tick. (They re-collide on subsequent time steps when they should be moving cleanly away from each other).
Thanks!
(I posted this sort of question in the Bullet forums last week, but nobody has responded over there, so I'm asking here; my apologies for the Bullet-specificness of my question.)
I set up a simple test scene with two spheres of equal size/mass, both with restitution of 1.0; one is at rest, the other is moving such that it will collide head-on with the other. There is zero gravity. Momentum is conserved in the collision, but about half the energy is lost--both spheres are moving forward after the collision with roughly half the velocity of the original moving sphere. In a real elastic collision like this, 100% energy conservation would leave the originally moving sphere at rest, with the other moving off at the velocity the other sphere had before the collision.
Is there any way to make Bullet conserve energy during collisions? I tried adjusting the velocities of the spheres in a collision callback, and this works for simple collisions between two objects, but with situations in which an object might contact multiple objects during a single tick, this doesn't seem to work well, because (I think) the object positions were updated with incorrect velocities between collision time and the end of the tick. (They re-collide on subsequent time steps when they should be moving cleanly away from each other).
Thanks!