24 protected float m_fReticleTextureGlowAlpha;
52 [
Attribute(
"0",
UIWidgets.EditBox,
desc:
"Optic misalignment damping speed - intended for binoculars, the higher, the faster the misalignment gets zeroed",
params:
"0 60 0.1",
category:
"Effects")]
93 [
Attribute(
"0",
UIWidgets.ComboBox,
"Type of zeroing for this sights.",
"", ParamEnumArray.FromEnum(SCR_EPIPZeroingType),
category:
"Sights")]
99 [
Attribute(
"0 0 0",
UIWidgets.EditBox,
"Camera offset when looking through scope",
category:
"Sights",
params:
"inf inf 0 purpose=coords space=entity coordsVar=m_vCameraPoint")]
102 [
Attribute(
"0 0 0",
UIWidgets.EditBox,
"Camera angles when looking through scope",
category:
"Sights",
params:
"inf inf 0 purpose=angles space=entity anglesVar=m_vCameraAngles")]
149 return m_fReticleTextureGlowAlpha;
302 protected float m_fObjectiveFov;
308 protected float m_fReticleAngularSize;
311 protected float m_fReticlePortion;
313 [
Attribute(
"0",
UIWidgets.Slider,
"POSITIVE:\n Rear focal plane - magnification at which reticle markings are valid\n\nZERO:\n Front focal plane reticle scaling with magnification.\n\nNEGATIVE:\n Enforced base FOV in degrees\n",
params:
"-60 200 0.001",
category:
"Sights",
precision: 5)]
317 protected float m_fMagnification;
341 void GetReticleData(out
float reticleAngularSize, out
float reticlePortion, out
float reticleBaseZoom)
343 reticleAngularSize = m_fReticleAngularSize;
344 reticlePortion = m_fReticlePortion;
351 return m_fObjectiveFov;
369 return m_fMagnification;
379 return data.GetAnimationSpeedBlur();
389 return data.GetADSActivationPercentage();
399 return data.GetADSDeactivationPercentage();
424 static ref ScriptInvokerBase<OnSightsADSChanged>
s_OnSightsADSChanged =
new ScriptInvokerBase<OnSightsADSChanged>();
425 static ref ScriptInvokerBase<On2DOpticsADSChange>
s_On2DOpticADSChanged =
new ScriptInvokerBase<On2DOpticsADSChange>();
427 protected ref ScriptInvokerBase<On2DOpticsIlluminationChange>
s_OnIlluminationChange =
new ScriptInvokerBase<On2DOpticsIlluminationChange>();
551 super.OnSightADSActivated();
559 super.OnSightADSDeactivated();
571 float interp =
Math.Min(1, timeSlice *
data.GetReticleOffsetInterpSpeed());
592 if (
data.ShouldHideParentObject())
602 if (
data.ShouldHideParentCharacter())
616 CameraManager cameraManager =
GetGame().GetCameraManager();
621 PlayerCamera camera = PlayerCamera.Cast(cameraManager.CurrentCamera());
623 referenceFOV = camera.GetFocusFOV();
625 referenceFOV = cameraManager.GetFirstPersonFOV();
627 float referenceTan =
Math.Tan(
Math.DEG2RAD * (referenceFOV * 0.5));
628 return Math.RAD2DEG * 2 *
Math.Atan2(referenceTan, magnification);
638 return (
float.AlmostEqual(x, 0, limitMin) &&
float.AlmostEqual(y, 0, limitMin));
653 vector cameraToSightMat[4];
660 Math3D.AnglesToMatrix(sightAngles, sightMat);
663 Math3D.MatrixMultiply3(sightMat, cameraToSightMat, sightMat);
667 GetSightsTransform(turretMat,
true);
668 Math3D.MatrixInvMultiply3(sightMat, turretMat, sightMat);
688 CameraManager cameraManager =
GetGame().GetCameraManager();
692 CameraBase camera = cameraManager.CurrentCamera();
696 vector currentDir = camera.GetWorldTransformAxis(2);
698 bool rotated = !
float.AlmostEqual(previousDir[0], currentDir[0]);
699 rotated |= !
float.AlmostEqual(previousDir[1], currentDir[1]);
705 previousDir = currentDir;
706 return camera.VectorToLocal(
rotation);
720 CameraManager cameraManager =
GetGame().GetCameraManager();
724 CameraBase camera = cameraManager.CurrentCamera();
728 vector currentPos = camera.GetWorldTransformAxis(3);
730 const float threshold = 0.0001;
737 vector movement = (currentPos - previousPos) * (
scale / timeSlice);
738 previousPos = currentPos;
739 return camera.VectorToLocal(movement);
767 if (
data.HasIllumination() && enable)
769 reticleTint =
data.GetReticleIlluminationColor();
770 glowTint =
data.GetReticleIlluminationColor();
774 reticleTint =
data.GetReticleColor();
775 glowTint =
data.GetReticleOutlineColor();
778 glowTint.SetA(
data.GetReticleTextureGlowAlpha() * glowTint.A());
801 if (
data.GetZeroType() == SCR_EPIPZeroingType.EPZ_CAMERA_TURN)
802 return -GetCurrentSightsRange()[0];
832 Math3D.AnglesToMatrix(yawPitchRoll, matrix);
837 Math3D.MatrixCopy(matrix, temp);
856 if (pivotIndex != -1)
863 parentNode.
GetAnimation().GetBoneMatrix(pivotIndex, pivotTM);
869 Math3D.MatrixMultiply4(pivotTM, localTransform, localTransform);
872 Math3D.MatrixMultiply4(temp, localTransform, temp);
879 Math3D.MatrixCopy(temp, matrix);
889 m_fObjectiveFov = objectiveFov;
907 m_fReticleAngularSize = reticleAngularSize;
913 m_fReticlePortion = reticlePortion;
ArmaReforgerScripted GetGame()
ref array< string > angles
ResourceName m_sFilterTexture
float m_fVignetteMoveSpeed
float m_fMisalignmentDampingSpeed
float m_fMovementDampingSpeed
float m_fReticleOffsetInterpSpeed
SCR_EPIPZeroingType m_eZeroingType
float m_fMisalignmentScale
float m_fAnimationEnterTime
float m_fRollDampingSpeed
float m_fRotationDampingSpeed
int m_iAnimationDeactivationDelay
ref Color m_ReticleOutlineColor
int m_iAnimationActivationDelay
ref Color m_cReticleTextureIllumination
float m_fADSDeactivationPercentage
bool m_bShouldHideParentObject
bool m_bShouldHideParentCharacter
float m_fADSActivationPercentage
SCR_CharacterSoundComponentClass GetComponentData()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
proto external Animation GetAnimation()
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
proto external IEntity GetParent()
proto external TNodeId GetPivot()
Returns pivot ID from hierarchy component.
proto external EntityFlags ClearFlags(EntityFlags flags, bool recursively=false)
proto external bool IsDeleted()
proto external void GetLocalTransform(out vector mat[])
See IEntity::GetTransform.
float GetReticleTextureGlowAlpha()
Color GetReticleIlluminationColor()
float GetAnimationSpeedBlur()
float m_fReticleOffsetInterpSpeed
bool ShouldHideParentObject()
float GetAnimationEnterTime()
float m_fADSDeactivationPercentage
float m_fMisalignmentScale
int m_iAnimationActivationDelay
ResourceName m_sReticleTexture
void GetReticleTextures(out ResourceName reticleTexture, out ResourceName reticleTextureGlow, out ResourceName filterTexture)
float GetMovementDampingSpeed()
int GetAnimationActivationDelay()
int GetAnimationDeactivationDelay()
float GetMisalignmentDampingSpeed()
SCR_EPIPZeroingType m_eZeroingType
float m_fMovementDampingSpeed
float m_fRotationDampingSpeed
float GetMisalignmentScale()
bool m_bShouldHideParentCharacter
float GetVignetteMoveSpeed()
ResourceName m_sReticleGlowTexture
float GetMotionBlurScale()
ref Color m_cReticleTextureIllumination
float m_fAnimationEnterTime
float GetReticleOffsetInterpSpeed()
float GetADSDeactivationPercentage()
float m_fADSActivationPercentage
SCR_EPIPZeroingType GetZeroType()
ResourceName m_sFilterTexture
float m_fMisalignmentDampingSpeed
float m_fAnimationSpeedBlur
bool m_bShouldHideParentObject
float m_fRollDampingSpeed
float GetRotationDampingSpeed()
float GetRollDampingSpeed()
float GetADSActivationPercentage()
bool ShouldHideParentCharacter()
float m_fVignetteMoveSpeed
Color GetReticleOutlineColor()
ref Color m_ReticleOutlineColor
int m_iAnimationDeactivationDelay
const float NEAR_PLANE_DEFAULT
void HandleSightActivation()
bool IsMoveCloseToLimit(vector move, float limitMin)
Return true if move X a Y is below limit.
override float GetADSDeactivationPercentageScript()
vector GetMovement(out vector previousPos, float timeSlice)
float GetObjectiveScale()
void SetReticleOffsetY(float reticleOffsetY)
ScriptInvokerBase< On2DOpticsIlluminationChange > OnIlluminationChange()
float GetReticleOffsetYTarget()
float m_fCurrentCameraPitch
const string ACTION_ZOOM_OUT
override void OnSightADSActivated()
override void OnInit(IEntity owner)
static ref ScriptInvokerBase< On2DOpticsADSChange > s_On2DOpticADSChanged
ScriptInvokerVoid OnSetupOpticImage()
vector GetSightsRelPosition()
void SetReticlePortion(float reticlePortion)
float GetFovZoomed()
Get base FOV of the optic, used to determine maximum FOV.
float GetCameraPitchTarget()
void SetReticleAngularSize(float reticleAngularSize)
const float NEAR_PLANE_ZOOMED
void SetReticleOffsetX(float reticleOffsetX)
float GetReticleOffsetX()
ChimeraCharacter m_ParentCharacter
void SetObjectiveFov(float objectiveFov)
void HideObjects()
Hides objects to prevent clipping when entering ADS.
float GetCurrentReticleOffsetY()
ref ScriptInvokerVoid s_OnSetupOpticImage
override void OnSightADSDeactivated()
vector GetRotation(out vector previousDir, float timeSlice)
void SetObjectiveScale(float objectiveScale)
const float REFERENCE_FOV
override void OnSightADSPostFrame(IEntity owner, float timeSlice)
const string ACTION_ILLUMINATION
void SetReticleBaseZoom(float reticleBaseZoom)
override float GetADSActivationPercentageScript()
void GetReticleData(out float reticleAngularSize, out float reticlePortion, out float reticleBaseZoom)
float GetAnimationSpeedBlur()
static ref ScriptInvokerBase< OnSightsADSChanged > s_OnSightsADSChanged
const float OPACITY_INITIAL
void HandleSightDeactivation()
vector GetMisalignmentAngles(notnull CameraBase camera)
float m_fCurrentReticleOffsetY
static float CalculateZoomFOV(float magnification)
Return camera FOV for given magnification. Focus FOV is used as reference 1x magnification.
const string ACTION_ZOOM_IN
IEntity GetCameraLocalTransform(out vector matrix[4])
void EnableReticleIllumination(bool enable)
Toggle between illumination modes.
void SetFovZoomed(float value)
Set base FOV of the optic. Negative value means magnification to compute new m_fFovZoomed with.
float m_fNearPlaneCurrent
float GetCurrentCameraPitchOffset()
ref ScriptInvokerBase< On2DOpticsIlluminationChange > s_OnIlluminationChange
static bool GetRelativeLocalTransform(notnull IEntity owner, notnull IEntity member, out vector relativeTransform[4])
Contains various scripted 3D math functions.
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute
EntityFlags
Various entity flags.
int TNodeId
Node global id is a hash of name of the node.
RespawnSystemComponentClass GameComponentClass vector vector rotation
proto native vector Vector(float x, float y, float z)