Angle not normalized?

Discuss any Chipmunk bugs here.
Post Reply
bram
Posts: 25
Joined: Sun May 24, 2009 11:04 pm
Contact:

Angle not normalized?

Post by bram »

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?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Angle not normalized?

Post by slembcke »

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/
bram
Posts: 25
Joined: Sun May 24, 2009 11:04 pm
Contact:

Re: Angle not normalized?

Post by bram »

Thanks Scott,
That makes sense, I understand.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests