addTorque: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 103586 by SimZor on 2017-06-22T19:40:23Z)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________
|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 [http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/classPxRigidBody.html#acb04ffc816d45afff2d04e93d7446e79 NVIDIA docs] <br>
|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 [http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/classPxRigidBody.html#acb04ffc816d45afff2d04e93d7446e79 NVIDIA docs] <br>
[[Image:addTorque.jpg|400px]]|= Description
[[Image:addTorque.jpg|400px]]|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________
| object '''addTorque''' torque |= Syntax
| object '''addTorque''' torque |SYNTAX=
|p1= object: [[Object]] - PhysX object|= Parameter 1
|p1= object: [[Object]] - PhysX object|= Parameter 1
|p2= torque: [[Array]] - world vector in format [x,y,z]  |= Parameter 2
|p2= torque: [[Array]] - world vector in format [x,y,z]  |= Parameter 2
Line 16: Line 16:
|p5=  |= Parameter 5
|p5=  |= Parameter 5
|p6=  |= Parameter 6
|p6=  |= Parameter 6
| [[Nothing]] |= Return Value
| [[Nothing]] |RETURNVALUE=
|x1= Apply torque [1000,0,0] to object not factoring object positioning:
|x1= Apply torque [1000,0,0] to object not factoring object positioning:
<code>_wheel [[addTorque]] [1000,0,0];</code>|= Example 1
<code>_wheel [[addTorque]] [1000,0,0];</code>|= Example 1
|x2= Apply torque [1000,0,0] relative to object:
|x2= Apply torque [1000,0,0] relative to object:
<code>_wheel [[addTorque]] (_wheel [[vectorModelToWorld]] [1000,0,0]);</code>|= Example 2
<code>_wheel [[addTorque]] (_wheel [[vectorModelToWorld]] [1000,0,0]);</code>|= Example 2
|[[addForce]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]] |= See Also
|[[addForce]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]] |SEEALSO=
}}
}}



Revision as of 12:25, 7 April 2019

Hover & click on the images for description

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
addTorque.jpg
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

See also:
addForcevectorModelToWorldvectorModelToWorldVisual

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

Bottom Section