CommonLibSSE NG
PlayerCamera.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSAtomic.h"
4 #include "RE/B/BSPointerHandle.h"
5 #include "RE/B/BSTArray.h"
6 #include "RE/B/BSTSingleton.h"
7 #include "RE/B/BSTSmartPointer.h"
8 #include "RE/N/NiPoint3.h"
9 #include "RE/T/TESCamera.h"
10 
11 namespace RE
12 {
13  class bhkRigidBody;
14  class bhkSimpleShapePhantom;
15  class NiRefObject;
16  class TESCameraState;
17 
18  struct CameraStates
19  {
20  enum CameraState : std::uint32_t
21  {
35 
36  kTotal
37  };
38  };
40 
41  class PlayerCamera :
42  public TESCamera, // 000
43  public BSTSingletonSDM<PlayerCamera> // 038
44  {
45  public:
46  inline static constexpr auto RTTI = RTTI_PlayerCamera;
47 
48  struct Unk120
49  {
52  };
53  static_assert(sizeof(Unk120) == 0x10);
54 
55  ~PlayerCamera() override; // 00
56 
57  // override (TESCamera)
58  void SetCameraRoot(NiPointer<NiNode> a_root) override; // 01
59 
61 
64  bool IsInBleedoutMode() const;
65  bool IsInFirstPerson() const;
66  bool IsInFreeCameraMode() const;
67  bool IsInThirdPerson() const;
68  void ToggleFreeCameraMode(bool a_freezeTime);
69  void UpdateThirdPerson(bool a_weaponDrawn);
70 
71  // members
72  std::uint8_t pad039; // 039
73  std::uint16_t pad03A; // 03A
77  Unk120* unk120; // 120 - ?
80  mutable BSSpinLock lock; // 134
81  float worldFOV; // 13C
82  float firstPersonFOV; // 140
83  NiPoint3 pos; // 144 - ?
84  float idleTimer; // 150 - ?
85  float yaw; // 154 - ? - in radians
86  std::uint32_t unk158; // 158 - ?
87  std::uint32_t unk15C; // 15C - ?
88  bool allowAutoVanityMode; // 160
89  bool bowZoomedIn; // 161
90  bool isWeapSheathed; // 162 - ?
91  bool isProcessed; // 163 - ?
92  std::uint8_t unk164; // 164
93  std::uint8_t unk165; // 165
94  std::uint16_t pad166; // 166
95 
96  private:
97  bool QCameraEquals(CameraState a_cameraState) const;
98  };
99  static_assert(sizeof(PlayerCamera) == 0x168);
100 }
Definition: BSAtomic.h:51
Definition: BSTArray.h:377
Definition: BSTSmartPointer.h:36
Definition: NiPoint3.h:6
Definition: PlayerCamera.h:44
void ToggleFreeCameraMode(bool a_freezeTime)
bool IsInFreeCameraMode() const
BSTSmartPointer< TESCameraState > cameraStates[CameraStates::kTotal]
Definition: PlayerCamera.h:76
RefHandle objectFadeHandle
Definition: PlayerCamera.h:79
bool ForceThirdPerson()
float idleTimer
Definition: PlayerCamera.h:84
bool isWeapSheathed
Definition: PlayerCamera.h:90
BSSpinLock lock
Definition: PlayerCamera.h:80
~PlayerCamera() override
bool allowAutoVanityMode
Definition: PlayerCamera.h:88
float firstPersonFOV
Definition: PlayerCamera.h:82
bool IsInThirdPerson() const
NiPoint3 pos
Definition: PlayerCamera.h:83
void UpdateThirdPerson(bool a_weaponDrawn)
ActorHandle cameraTarget
Definition: PlayerCamera.h:74
BSTSmallArray< TESCameraState *, CameraStates::kTotal > tempReturnStates
Definition: PlayerCamera.h:75
std::uint8_t unk164
Definition: PlayerCamera.h:92
bool ForceFirstPerson()
bool IsInFirstPerson() const
bool bowZoomedIn
Definition: PlayerCamera.h:89
std::uint32_t unk15C
Definition: PlayerCamera.h:87
float worldFOV
Definition: PlayerCamera.h:81
std::uint16_t pad166
Definition: PlayerCamera.h:94
std::uint16_t pad03A
Definition: PlayerCamera.h:73
NiPointer< bhkRigidBody > rigidBody
Definition: PlayerCamera.h:78
bool isProcessed
Definition: PlayerCamera.h:91
float yaw
Definition: PlayerCamera.h:85
std::uint32_t unk158
Definition: PlayerCamera.h:86
static PlayerCamera * GetSingleton()
void SetCameraRoot(NiPointer< NiNode > a_root) override
bool IsInBleedoutMode() const
std::uint8_t pad039
Definition: PlayerCamera.h:72
static constexpr auto RTTI
Definition: PlayerCamera.h:46
Unk120 * unk120
Definition: PlayerCamera.h:77
std::uint8_t unk165
Definition: PlayerCamera.h:93
Definition: TESCamera.h:13
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_PlayerCamera(688779, 396631, 0x1f45ae0)
std::uint32_t RefHandle
Definition: BSCoreTypes.h:6
Definition: BSTSingleton.h:50
Definition: PlayerCamera.h:19
CameraState
Definition: PlayerCamera.h:21
@ kBleedout
Definition: PlayerCamera.h:33
@ kFurniture
Definition: PlayerCamera.h:27
@ kTween
Definition: PlayerCamera.h:29
@ kTotal
Definition: PlayerCamera.h:36
@ kFirstPerson
Definition: PlayerCamera.h:22
@ kVATS
Definition: PlayerCamera.h:24
@ kDragon
Definition: PlayerCamera.h:34
@ kAutoVanity
Definition: PlayerCamera.h:23
@ kThirdPerson
Definition: PlayerCamera.h:31
@ kIronSights
Definition: PlayerCamera.h:26
@ kPCTransition
Definition: PlayerCamera.h:28
@ kFree
Definition: PlayerCamera.h:25
@ kMount
Definition: PlayerCamera.h:32
@ kAnimated
Definition: PlayerCamera.h:30
Definition: PlayerCamera.h:49
NiPointer< bhkSimpleShapePhantom * > unk00
Definition: PlayerCamera.h:50
NiPointer< bhkSimpleShapePhantom * > unk08
Definition: PlayerCamera.h:51