vectorDir: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ">Posted on February ([0-9]{1})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-02-0$1") |
(Added image, standardized description, syntax and example) |
||
Line 23: | Line 23: | ||
|gr2= Math - Vectors | |gr2= Math - Vectors | ||
|descr= Returns object direction vector in world space | |descr= [[Image:arma3_object-vectors.jpg|thumb|right|An object with its [[vectorDir]], [[vectorUp]] and [[vectorSide]] (vectors not to scale)]] | ||
{{Feature|important|The vector is '''not necessarily [[vectorNormalized|normalized]]'''. The [[vectorMagnitude|magnitude]] of the vector | Returns an object's direction vector in world space. | ||
* | |||
* | {{Feature|important|The vector is '''not necessarily [[vectorNormalized|normalized]]'''. The [[vectorMagnitude|magnitude]] of the vector depends on the [[getObjectScale|object's scale]].}} | ||
* | |||
* | For an object facing one of the cardinal directions on perfectly flat ground (parallel to the XY-plane of the world space), [[vectorDir]] returns simple values: | ||
* {{hl|[0, 1, 0]}} if the object is facing directly north | |||
* {{hl|[1, 0, 0]}} if the object is facing directly east | |||
* {{hl|[0, -1, 0]}} if the object is facing directly south | |||
* {{hl|[-1, 0, 0]}} if the object is facing directly west | |||
|s1= [[vectorDir]] object | |s1= [[vectorDir]] object | ||
Line 34: | Line 38: | ||
|p1= object: [[Object]] | |p1= object: [[Object]] | ||
|r1= [[Array]] | |r1= [[Array]] format [[Vector3D]] | ||
|x1= <sqf> | |x1= <sqf>_vecDir = vectorDir MyObject;</sqf> | ||
|seealso= [[vectorModelToWorld]] [[vectorDirVisual]] [[vectorSide]] [[vectorSideVisual]] [[vectorUp]] [[setVectorDir]] [[setVectorUp]] [[setVectorDirAndUp]] [[vectorDiff]] [[vectorAdd]] [[vectorMultiply]] [[vectorCrossProduct]] [[vectorDistance]] [[vectorMagnitudeSqr]] [[vectorDistanceSqr]] [[vectorCos]] [[vectorMagnitude]] [[vectorDotProduct]] [[vectorNormalized]] [[vectorFromTo]] [[BIS_fnc_transformVectorDirAndUp]] | |seealso= [[vectorModelToWorld]] [[vectorDirVisual]] [[vectorSide]] [[vectorSideVisual]] [[vectorUp]] [[setVectorDir]] [[setVectorUp]] [[setVectorDirAndUp]] [[vectorDiff]] [[vectorAdd]] [[vectorMultiply]] [[vectorCrossProduct]] [[vectorDistance]] [[vectorMagnitudeSqr]] [[vectorDistanceSqr]] [[vectorCos]] [[vectorMagnitude]] [[vectorDotProduct]] [[vectorNormalized]] [[vectorFromTo]] [[BIS_fnc_transformVectorDirAndUp]] |
Revision as of 11:02, 9 September 2023
Description
- Description:
-
Returns an object's direction vector in world space.
For an object facing one of the cardinal directions on perfectly flat ground (parallel to the XY-plane of the world space), vectorDir returns simple values:
- [0, 1, 0] if the object is facing directly north
- [1, 0, 0] if the object is facing directly east
- [0, -1, 0] if the object is facing directly south
- [-1, 0, 0] if the object is facing directly west
- Groups:
- Math - Vectors
Syntax
Examples
- Example 1:
Additional Information
- See also:
- vectorModelToWorld vectorDirVisual vectorSide vectorSideVisual vectorUp setVectorDir setVectorUp setVectorDirAndUp vectorDiff vectorAdd vectorMultiply vectorCrossProduct vectorDistance vectorMagnitudeSqr vectorDistanceSqr vectorCos vectorMagnitude vectorDotProduct vectorNormalized vectorFromTo BIS_fnc_transformVectorDirAndUp
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
- Posted on 2019-02-02 - 01:03 (UTC)
- killzone_kid
- vectorDir 2D: vectorDir 3D:
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Math - Vectors