Hello,
In the process of making my first game, I noticed that chipmunk runs really slow on the device. My game is separated into levels, The levels vary, but max I have around 100 cpSegments. And around 14 cpBodies as objects, and then probably another 20 as bullets.
Is this too much for the iphone to handle??? (I have chipmunk stepping every-step.)
Another thing that'ss been driving me crazy about chipmunk is that my player, a circle made like so:
body = cpBodyNew(10.0, cpMomentForCircle(10.0, 29, 29, cpvzero));
Is moving through the boxes. But not as if there is nothing there. If it hits from above, it will work. But if it rams from a side, it starts to go through, then it like jumps. Its really odd. (Mind non of this happens on the simulator.)
Boxes are made like
body = cpBodyNew(10.0, cpMomentForPoly(10.0, num, verts, cpvzero));
Info:
Using cocos 8.2
Using chipmunk trunk pre 5.0 release.
I have been trying to figure this stuff out myself, and its just making me crazier and crazier.
My init Code :
space = cpSpaceNew();
cpSpaceResizeActiveHash(space, 32, 120);
cpSpaceResizeStaticHash(space, 48, 600);
space->gravity = cpv(0,-200);
space->iterations = 5;
Another weird problem I am having is adding a joint kills my fps. Like cuts it in half.
This is for dragging and dropping objects.
mouseMotor = cpDampedRotarySpringNew(mouseBody, draggedBody, draggedBody->a, 0, 100000);
mouseJoint = cpPivotJointNew2(mouseBody, draggedBody, cpvzero, cpBodyWorld2Local(draggedBody, globalLocation));
mouseJoint->maxForce = 50000.0f;
mouseJoint->biasCoef = 0.15f;
cpSpaceAddConstraint([g space], mouseMotor);
cpSpaceAddConstraint([g space], mouseJoint);
Thanks for the help!!!!!!!!
(sorry this was so long)