No apparent collision response in my simple scene.

May 6, 2008 at 5:50 AM
Hi! It will help me to integrate the Ox game engine with JigLibX if you help me with the problem.

I have set up a simple scene with the following -

  1. 32 red spheres sitting in the air, not affected by gravity, and all spread vertically from one another
  2. 1 blue sphere affected by gravity placed over the top of the previously mentioned spheres

Both sphere types have the same mass of 10.

I used the approach as shown in the JiggleGame to construct and set up the bodies / skins / primitives.

This is the description of what happens -

  1. I start the scene, and the blue sphere begins to fall correctly.
  2. The blue sphere then eventually collides with the topmost red sphere, and the collision event happens correctly.
  3. The blue sphere falls through the red sphere, and no seeming collision response happens
  4. On and on it passes through all remaining red spheres, seemingly affecting none of them, and not being affected itself.

I've placed a breakpoint on line 561 in PhysicsSystem.ProcessCollision -
(body0.ApplyBodyWorldImpulse(ref impulse, ref ptInfo.info.R0);)
- and I hit the break point. So it seems that an implulse is applied in response to the collision. But this is not reflected visually in the simulation. It seems to me that since both spheres are the same mass, the spheres should bounce off of one another.

I have compared my code very closely to the code in JiggleGame and cannot for the life of me see any relevant differences, except that JiggleGame has collision response whereas mine does not.

Please help me if you can.

Thanks !
May 10, 2008 at 3:52 AM
Hey ya'll. Disregard this question as the problem had nothing to do with JigLibX, but rather in simple bug in my code. I managed to accidentally set the blue sphere's collision skin as the collision skin of all the red spheres! Oops!

Issue is closed :)