Attraction depending on velocity

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

Attraction depending on velocity

Postby Leib » Fri May 06, 2011 1:54 pm

Hi!

I'm absolutely new at scripting. I have been looking for this script, but haven't found anything about it. So, I need to make objects attraction to depend on its velocity, for example when velocity x= 10 m/s, then attraction= 20 . Attraction should also decrease, when object is slowing down.

Thank you!
Leib
 
Posts: 3
Joined: Fri May 06, 2011 1:48 pm

Re: Attraction depending on velocity

Postby bozbez » Fri May 06, 2011 5:14 pm

Velocity or speed? And what ratio of velocity to attraction?
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Attraction depending on velocity

Postby Leib » Fri May 06, 2011 5:46 pm

I'm thinking of velocity, so the rotating circle would gain attraction. I think, that ratio should be 4:1 (velocity:attraction)
Leib
 
Posts: 3
Joined: Fri May 06, 2011 1:48 pm

Re: Attraction depending on velocity

Postby Kilinich » Fri May 06, 2011 6:08 pm

No easy way to do it. You need a speed probe and script to change attraction.
For beginning you can pick my K-Probe, fix it to geom and set attraction = {scene.my.k1speed / 4}
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: Attraction depending on velocity

Postby bozbez » Fri May 06, 2011 6:27 pm

Tis is the kind of use i was thinking of with my velocity measurer ;)
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Attraction depending on velocity

Postby Leib » Fri May 06, 2011 8:26 pm

You're reading my mind... STOP IT!
Leib
 
Posts: 3
Joined: Fri May 06, 2011 1:48 pm

Re: Attraction depending on velocity

Postby Someone Else » Sat May 07, 2011 1:29 am

I would use this code of davidz40:
Code: Select all
textureMatrix=[e.pos(0)-textureMatrix(2), e.pos(1)-textureMatrix(3), e.pos(0), e.pos(1),(textureMatrix(0)^2+textureMatrix(1)^2)^0.5, 0.0, 0.0, 0.0, 0.0];

on an alternating collider, then multiply the appropriate value by a constant.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests