This project is read-only.

Input and collision detection

Oct 22, 2008 at 10:11 AM

I'm having a bit of a problem with using input devices to control physic objects.

Here's my scenario:

I have a simple scene with a box placed on the ground. When the application loads a sphere falls unto the box. The sphere collides with the box and bounces as it's supposed to. Next I move the box away by updating the Position of its Body and the sphere falls to the ground.

I then move the box back, but as the box hits the sphere  "nothing" happens. The box just passes right through the sphere. However, using the CollisionSkin.callbackFn I can see that the two objects actually collide, nothing happens in response to that collision though.

I'm aware moving the box by updating the position is not the right way to do things, so maybe that's the cause of my problems. I've tried using controllers (as discussed in this thread but that didn't even move the box.

This is using JigLibX Beta release from April btw.

Does anyone have a real simple example of moving a simple primitive around which collides with other objects?

Oct 23, 2008 at 11:22 PM
The problem is moving the box by updating it's position, doing this essientially bypasses the physics collision code, and that's why it doesn't have any affect.

You need to move the box by either A. Adding Forces to it (Add Local/World Force) Or by setting it's velocity.