7 static const float CONST_UD_MIN = -89.0;
8 static const float CONST_UD_MAX = 89.0;
10 static const float CONST_LR_MIN = -160.0;
11 static const float CONST_LR_MAX = 160.0;
18 m_OffsetLS =
"0.0 0.03 -0.07";
19 m_ApplyHeadBob =
true;
23 override void OnActivate(ScriptedCameraItem pPrevCamera, ScriptedCameraItemResult pPrevCameraResult)
25 super.OnActivate(pPrevCamera, pPrevCameraResult);
26 m_bCameraTransition =
false;
30 override void OnUpdate(
float pDt, out ScriptedCameraItemResult pOutResult)
34 pOutResult.m_vBaseAngles = m_CharacterHeadAimingComponent.GetLookAngles();
35 pOutResult.m_fUseHeading = 1.0;
36 pOutResult.m_iDirectBoneMode = EDirectBoneMode.RelativePosition;
37 pOutResult.m_iDirectBone = GetCameraBoneIndex();
39 m_fFOV = GetBaseFOV();
40 if (m_bCameraTransition)
42 pOutResult.m_fUseHeading = 0.0;
43 pOutResult.m_iDirectBoneMode = EDirectBoneMode.RelativeTransform;
47 if (sm_iHeadBoneIndex != -1)
49 pOutResult.m_iDirectBone = sm_iHeadBoneIndex;
50 pOutResult.m_fUseHeading = 0.0;
51 pOutResult.m_iDirectBoneMode = EDirectBoneMode.RelativePosition;
55 vector additiveRotation =
"0 0 0";
56 m_CharacterHeadAimingComponent.GetLookTransformationLS(pOutResult.m_iDirectBone, pOutResult.m_iDirectBoneMode, m_OffsetLS, additiveRotation, pOutResult.m_CameraTM);
58 if (m_UseLookPositionOverrideLS)
59 pOutResult.m_CameraTM[3] = m_LookPositionOverrideLS;
61 vector vYPR =
"0 0 0";
62 if (!m_bIgnoreCharacterPitch)
65 Math3D.AnglesToMatrix(vYPR, mat);
66 Math3D.MatrixMultiply4(mat, pOutResult.m_CameraTM, pOutResult.m_CameraTM);
69 m_CharacterCameraHandler.AddViewBobToTransform(pOutResult.m_CameraTM, 1,
false);
71 pOutResult.m_fFOV = m_fFOV;
72 pOutResult.m_fNearPlane = 0.0125;
73 pOutResult.m_bUpdateWhenBlendOut =
true;
74 pOutResult.m_fPositionModelSpace = 0.0;
75 pOutResult.m_bAllowInterpolation =
true;
77 pOutResult.m_pWSAttachmentReference =
null;
80 if (m_CharacterCameraHandler)
81 m_CharacterCameraHandler.AddShakeToToTransform(pOutResult.m_CameraTM, pOutResult.m_fFOV);
85 override float GetBaseFOV()
87 CameraManager cameraManager =
GetGame().GetCameraManager();
91 return cameraManager.GetFirstPersonFOV();
95 protected vector m_OffsetLS;
97 protected bool m_ApplyHeadBob;
99 protected bool m_bCameraTransition =
false;
100 protected CompartmentAccessComponent m_pCompartmentAccess;
102 protected bool m_UseLookPositionOverrideLS =
false;
103 protected vector m_LookPositionOverrideLS;
108 override void OnUpdate(
float pDt, out ScriptedCameraItemResult pOutResult)
110 super.OnUpdate(pDt, pOutResult);
111 pOutResult.m_fUseHeading = 0.0;
112 pOutResult.m_iDirectBoneMode = EDirectBoneMode.RelativeTransform;
113 vector additiveRotation =
"0 0 0";
114 m_CharacterHeadAimingComponent.GetLookTransformationLS(pOutResult.m_iDirectBone, pOutResult.m_iDirectBoneMode, m_OffsetLS, additiveRotation, pOutResult.m_CameraTM);