[CHIPMUNK] How do I manually check for collision?

Posts: 43
Joined: 2009.02
Post: #1
Im using Chipmunk just because I'm too lazy to check for collisions myself.

In my set up, the world has no gravity. The 'body's of my shapes (a ball and a paddle, thing pong) have circular shapes, and have 1 mass and 0 inertia.

How can I put into my tick to check for collisions? Currently I tell the ball to just move, but I'd like to make a collision check in the move function, something like:

ball.collideswith(paddle) or something?
Quote this message in a reply
Posts: 1,487
Joined: 2002.09
Post: #2
Chipmunk's collision detection was written to be used from the physics engine itself. Getting just collision detection without physics is not going to be simple. I could go through the steps required to do it, but it would be a waste of both of our time.

The source is free, just look at how it's implemented. The circle to circle and circle to line collision code is very short.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply