CP_ARBITER_GET_SHAPES crash

Official forum for the Chipmunk2D Physics Library.
Post Reply
dpuertas
Posts: 1
Joined: Sat Apr 26, 2014 8:57 am
Contact:

CP_ARBITER_GET_SHAPES crash

Post by dpuertas »

Hello,

I'm new using Chipmunk and I'm unable to find out why the following crashes. The app makes some sprites fall from the top of the screen, this works fine.

In the init method I call the next:

Code: Select all

cpSpaceAddCollisionHandler(_space, GEM_COLLISION_TYPE, FLOOR_COLLISION_TYPE, (cpCollisionBeginFunc)beginCol, NULL, NULL, NULL, NULL);
And in the beginCol function this:

Code: Select all

static cpBool beginCol(cpArbiter *arb, cpSpace *space, void *data) {
    
    CP_ARBITER_GET_SHAPES(arb, a, b);
    
    cpSpaceAddPostStepCallback(space, (cpPostStepFunc)gemPostStep, a, NULL);
    
    return TRUE;
    
}
Well, the code crashes in the CP_ARBITER_GET_SHAPES line. I get an EXC_BAD_ACCESS and don't know why.
ganesha
Posts: 71
Joined: Mon Sep 06, 2010 1:29 pm
Contact:

Re: CP_ARBITER_GET_SHAPES crash

Post by ganesha »

It would be easier if you posted some examples how you create your objects.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests