Problem with gravity and objects not colliding
Posted: Mon Sep 21, 2009 12:47 pm
Hi;
I'm working on an iPhone app and using chipmunk for physics. I have two basic types of blocks -- those that move, and those that don't. Creating static shapes for those that don't, and regular shapes for those that do. Everything moves just fine that needs to move. The problem is in that objects that move, that collide with objects that don't move, well, pass through the static object as if it wasn't there (slows down if I increase the friction coefficient, obviously, but still passes through). If I turn off gravity, I can still get the objects to move by setting up momentum in one direction using blockBody->v = cpv(...) and this works. The block stops on the static object, won't pass through it. However, when I make the static object disappear, the object does start moving again, but very very slowly, it won't gather momentum like it would with gravity in place.
I'm wondering if anyone has any suggestions as to how to simulate gravity, or better still, make my moving objects stop when they hit static objects.
I'm working on an iPhone app and using chipmunk for physics. I have two basic types of blocks -- those that move, and those that don't. Creating static shapes for those that don't, and regular shapes for those that do. Everything moves just fine that needs to move. The problem is in that objects that move, that collide with objects that don't move, well, pass through the static object as if it wasn't there (slows down if I increase the friction coefficient, obviously, but still passes through). If I turn off gravity, I can still get the objects to move by setting up momentum in one direction using blockBody->v = cpv(...) and this works. The block stops on the static object, won't pass through it. However, when I make the static object disappear, the object does start moving again, but very very slowly, it won't gather momentum like it would with gravity in place.
I'm wondering if anyone has any suggestions as to how to simulate gravity, or better still, make my moving objects stop when they hit static objects.