7 private IEntity m_OwnerVehicle;
8 private bool m_bUseCameraSlot;
13 void CharacterCameraADSVehicle(CameraHandlerComponent pCameraHandler)
17 CompartmentAccessComponent compartmentAccess =
m_OwnerCharacter.GetCompartmentAccessComponent();
18 if (compartmentAccess && compartmentAccess.IsInCompartment())
20 BaseCompartmentSlot compartment = compartmentAccess.GetCompartment();
23 m_OwnerVehicle = compartment.GetVehicle();
28 m_fRollFactor = vehicleCamData.m_fRollFactor;
29 m_fPitchFactor = vehicleCamData.m_fPitchFactor;
32 BaseControllerComponent controller = compartment.GetController();
44 override void OnBlendIn()
50 override void OnBlendOut()
56 override protected void OnBlendingIn(
float blendAlpha)
66 override protected void OnBlendingOut(
float blendAlpha)
76 override void OnUpdate(
float pDt, out ScriptedCameraItemResult pOutResult)
87 vector aimingTranslationWeaponLS = turret.GetRawAimingTranslation();
93 PointInfo cameraSlot = turret.GetCameraAttachmentSlot();
96 m_bUseCameraSlot =
true;
98 pOutResult.m_CameraTM[3] = aimingTranslationWeaponLS;
99 pOutResult.m_iDirectBone = -1;
100 pOutResult.m_iDirectBoneMode = EDirectBoneMode.None;
101 pOutResult.m_bUpdateWhenBlendOut =
false;
102 pOutResult.m_fDistance = 0;
103 pOutResult.m_fUseHeading = 0;
104 pOutResult.m_fNearPlane = 0.025;
105 pOutResult.m_bAllowInterpolation =
true;
106 pOutResult.m_pWSAttachmentReference = cameraSlot;
109 if (m_CharacterCameraHandler)
110 m_CharacterCameraHandler.AddShakeToToTransform(pOutResult.m_CameraTM, pOutResult.m_fFOV);
119 vector aimingTranslationWeapon = aimingTranslationWeaponLS.Multiply3(sightWSMat);
120 sightWSMat[3] = sightWSMat[3] - aimingTranslationWeapon;
122 Math3D.MatrixInvMultiply4(charMat, sightWSMat, pOutResult.m_CameraTM);
124 pOutResult.m_iDirectBone = -1;
125 pOutResult.m_iDirectBoneMode = EDirectBoneMode.None;
126 pOutResult.m_bUpdateWhenBlendOut =
false;
127 pOutResult.m_fDistance = 0;
128 pOutResult.m_fUseHeading = 0;
129 pOutResult.m_fNearPlane = 0.025;
130 pOutResult.m_bAllowInterpolation =
true;
132 pOutResult.m_pWSAttachmentReference =
null;
135 if (m_CharacterCameraHandler)
136 m_CharacterCameraHandler.AddShakeToToTransform(pOutResult.m_CameraTM, pOutResult.m_fFOV);
138 SCR_2DSightsComponent sights = SCR_2DSightsComponent.Cast(turret.GetSights());
148 override void OnAfterCameraUpdate(
float pDt,
bool pIsKeyframe, inout vector transformMS[4])
150 IEntity owner = m_OwnerVehicle;
154 if (m_bUseCameraSlot)
157 AddVehiclePitchRoll(owner, pDt, transformMS);