SpatialHash in version 6
Posted: Fri Oct 07, 2011 7:03 am
Hi,
I'm trying to get the hello chipmunk example working in the objective-C chipmunk environement (i.e. I've deleted the chipmunk files that are bundled with cocos2d). I've had to delete these lines from the init:
//cpSpaceResizeStaticHash(space, 400.0f, 40);
//cpSpaceResizeActiveHash(space, 100, 600);
//space->elasticIterations = space->iterations;
and these from the step routine:
//cpSpaceHashEach(space ->activeShapes, &eachShape, nil);
//cpSpaceHashEach(space->staticShapes, &eachShape, nil);
This results in a clean build but when I run it the little men no longer jiggle around to make room for each other. Seems that I've got rid of the old way of doing it (which I see from other posts here is no longer supported in version 6) but need a new way of doing it. Can someone point me in the right direction please? I'm pretty new to this.
Also I've just ordered "Learning Cocos2D: A Hands-on Guide to Building IOSGames with Cocos2D, Box2D, and Chipmunk (Addison-Wesley Learning Series)" Good book for someone getting up to speed in coco and chipmunk? Any other recommendations from anyone?
Thanks
Bobby
I'm trying to get the hello chipmunk example working in the objective-C chipmunk environement (i.e. I've deleted the chipmunk files that are bundled with cocos2d). I've had to delete these lines from the init:
//cpSpaceResizeStaticHash(space, 400.0f, 40);
//cpSpaceResizeActiveHash(space, 100, 600);
//space->elasticIterations = space->iterations;
and these from the step routine:
//cpSpaceHashEach(space ->activeShapes, &eachShape, nil);
//cpSpaceHashEach(space->staticShapes, &eachShape, nil);
This results in a clean build but when I run it the little men no longer jiggle around to make room for each other. Seems that I've got rid of the old way of doing it (which I see from other posts here is no longer supported in version 6) but need a new way of doing it. Can someone point me in the right direction please? I'm pretty new to this.
Also I've just ordered "Learning Cocos2D: A Hands-on Guide to Building IOSGames with Cocos2D, Box2D, and Chipmunk (Addison-Wesley Learning Series)" Good book for someone getting up to speed in coco and chipmunk? Any other recommendations from anyone?
Thanks
Bobby