self.grab beginLocation moves all bodies off screen

Official forum for the Chipmunk2D Physics Library.
Post Reply
QuantumDoja
Posts: 5
Joined: Tue Jul 24, 2012 5:14 pm
Contact:

self.grab beginLocation moves all bodies off screen

Post by QuantumDoja »

Hi,

I've started to use: [self.grab beginLocation:], it works fine on iOS, but on the Mac, when I run it, it moves all of my bodies off of the screen, and there location is: nan, nan.

Has anyone else had a smilier problem?

Thanks

Chris
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: self.grab beginLocation moves all bodies off screen

Post by slembcke »

Hmm. Are you grabbing static shapes maybe? By far the most common way to end up with NaNs is to allow infinite mass objects to collide or be jointed together.

The current version ChipmunkMultiGrab doesn't automatically filter those out for you. I usually recommend using one of the layer bits or a "static geometry" group as a quick simple filter.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
QuantumDoja
Posts: 5
Joined: Tue Jul 24, 2012 5:14 pm
Contact:

Re: self.grab beginLocation moves all bodies off screen

Post by QuantumDoja »

Thanks, I am specifying a layer in the grabber, it's just weird that it only happens on the mac version. It's the same code as the iOS version, just using the mac built chipmunk library...
QuantumDoja
Posts: 5
Joined: Tue Jul 24, 2012 5:14 pm
Contact:

Re: self.grab beginLocation moves all bodies off screen

Post by QuantumDoja »

Just a note, no, I'm not trying to grab a static body. I'll keep digging....
QuantumDoja
Posts: 5
Joined: Tue Jul 24, 2012 5:14 pm
Contact:

Re: self.grab beginLocation moves all bodies off screen

Post by QuantumDoja »

Ok, I'm getting closer.

I removed the libraries from the project and the headers. I then imported all of the code directly into my project so I could debug it and to my surprise I don't get any nan's anymore, and everything remains on screen, so I'm guessing the library that I built and included was misconfigured in someway. I'll keep digging.

Chris
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: self.grab beginLocation moves all bodies off screen

Post by slembcke »

Any luck figuring this out yet? Need an extra pair of eyes to look at it?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests