Checking impact angle at 180°|+-math.pi rad

About advanced scenes, and the Thyme scripting language used in Algodoo.

Checking impact angle at 180°|+-math.pi rad

Postby FRA32 » Sun Aug 09, 2015 12:41 pm

For my games I frequently use a script that checks the angle of any collision to see if its on the "ground". Now I encountered a problem when working at angles in the area of 180°, as algodoo has its numeric divide there, with the one side beeing +math.pi descending, and the other one vice versa. This makes it hard for me to check if the collision angle is less than 45° and more than -45°as 1 of the numbers lies in the negative area, 360° away from the mathematical scanning field. does anyone know how to fix this issue in a dynamic way, so that it works with any scanning rotation?
FRA32
 
Posts: 229
Joined: Wed Dec 03, 2014 9:51 pm

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 10 guests

cron