So, every once in a while, a body in my simulation will have an angle that is not normalized.
For example, a case here:
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?
Angle not normalized?
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Angle not normalized?
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.
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 25
- Joined: Sun May 24, 2009 11:04 pm
- Contact:
Re: Angle not normalized?
Thanks Scott,
That makes sense, I understand.
That makes sense, I understand.
Who is online
Users browsing this forum: No registered users and 27 guests