Chipmunks Collision Detection

I'm brand new to the chipmunk and I just used it for a few days, so I assume this is something pretty obvious, however I cannot find any documentation for this. Is there any callback or chipmunk method that tells you that two given shapes collided?

If not, is this the best way to just use cgrectcontains for sprites?

-Oscar

+5
source share
2 answers

You can contact him at Ipthnc, but this is the documentation you are probably looking for - it details the callback system:

http://chipmunk-physics.net/release/ChipmunkLatest-Docs/#CollisionCallbacks

+5

:

http://code.google.com/p/chipmunk-physics/wiki/CollisionDetection

// Reference line
// Does not collide with other objects, we just want to draw it.
shape = cpSegmentShapeNew(staticBody, cpv(-320,0), cpv(320,0), 0.0f);
shape->collision_type = 1;
cpSpaceAddStaticShape(space, shape);
// Add a collision pair function to filter collisions
cpSpaceAddCollisionPairFunc(space, 0, 1, NULL, NULL);

, Google Code Search:

http://www.google.com/codesearch?q=lang:c+chipmunk+collision&hl=en&btnG=Search+Code

+5

All Articles