Angle not normalized?

Discuss any Chipmunk bugs here.

Angle not normalized?

Postby bram » Fri Jun 28, 2013 1:32 pm

So, every once in a while, a body in my simulation will have an angle that is not normalized.
For example, a case here:

Image

I would expect cpBodyGetAngle() to return a value between -pi and +pi

Now granted, I set the angular velocity of the body (with circle shape) each frame.
But surely this should not lead to non normalized angles?

Is this a bug?
bram
 
Posts: 25
Joined: Sun May 24, 2009 11:04 pm

Re: Angle not normalized?

Postby slembcke » Fri Jun 28, 2013 2:27 pm

Nope, it's intended behavior. I used to normalize the angle, but it prevented a lot of things. Angular constraints of more than a full revolution were not possible, gear joints weren't possible for instance. A lot of math is just obnoxious when you have to deal with cyclic differences. You couldn't count the number of revolutions that an object spins... etc etc etc

Overall, there just was little to no reason to continue normalizing it and many reasons not to.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Angle not normalized?

Postby bram » Fri Jun 28, 2013 8:06 pm

Thanks Scott,
That makes sense, I understand.
bram
 
Posts: 25
Joined: Sun May 24, 2009 11:04 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest