bodies go through walls?
Posted: Fri Aug 07, 2009 8:45 am
Ok, I've been working with chipmunk on the iPhone now for a few weeks ( via cocos2d ). As a test, I have four circles I am throwing around and four walls ( bounding the entire screen ). I can grab the circles, move them around, then use cpApplyImpulse to look like they are being thrown when I release them. It all works great and seems fine. But I can "push" them through the walls, if I grab one and drag it to the wall quickly, it will disappear, when I look at the body position, it is way outside my 300x480 screen.
I've tried making the walls thicker, changing the dt/number of steps, etc. and still no luck. I even downloaded the "grabbed_too" project and built and ran that to see how it behaved and it does the same thing ( allows me to move the balls through the walls, even if I modify that project to make the walls thicker ).
If I reduce my impulse it will not go through walls, but then the bodies do not move much either, which is not desirable. I am assuming many ( if not all ) of the developers using chipmunk have solved this and maybe I will as well, but I was hoping for some tips on what to do. Maybe an example project sitting out there somewhere that has all of this coded working to play with?
Any help or direction would be appreciated.
Thanks,
RK
I've tried making the walls thicker, changing the dt/number of steps, etc. and still no luck. I even downloaded the "grabbed_too" project and built and ran that to see how it behaved and it does the same thing ( allows me to move the balls through the walls, even if I modify that project to make the walls thicker ).
If I reduce my impulse it will not go through walls, but then the bodies do not move much either, which is not desirable. I am assuming many ( if not all ) of the developers using chipmunk have solved this and maybe I will as well, but I was hoping for some tips on what to do. Maybe an example project sitting out there somewhere that has all of this coded working to play with?
Any help or direction would be appreciated.
Thanks,
RK