Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:2.12

Description

Description:

Returns the weapon camera (eye) position (relative to the weapon origin).

The name of the camera memory point is defined by the weapon memoryPointCamera configuration parameter, which may point to something like an eye (this point is defined in the model Memory LOD, and indicates from where the player looks at the weapon):


Due to the way weapons are designed in Oxygen (pointed to the left, and the muzzle running along the X-axis), the returned array normally contains a positive x-value (as the camera is to the right of the origin), then the lateral Y and vertical Z offsets:

To convert the returned array (which could be interpreted as [y,-x,z]), to be used with normal coordinate arrangements (when the weapon is pointed forward), apply the following transition:

_posXYZ = [_pos select 1,(_pos select 0)*-1,_pos select 2]

Syntax

Syntax:object getMuzzleCameraPos weaponType
Parameters:
  • object: Object - Unit equipped with weapon.
  • weaponType: String - Unit weapon type to examine. Can be:
    • "PRIMARY"
    • "SECONDARY"
    • "HANDGUN"
    • "BINOCULAR"
Return Value:Vector3D - Camera position in model space (relative to the weapon origin). If the specified weapon type does not exist, then Variables - Null is returned.

Examples

Examples:
_campos = player getMuzzleCameraPos "PRIMARY"

Additional Information

See also: getMuzzlePos, weaponPosition, weaponDirection
Multiplayer: 
Problems: 

Notes