addTorque: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[.*\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
Lou Montana (talk | contribs) m (Text replacement - "[[Image:" to "[[File:") |
||
(21 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
|arma3 |= | |game1= arma3 | ||
|version1= 1.72 | |||
|arg= global | |arg= global | ||
|eff= global | |eff= global | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|Applies torque (rotation momentum) to the [[getCenterOfMass | 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 | |||
|descr= [[File:addTorque_correct.jpg|400px|right]] | |||
{{Feature | | Applies torque (rotation momentum) to the [[getCenterOfMass | 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 {{Link|http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/classPxRigidBody.html#acb04ffc816d45afff2d04e93d7446e79|NVIDIA docs}} <br> | ||
< | |||
{{Feature | important |This command doesn't follow convention for torque direction, which obeys right-hand rule. To comply, negate all values in the vector. }} | {{Feature|informative| | ||
| object | 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: | ||
<sqf>onEachFrame { quad addTorque (quad vectorModelToWorld [100,0,0]) };</sqf> | |||
}} | |||
{{Feature|important|This command doesn't follow convention for torque direction, which obeys right-hand rule. To comply, negate all values in the vector.}} | |||
|s1= object [[addTorque]] torque | |||
|p1= object: [[Object]] - PhysX object | |p1= object: [[Object]] - PhysX object | ||
|p2= torque: [[Array]] - world vector in format [x,y,z] | |p2= torque: [[Array]] - world vector in format [x,y,z] | ||
|r1= [[Nothing]] | |||
| | |||
|x1= Apply torque [1000,0,0] to object not factoring object positioning: | |x1= Apply torque [1000,0,0] to object not factoring object positioning: | ||
< | <sqf>_wheel addTorque [1000,0,0];</sqf> | ||
|x2= Apply torque [1000,0,0] relative to object: | |x2= Apply torque [1000,0,0] relative to object: | ||
< | <sqf>_wheel addTorque (_wheel vectorModelToWorld [1000,0,0]);</sqf> | ||
|seealso= [[addForce]] | |||
|seealso= [[addForce]] [[awake]] [[isAwake]] [[vectorModelToWorld]] [[vectorModelToWorldVisual]] [[disableBrakes]] [[brakesDisabled]] | |||
}} | }} | ||
Latest revision as of 23:10, 20 November 2023
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:
- Object Manipulation
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:
Additional Information
- See also:
- addForce awake isAwake vectorModelToWorld vectorModelToWorldVisual disableBrakes brakesDisabled
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