vectorDir: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Lou Montana (talk | contribs) m (Text replacement - "killzone_kid" to "Killzone_Kid") |
||
(106 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | |||
|game1= ofpe | |||
|version1= 1.00 | |||
|game2= arma1 | |||
|version2= 1.00 | |||
|game3= arma2 | |||
|version3= 1.00 | |||
|game4= arma2oa | |||
|version4= 1.50 | |||
|game5= tkoh | |||
|version5= 1.00 | |||
|game6= arma3 | |||
|version6= 0.50 | |||
|arg= global | |||
|gr2= Math - Vectors | |||
|descr= [[File:arma3_object-vectors.jpg|thumb|right|An object with its [[vectorDir]], [[vectorUp]] and [[vectorSide]] (vectors not to scale)]] | |||
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 | |||
|p1= object: [[Object]] | |||
|r1= [[Array]] format [[Vector3D]] | |||
|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]] | |||
}} | |||
<dl class="command_description"> | |||
<dt></dt> | |||
<dd class="notedate">Posted on 2019-02-02 - 01:03 (UTC)</dd> | |||
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt> | |||
<dd class="note"> vectorDir 2D: | |||
<sqf>[sin _azimuth, cos _azimuth, 0]</sqf> | |||
vectorDir 3D: | |||
<sqf>[sin _azimuth * cos _altitude, cos _azimuth * cos _altitude, sin _altitude]</sqf> | |||
</dd> | |||
</dl> |
Latest revision as of 18:52, 18 February 2024
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