Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
CharacterCamera1stPersonUnconscious.c
Go to the documentation of this file.
1 // *************************************************************************************
2 // ! CharacterCamera1stPersonUnconscious - first person only unconscious
3 // *************************************************************************************
4 class CharacterCamera1stPersonUnconscious extends CharacterCamera1stPerson
5 {
6  void CharacterCamera1stPersonUnconscious(CameraHandlerComponent pCameraHandler)
7  {
8  }
9 
10  override void OnUpdate(float pDt, out ScriptedCameraItemResult pOutResult)
11  {
12  // Note: The transformation is discarded (overwritten) later on
13  super.OnUpdate(pDt, pOutResult);
14 
15  pOutResult.m_vBaseAngles = "0 0 0";
16  pOutResult.m_fUseHeading = 0.0;
17  pOutResult.m_iDirectBoneMode = EDirectBoneMode.RelativeTransform;
18 
19  // TODO@AS: For now always use the camera bone. If transition is animated,
20  // it is safe to revert to using GetCameraBoneIndex(), assuming sm_TagFPCamera is set.
21  pOutResult.m_iDirectBone = sm_iCameraBoneIndex;
22 
23  // Head bone in model space is rotated 180 around its yaw axis,
24  // so we simply undo this rotation
25  vector lookAngles = m_CharacterHeadAimingComponent.GetLookAngles();
26  float y = lookAngles[0] - 180.0;
27 
28  while (y < -180)
29  y += 360;
30  while (y > 180)
31  y -= 360;
32 
33  lookAngles[0] = y;
34 
35  Math3D.AnglesToMatrix(lookAngles, pOutResult.m_CameraTM);
36  pOutResult.m_CameraTM[3] = m_OffsetLS;
37 
38  // Apply camera shake if there is shake to be applied
39  if (m_CharacterCameraHandler)
40  m_CharacterCameraHandler.AddShakeToToTransform(pOutResult.m_CameraTM, pOutResult.m_fFOV);
41  }
42 };
OnUpdate
override void OnUpdate(BaseWorld world, float timeslice)
Definition: game.c:910
CharacterCamera1stPerson
Definition: CharacterCamera1stPerson.c:106