Script angle please help
3 posts • Page 1 of 1
Script angle please help
Hello everyone I need a script that detect the angular velocity of a wheel someone could help me with the script that i need
?
- kakaman
- Posts: 1
- Joined: Thu Jan 16, 2014 8:25 pm
Re: Script angle please help
You can grab an geometries angular velocity with the angvel variable, so you should be able to place that onto a variable as needed.
e.g. scene.my.speed = e.geom.angvel; (using a laser). I'm pretty sure you could also grab the code from the "update" box with:
scene.my.speed = entity.angvel; however I can't guarantee this will work due to the time I actually spend on algodoo now a days.
e.g. scene.my.speed = e.geom.angvel; (using a laser). I'm pretty sure you could also grab the code from the "update" box with:
scene.my.speed = entity.angvel; however I can't guarantee this will work due to the time I actually spend on algodoo now a days.
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: Script angle please help
electronicboy wrote: e.g. scene.my.speed = e.geom.angvel; (using a laser). I'm pretty sure you could also grab the code from the "update" box with:
scene.my.speed = entity.angvel; however I can't guarantee this will work due to the time I actually spend on algodoo now a days.
Yes, that will in fact work. You don't need "entity" unless your code gets complex. So, for simple scripts, scene.my.speed = angvel will work just fine. Keep in mind that the value produced in angvel is in units of rads/sec. So, if you wanted RPM or some other unit, then you would need to do a little conversion math on the value.
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests



