cpSpaceAddCollisionPairFunc performance
Posted: Sun Jul 26, 2009 4:57 pm
I'm developing a game on the iPhone and use Chipmunk. I've noticed something about cpSpaceAddCollisionPairFunc. When I implemented more than one CollisionPairFunc the performance was suffering alot. But as soon as a only use one of the below the fps goes up.
Is this expected behavour? Should I only use one and inside that function determine what kind of collision it is? I can go either way but I want to know what is best from a performance point?
Is this expected behavour? Should I only use one and inside that function determine what kind of collision it is? I can go either way but I want to know what is best from a performance point?
Code: Select all
cpSpaceAddCollisionPairFunc(space, 2, 1, &Damage, self);
cpSpaceAddCollisionPairFunc(space, 3, 1, &DamageMine, self);
cpSpaceAddCollisionPairFunc(space, 2, 0, &EnemyCollision, self);