spring lengh / speed of object

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

spring lengh / speed of object

Postby hecta » Fri Feb 03, 2012 2:51 pm

is there a script that can change the lengh of a spring depending on the speed of an other object or depending on the speed of rotation of that object ?
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am

Re: spring lengh / speed of object

Postby Kilinich » Fri Feb 03, 2012 4:30 pm

You plan to use it as dashboard i suppose. np with that.

Read data in some probe (for example set one of the geom)
density = {v = (readable(owner)).vel; scene.my.speed = (v(0)^2 + v(1) ^2)^0.5; 2}

set spring length = {scene.my.speed/10 + 1}
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

Re: spring lengh / speed of object

Postby hecta » Fri Feb 03, 2012 11:45 pm

well thats not what i wanted to do with it, but it will sitll work i supose.Thanks
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests