e.normal to angle conversion

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

e.normal to angle conversion

Postby Kilinich » Wed Oct 06, 2010 9:17 pm

I think it's one of the simplest...

Code: Select all
scene.my.n2a = (n) => {math.acos(n(0)) * (n(1) > 0 ? 1 : -1)}


usage example
Code: Select all
angle = scene.my.n2a(e.normal)
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests