Jump to content

Calculating torque in LE?


Andy Gilbert
 Share

Recommended Posts

Hi tyler, Cant find that in the wiki? Only:

 

4.4 Check state (Get...)

4.4.1 GetBodyVelocity

4.4.2 GetBodyOmega <---- ???

4.4.3 GetBodyMass

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

GetBodyOmega() should be called actually GetBodyTorque(). The term Omega makes really no sense here, as it's only the angle of the force perpendicular to the radius at where the force is applied from the center of the pivot, which should always result in sin(Omega)=1.0.

Torque = Tau = r * F * sin(Omega).

However, using angles in mathematics and physics is obsolete, and you should use vectors only:

Torque = Tau = rvec x Fvec

  • Upvote 1

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Lumooja has the right point here.

 

I knew of GetBodyOmega, which is just angular velocity. GetBodyTorque should be implemented such as he said.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

A get force or get torque command would only return the force that has been applied by the user since the previous physics update. It does not correspond to velocity or omega (angular velocity).

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Well, it's as simple as renaming the GetBodyOmega() to GetBodyAngularVelocity(). Currently it returns the angular velocity anyway (a Vec3), and not the Omega (which is the "1/cos(tan(wrong direction of the force))" or whatever the anti-sin(Omega) is), also a Vec3).

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I see. It seems physicians are using the same name (Omega) for two different things. In velocity formulas it seems to be used for the angular speed, but in torque formulas it's used as angle of the force (or like I like to say: "1-wrongness of the direction of the force"):

http://en.wikipedia.org/wiki/Torque

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Oh, american/british english strikes again :)

In international english it is related to physics, like magician is related to magic, canardian is related to canards, or norwegian is related to norway.

Both the role of the physician and the meaning of the word itself vary significantly around the world.

In international english, we call those who (often unsuccesfully) experiment with human bodies, doctors. They use doctrines based on mutual feelings and mutual information, without actually knowing how the human body or its DNA works. It's like a computer programmer who has no clue what processors, bits and bytes are, and just copy pastes code since it worked for someone else in a similar situation :)

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...