DIFF

class ItemOpticsSource

ItemOptics InventoryItemSuper

Constructors 1

Members 15

bool m_data_set
Referenced by InitReddotData(), and ShowReddot()
bool m_allowsDOF

true if optics DOES NOT have magnification (FOV >= DZPLAYER_CAMERA_FOV_IRONSIGHTS)

Referenced by AllowsDOF(), and InitOpticsPPInfo()
bool m_reddot_displayed
bool m_isNVOptic = false
Referenced by InitOpticsPPInfo(), and IsNVOptic()
int m_CurrentOpticMode

generic optic mode, currently used for NV optics only (could be expanded)

int m_CurrentOpticModeLocal

local mirror for sync purposes;

int m_reddot_index
float m_blur_float
float m_nearplane_override

override value for DayZPlayerCameraOptics only!

string m_optic_sight_texture
string m_optic_sight_material
string m_2D_preload_type
Referenced by Init2DPreloadType()
ref array<float> m_mask_array
ref array<float> m_lens_array
ref array<float> m_OpticsDOFProperties
Referenced by GetOpticsDOF(), and ItemOptics()

Methods 63

proto native bool EnterOptics()

switches to optics mode if possible

Returns: true if success, false otherwise

proto native bool ExitOptics()

switches out of optics mode (if possible)

Returns: true if success, false otherwise

proto native bool HasWeaponIronsightsOverride()

is weapon in optics mode or not

Returns: true if optics has defined override optics info for weapon

proto native bool UseWeaponIronsightsOverride(bool state)

switches into ironsights override settings

Returns: true if switching was successful

proto native bool IsUsingWeaponIronsightsOverride()

is optics using ironsights override settings or not

Returns: true if optics is using ironsights override settings

proto native int GetStepFOVCount()

returns number of configured steps

proto native int GetStepFOVIndex()

returns index of currently used value in 'discretefov' config array

Returns: index of currently used value in 'discretefov' config array

proto native bool SetStepFOVIndex(int step)

sets zoom to fov value defined at given in 'discretefov' config array

in index
of configured step, range [0..cfg_max]

Returns: true if zoom set

proto native bool StepFOVUp()

sets zoom to next defined (respective to current) value in zoom fov config array

Returns: true if zoom set

proto native bool StepFOVDown()

sets zoom to previous (respective to current) defined value in zoom fov config array

Returns: true if zoom set

proto native float GetCurrentStepFOV()

returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)

proto native int GetStepZeroing()

returns position of currently used value in zeroing config array

Returns: position of currently used value in zeroing config array

proto native bool SetStepZeroing(int step)

sets zeroing to value defined at given position in zeroing config array

in index
of zeroing to set [0..cfg_max]

Returns: true if zeroing set

proto native bool StepZeroingUp()

sets zeroing to next defined (respective to current) value in zeroing config array

Returns: true if zeroing set

proto native bool StepZeroingDown()

sets zeroing to previous (respective to current) defined value in zeroing config array

Returns: true if zeroing set

proto native void GetCameraPoint(out vector pos, out vector dir)

gets camera position & direction in model space of optics entity

proto native float GetZoomInit()

gets FOV value, when entering optics

proto native float GetZoomMin()

gets FOV minimum

proto native float GetZoomMax()

gets FOV maximum

proto native float GetZeroingDistanceZoomMin()

Gets Zeroing distance at opticsZoomMin

proto native float GetZeroingDistanceZoomMax()

Gets Zeroing distance at opticsZoomMax

proto native void SetZeroingClampDist(float dist)

Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.

Referenced by OnWasAttached(), and OnWasDetached()
protected void OnDrawOptics2D()

Callback raised before 2D optics are drawn. (Only for optics where ItemOpticsType::IsUsingOptics2DModel)

protected ItemOpticsType GetItemOpticsType()

Returns the `ItemOpticsType` of this `ItemOptics` instance.

bool IsUsingOptics2DModel()

Returns whether this `ItemOptics` uses the 2D optics model.

bool IsSightOnly()
bool IsUsableWithNV()
override void OnWorkStart()
override void OnWorkStop()
void UpdateOpticsReddotVisibility()
override void OnInventoryExit(Man player)
override void OnStoreSave(ParamsWriteContext ctx)
override void OnVariablesSynchronized()
void InitOpticsPPInfo()
Referenced by ItemOptics()
bool InitDOFAvailability()

optics with more than 1x zoom do not allow DOF changes

Referenced by InitOpticsPPInfo()
void InitOpticsPP(out array<float> mask_array, out array<float> lens_array, out float blur_float)

initializes values for optics' post-processes

Referenced by InitOpticsPPInfo()
bool InitOpticsDOFProperties(out array<float> temp_array)

Initializes DOF properties for optic's alternate ironsights (ACOG etc.)

Referenced by ItemOptics()
bool AllowsDOF()

returns 'true' for non-magnifying optics

References m_allowsDOF
int GetCurrentNVType()
void OnOpticModeChange()

optic-specific behaviour to be defined here (override)

ref array<float> GetOpticsPPMask()
References m_mask_array
ref array<float> GetOpticsPPLens()
References m_lens_array
float GetOpticsPPBlur()
References m_blur_float
void Init2DPreloadType()
Referenced by ItemOptics()
void UpdateSelectionVisibility()
override void OnDebugSpawn()