开发者

Chipmunk shapes not colliding

I am able to create spaces, bodies, and shapes, put them together, and draw them on screen... yet somehow none of my shapes are interacting with each other or colliding. My collision callback isn't getting called either. What could be causing this?

I create a space:

cpSpace *space = cpSpaceNew();
cpSpaceSetDefaultCollisionHandler(space,handleCollision,NULL,NULL, NULL,self);

I create bodies:

body = cpBodyNew(mass, moment);

I create shapes for the bodies:

cpCircleShapeNew(body, radius, offset);

I add the body to the space:

cpSpaceAddShape(space, shape);

I step through time, (and draw开发者_高级运维, obviously):

cpSpaceStep(space, dt);

And yet my shapes and bodies refuse to interact with eachother.


lol! forgot to call cpInitChipmunk()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜