addForce: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...)
Line 1: Line 1:
{{Command|Comments=
{{Command
|arma3 |= Game
|arma3 |= Game
|1.72|Game Version=
|1.72
|arg= global |Multiplayer Arguments=
|arg= global |Multiplayer Arguments=
|eff= global |Multiplayer Effects=
|eff= global |Multiplayer Effects=


|gr1= Object Manipulation |GROUP1=
|gr1= Object Manipulation


| Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use [[vectorModelToWorld]] or [[vectorModelToWorldVisual]] commands first. The force applied as impulse. For more information see [http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/classPxRigidBody.html#a22b0a1ef0b6c5656a6063c5c38f5679c NVIDIA docs]|DESCRIPTION=
| Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use [[vectorModelToWorld]] or [[vectorModelToWorldVisual]] commands first. The force applied as impulse. For more information see [http://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/classPxRigidBody.html#a22b0a1ef0b6c5656a6063c5c38f5679c NVIDIA docs]
| object '''addForce''' [force, position] |SYNTAX=
| object '''addForce''' [force, position]
|p1= object: [[Object]] - PhysX object |PARAMETER1=
|p1= object: [[Object]] - PhysX object
|p2= [force, position]: [[Array]] |PARAMETER2=
|p2= [force, position]: [[Array]]
|p3= force: [[Array]] - force vector (in world space) in format [x,y,z]|PARAMETER3=
|p3= force: [[Array]] - force vector (in world space) in format [x,y,z]
|p4= position: [[Array]] - model [[PositionRelative]] to which force is applied in format [x,y,z] |PARAMETER4=
|p4= position: [[Array]] - model [[PositionRelative]] to which force is applied in format [x,y,z]
|p5=  |PARAMETER5=
|p5=
|p6=  |PARAMETER6=
|p6=
| [[Nothing]] |RETURNVALUE=
| [[Nothing]]
|x1= Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]:
|x1= Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]:
<code>_object [[addForce]] [[0,1000,0],[1,0,0]];</code>|EXAMPLE1=
<code>_object [[addForce]] [[0,1000,0],[1,0,0]];</code>
|x2= Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]:
|x2= Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]:
<code>_object [[addForce]] [_object [[vectorModelToWorld]] [0,1000,0],[1,0,0]];</code>|EXAMPLE2=
<code>_object [[addForce]] [_object [[vectorModelToWorld]] [0,1000,0],[1,0,0]];</code>
|[[addTorque]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]] |SEEALSO=
|[[addTorque]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]]
}}
}}



Revision as of 00:04, 18 January 2021

Hover & click on the images for description

Description

Description:
Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use vectorModelToWorld or vectorModelToWorldVisual commands first. The force applied as impulse. For more information see NVIDIA docs
Groups:
Object Manipulation

Syntax

Syntax:
object addForce [force, position]
Parameters:
object: Object - PhysX object
[force, position]: Array
force: Array - force vector (in world space) in format [x,y,z]
position: Array - model PositionRelative to which force is applied in format [x,y,z]
Return Value:
Nothing

Examples

Example 1:
Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]: _object addForce [[0,1000,0],[1,0,0]];
Example 2:
Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]: _object addForce [_object vectorModelToWorld [0,1000,0],[1,0,0]];

Additional Information

See also:
addTorquevectorModelToWorldvectorModelToWorldVisual

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