addForce: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Command|= ____________________________________________________________________________________________ |arma3 |= Game |dev|= Game Version |arg= |= Multiplayer Arguments |ef...") |
Killzone Kid (talk | contribs) (locality, description, seealso, format) |
||
Line 1: | Line 1: | ||
{{Command|= | {{Command|= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | |arma3dev |= Game | ||
| | |1.71|= Game Version | ||
|arg= | |arg= global |= Multiplayer Arguments | ||
|eff= | |eff= global |= Multiplayer Effects | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| 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. |= 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]|= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | object addForce [force, position] |= Syntax | ||
|p1= object: [[Object]] |= Parameter 1 | |p1= object: [[Object]] - PhysX object |= Parameter 1 | ||
|p2= [ | |p2= [force, position]: [[Array]] |= Parameter 2 | ||
|p3= | |p3= force: [[Array]] - force vector (in world space) in format [x,y,z]|= Parameter 3 | ||
|p4= | |p4= position: [[Array]] - model [[PositionRelative]] to which force is applied in format [x,y,z] |= Parameter 4 | ||
|p5= |= Parameter 5 | |p5= |= Parameter 5 | ||
|p6= |= Parameter 6 | |p6= |= Parameter 6 | ||
| [[Nothing]] |= Return Value | | [[Nothing]] |= Return Value | ||
|x1= Apply force [0, | |x1= Apply force [0,1,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]: | ||
<code>_object addForce [[0, | <code>_object [[addForce]] [[0,1,0],[1,0,0]];</code>|= Example 1 | ||
|x2= Apply force [0, | |x2= Apply force [0,1,0] defined in model space (relative to object) to object position [1,0,0]: | ||
<code>_object addForce [_object vectorModelToWorld [0, | <code>_object [[addForce]] [_object [[vectorModelToWorld]] [0,1,0],[1,0,0]];</code>|= Example 2 | ||
|[[addTorque]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]] |= See Also | |[[addTorque]], [[vectorModelToWorld]], [[vectorModelToWorldVisual]] |= See Also | ||
}} | }} |
Revision as of 21:56, 10 June 2017
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:
- Uncategorised
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,1,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]:
_object addForce [[0,1,0],[1,0,0]];
- Example 2:
- Apply force [0,1,0] defined in model space (relative to object) to object position [1,0,0]:
_object addForce [_object vectorModelToWorld [0,1,0],[1,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
[[Category:Introduced with arma3dev version 1.71]][[ Category: arma3dev: New Scripting Commands | ADDFORCE]][[ Category: arma3dev: Scripting Commands | ADDFORCE]]