addTorque: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
[[Image:addTorque_correct.jpg|400px]] | [[Image:addTorque_correct.jpg|400px]] | ||
{{Informative | A single application of torque would produce one impulse, which may not be enough. In this case consider applying a series of continuous impulses, for example to make a quad bike to roll forward: | {{Informative | A single application of torque would produce one impulse, which may not be enough. In this case consider applying a series of continuous impulses, for example to make a quad bike to roll forward: | ||
<code>[[onEachFrame]] { quad [[addTorque]] (quad [[vectorModelToWorld]] [100,0,0]) }</code>}}|DESCRIPTION= | <code>[[onEachFrame]] { quad [[addTorque]] (quad [[vectorModelToWorld]] [100,0,0]) }</code>}} | ||
{{Important |This command doesn't follow convention for torque direction, which obey right-hand rule. To comply negate all values in the vector. }}|DESCRIPTION= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| object '''addTorque''' torque |SYNTAX= | | object '''addTorque''' torque |SYNTAX= |
Revision as of 09:24, 9 July 2020
Description
- Description:
- Applies torque (rotation momentum) to the center of mass of the given object. Torque force is defined as vector [x, y, z] applied in world space. If you need to define torque in model space, convert the torque vector first by vectorModelToWorld or vectorModelToWorldVisual command. The torque applied as impulse. Diagram below explain which way the object would rotate. For more information see NVIDIA docs
- Groups:
- Uncategorised
Syntax
- Syntax:
- object addTorque torque
- Parameters:
- object: Object - PhysX object
- torque: Array - world vector in format [x,y,z]
- Return Value:
- Nothing
Examples
- Example 1:
- Apply torque [1000,0,0] to object not factoring object positioning:
_wheel addTorque [1000,0,0];
- Example 2:
- Apply torque [1000,0,0] relative to object:
_wheel addTorque (_wheel vectorModelToWorld [1000,0,0]);
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note