vectorDir

From Bohemia Interactive Community
Revision as of 18:52, 18 February 2024 by Lou Montana (talk | contribs) (Text replacement - "killzone_kid" to "Killzone_Kid")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
An object with its vectorDir, vectorUp and vectorSide (vectors not to scale)

Returns an object's direction vector in world space.

The vector is not necessarily normalized. The magnitude of the vector depends on the 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:

  • [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

Syntax:
vectorDir object
Parameters:
object: Object
Return Value:
Array format Vector3D

Examples

Example 1:
_vecDir = vectorDir MyObject;

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:
[sin _azimuth, cos _azimuth, 0]
vectorDir 3D:
[sin _azimuth * cos _altitude, cos _azimuth * cos _altitude, sin _altitude]