Simple RPM meter

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

Simple RPM meter

Postby Kilinich » Tue Oct 11, 2011 11:45 am

Since Algodoo2 fire onCollide every step (not every frame), we can use simplified scripts for measuring:

Unsigned RPM from on collide (just make it collide for sure):
Code: Select all
scene.my.rpm = math.acos(e.normal(0) * e.this.normal(0) + e.normal(1) * e.this.normal(1)) * Sim.frequency * 9.5492966;
e.this.normal = e.normal;

[scene]58133[/scene]
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: Simple RPM meter

Postby KarateBrot » Tue Oct 11, 2011 7:55 pm

neat! i never thought of it by using the scalar product.

btw do you know a way to control the frequency for lasers a bit better? because it seems that it not totally constant all the time. (or is it different in algodoo 2 now?)
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Simple RPM meter

Postby Kilinich » Tue Oct 11, 2011 11:07 pm

In 2.0 onCollide fires every step and onLaserHit/onHitByLaser every frame (usually once per 1-2 or 3 steps).
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: Simple RPM meter

Postby thebeech » Fri Feb 24, 2012 9:07 pm

Can't seem to get this to work on my scene's in algodoo - keeps jumping between figures that are less than 1 and then jumping up into the 1000's, only seems to show the right RPM once then jumps to a random figure :/
Image
thebeech
 
Posts: 241
Joined: Mon Aug 31, 2009 8:32 pm
Location: Your Hardrive

Re: Simple RPM meter

Postby Kilinich » Fri Feb 24, 2012 10:11 pm

Foregt it - you have readable in Algodoo2
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 5 guests