How to detect angles in wck

Post about the Flash World Construction Kit and the Alchemy port of Box2D.
mayobutter
Posts: 915
Joined: Fri Dec 14, 2007 8:07 pm
Contact:

Re: How to detect angles in wck

Postby mayobutter » Fri Jul 12, 2013 3:16 pm

IstvanOrosi wrote:If I remember correctly, object rotation values will be between 180 and -180, so your current code will not be able to do what you want. That's why you have to use your own rotation variable and keep track if the object has rotated more than 180 (or -180)


If that's true you could probably just keep track of the rotation value from the previous frame and check if it suddenly flips from positive to negative for large rotation values.

jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Re: How to detect angles in wck

Postby jinisner » Sat Jul 13, 2013 9:26 am

@Istvan , @Mayo - thanks a lot i will give that a try and let you know soon ...

Regards
Jin

IstvanOrosi
Posts: 172
Joined: Thu Mar 01, 2012 9:31 am

Re: How to detect angles in wck

Postby IstvanOrosi » Sat Jul 20, 2013 9:12 pm

I checked it and rotation angle values are indeed between 180 and -180.

jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Re: How to detect angles in wck

Postby jinisner » Tue Jul 23, 2013 10:12 am

@istvan - yes i also found that but still if the body rotates fast it does not detect backflip and frontflip but shows front flip once and backflip next and vice versa ....

Thanks for the help once again ...

Regards
Jin


Return to “WCK”



Who is online

Users browsing this forum: No registered users and 1 guest