Need help with spawn engine

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

Need help with spawn engine

Postby alex55 » Sun May 16, 2010 1:32 pm

I did spawn the engine, but at a high speed transport the ball flies out of the engine.
To avoid this, I put "vel" in script:

Code: Select all
(e)=>{
    scene.my.xv = vel(0);     scene.my.yv = vel(1) }


spawner code:

Code: Select all
(e)=>{
    scene.addcircle({         radius := 0.5;         density = 100000;         pos := e.pos;         collideset := 5;         heterocollide := true;         vel := [scene.my.xv, scene.my.yv]     }) }


and it does`t work

sorry for bad English, I used a translator
Attachments
enginebug.phz
(451.56 KiB) Downloaded 47 times
alex55
 
Posts: 3
Joined: Tue Feb 23, 2010 7:58 pm

Re: Need help with spawn engine

Postby KarateBrot » Sun May 16, 2010 2:25 pm

That's because you have to make velocity calculation on your own. It's not implemented in algodoo so you can't just type in vel(0) and vel(1). They don't exist.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Need help with spawn engine

Postby itsallinyourhead » Thu Jul 01, 2010 5:54 am

try setting vel in relation to normal like this:

e)=>{
scene.addcircle({ radius := 0.5; density = 100000; pos := e.pos; collideset := 5; heterocollide := true; vel := (e.normal * (some number))

you'll need to figure out how the 'some number' affects the velocity. I constantly have to adjust for objects going the absolute opposite direction that I want them to, the first time i fire up the sim.
itsallinyourhead
 
Posts: 3
Joined: Thu Jul 01, 2010 5:26 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests