totimp3

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

totimp3

Postby Kilinich » Mon Dec 01, 2014 4:20 pm

With that property you could read forces and torque applyed to hinge. Precise and fast.
totImp3 -> [fx,fy,m]
1N is 1/60 (for some reason) so just multiply result to get newtons or Nm.

Rating: rated 6.5
Filesize: 29.17 kB
Comments: 3
Ratings: 4
download
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: totimp3

Postby Kilinich » Tue Dec 02, 2014 10:50 am

s_noonan corrected me (thanks):

_forceX = {(readable(entity)).totImp3(0) * sim.frequency}
_forceY = {(readable(entity)).totImp3(1) * sim.frequency}
_torque = {(readable(entity)).totImp3(2) * sim.frequency}

If you want get weight - multiply to gravity strength.
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: totimp3

Postby pnvv » Mon Dec 15, 2014 1:33 am

I get the torque thing, that's cool. But the weight seems a bit pointless because couldn't you just look at information or script menu?
Image

(/)(°,,,°)(/)
User avatar
pnvv
 
Posts: 670
Joined: Tue Aug 26, 2014 11:46 pm
Location: Disunited States of America

Re: totimp3

Postby Kilinich » Mon Dec 15, 2014 1:43 am

pnvv wrote:I get the torque thing, that's cool. But the weight seems a bit pointless because couldn't you just look at information or script menu?

Sometimes you need to get force, not weight.
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: totimp3

Postby pnvv » Mon Dec 15, 2014 4:37 am

Kilinich wrote:Sometimes you need to get force, not weight.

Oh, I get it now.

I wonder if this could be used for a force-sensitive dummy that you could put in breakable cars and stuff. Then when you crash it, it tells you if he would have died or not.
Image

(/)(°,,,°)(/)
User avatar
pnvv
 
Posts: 670
Joined: Tue Aug 26, 2014 11:46 pm
Location: Disunited States of America

Re: totimp3

Postby zindagi » Thu Feb 19, 2015 8:49 am

the weight seems a bit pointless because couldn't you just look at information or script menu?
Sign up with Certkiller ccnp tshoot pdf ccna for getting incredible online testking courses a plus 220-801 tutorials
zindagi
 
Posts: 1
Joined: Thu Feb 19, 2015 8:46 am

Re: totimp3

Postby Kilinich » Thu Feb 19, 2015 11:45 am

zindagi wrote:the weight seems a bit pointless because couldn't you just look at information or script menu?

You couldn't use that info window data in your own scripts.
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: totimp3

Postby JakubKubo » Mon Nov 02, 2015 10:50 pm

_forceX/Y = {(readable(entity)).totImp3(0) * sim.frequency} is that force what break hinges if it is big enough?
JakubKubo
 
Posts: 18
Joined: Thu Mar 12, 2015 6:27 pm

Re: totimp3

Postby Kilinich » Mon Nov 02, 2015 11:08 pm

JakubKubo wrote:_forceX/Y = {(readable(entity)).totImp3(0) * sim.frequency} is that force what break hinges if it is big enough?


What? No. There is impulseLimit and distanceLimit for that... totImp3 is just for reading.
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: totimp3

Postby Kitesurfer » Fri Mar 12, 2021 1:53 pm

It's the same with totImp in springs, you need to multiply it by sim.frequency to get the current spring force.
Kitesurfer
 
Posts: 10
Joined: Thu Jan 07, 2021 5:27 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests