Vector3D: Difference between revisions

From Bohemia Interactive Community
Category: Arrays
mNo edit summary
m (Some wiki formatting)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Hatnote|See also [[Vector2D]].}}
'''Format:'''
'''Format:'''


[x, y, z]
[x, y, z] where x, y and z are [[Number]]s




Line 8: Line 9:
Represents a 3-dimensional vector in space.
Represents a 3-dimensional vector in space.


Each value can range from -1 to +1.
A '''[[vectorNormalized|normalised]]''' vector means that each value is within range -1..+1.




The return array can be processed-converted into degrees as follows:
The return array can be processed-converted into degrees as follows:
_vdir = player weaponDirection (primaryWeapon player);  
<sqf>
_adir= (_vdir select 0) atan2 (_vdir select 1);  
_vDir = player weaponDirection primaryWeapon player;
_aDir = _vDir # 0 atan2 _vDir # 1;
</sqf>
 


[[Category: Arrays]]
[[Category: Arrays]]

Latest revision as of 15:47, 6 January 2026


Format:

[x, y, z] where x, y and z are Numbers


Description:

Represents a 3-dimensional vector in space.

A normalised vector means that each value is within range -1..+1.


The return array can be processed-converted into degrees as follows:

_vDir = player weaponDirection primaryWeapon player; _aDir = _vDir # 0 atan2 _vDir # 1;