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


Introduced in

Version:1.22

Description

Description:

Returns optics information for the player.

Use the following formulas to get different FOV representations:

_zoom = opticsState select 1;
_ar = aspectRatio select 0;

_fov = .25/_zoom;         // FOV value as used in camSetFOV
_fovAR = _fov*_ar;        // Aspect ratio correction
_fovDeg = atan(_fovar)*2; // FOV in degrees

Syntax

Syntax:OpticsState
Parameters:
Return Value:Array - [active, zoom, visionMode, tiMode, selectedWeapon, transition, device, mode]
  • active: Boolean - Returns true, when optics are selected.
  • zoom: Number - Zoom level.
  • visionMode: Number - 0 - day, 1 - night, 2 - thermal vision.
  • tiMode: Number - TI mode.
  • selectedWeapon: String - Currently selected weapon.
  • transition: Number - Transition (blending) value (V1.40+).
  • device: Number - Index of the optics device on muzzle (V1.62+)
  • mode: Number - Index of the optics mode of the optics device (V1.62+).

Examples

Examples:


Demo mission to test player and camera FOVs: chkFOV.zip

Additional Information

See also: SetOpticsState, getCameraFOV, getMuzzleOpticsZoom
Multiplayer: 
Problems: 

Notes