CommonLibSSE (powerof3)
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  inline static constexpr auto VTABLE = VTABLE_PlayerCamera;
48 
49  struct Unk120
50  {
53  };
54  static_assert(sizeof(Unk120) == 0x10);
55 
56  ~PlayerCamera() override; // 00
57 
58  // override (TESCamera)
59  void SetCameraRoot(NiPointer<NiNode> a_root) override; // 01
60 
62 
65  bool IsInBleedoutMode() const;
66  bool IsInFirstPerson() const;
67  bool IsInFreeCameraMode() const;
68  bool IsInThirdPerson() const;
70  void ToggleFreeCameraMode(bool a_freezeTime);
71  void UpdateThirdPerson(bool a_weaponDrawn);
72 
73  // members
74  std::uint8_t pad039; // 039
75  std::uint16_t pad03A; // 03A
79  Unk120* unk120; // 120 - ?
82  mutable BSSpinLock lock; // 134
83  float worldFOV; // 13C
84  float firstPersonFOV; // 140
85  NiPoint3 pos; // 144 - ?
86  float idleTimer; // 150 - ?
87  float yaw; // 154 - ? - in radians
88  std::uint32_t unk158; // 158 - ?
89  std::uint32_t unk15C; // 15C - ?
90  bool allowAutoVanityMode; // 160
91  bool bowZoomedIn; // 161
92  bool isWeapSheathed; // 162 - ?
93  bool isProcessed; // 163 - ?
94  std::uint8_t unk164; // 164
95  std::uint8_t unk165; // 165
96  std::uint16_t pad166; // 166
97 
98  private:
99  bool QCameraEquals(CameraState a_cameraState) const;
100  };
101  static_assert(sizeof(PlayerCamera) == 0x168);
102 }
Definition: BSAtomic.h:92
Definition: BSTArray.h:378
Definition: BSTSmartPointer.h:37
Definition: NiPoint3.h:6
Definition: PlayerCamera.h:44
void ToggleFreeCameraMode(bool a_freezeTime)
bool IsInFreeCameraMode() const
void ForceThirdPerson()
static constexpr auto VTABLE
Definition: PlayerCamera.h:47
BSTSmartPointer< TESCameraState > cameraStates[CameraStates::kTotal]
Definition: PlayerCamera.h:78
RefHandle objectFadeHandle
Definition: PlayerCamera.h:81
float idleTimer
Definition: PlayerCamera.h:86
bool isWeapSheathed
Definition: PlayerCamera.h:92
BSSpinLock lock
Definition: PlayerCamera.h:82
~PlayerCamera() override
bool allowAutoVanityMode
Definition: PlayerCamera.h:90
float firstPersonFOV
Definition: PlayerCamera.h:84
bool IsInThirdPerson() const
NiPoint3 pos
Definition: PlayerCamera.h:85
void UpdateThirdPerson(bool a_weaponDrawn)
ActorHandle cameraTarget
Definition: PlayerCamera.h:76
BSTSmallArray< TESCameraState *, CameraStates::kTotal > tempReturnStates
Definition: PlayerCamera.h:77
std::uint8_t unk164
Definition: PlayerCamera.h:94
bool IsInFirstPerson() const
bool bowZoomedIn
Definition: PlayerCamera.h:91
std::uint32_t unk15C
Definition: PlayerCamera.h:89
void PushCameraState(CameraState a_state)
float worldFOV
Definition: PlayerCamera.h:83
std::uint16_t pad166
Definition: PlayerCamera.h:96
std::uint16_t pad03A
Definition: PlayerCamera.h:75
NiPointer< bhkRigidBody > rigidBody
Definition: PlayerCamera.h:80
bool isProcessed
Definition: PlayerCamera.h:93
float yaw
Definition: PlayerCamera.h:87
std::uint32_t unk158
Definition: PlayerCamera.h:88
static PlayerCamera * GetSingleton()
void SetCameraRoot(NiPointer< NiNode > a_root) override
bool IsInBleedoutMode() const
std::uint8_t pad039
Definition: PlayerCamera.h:74
static constexpr auto RTTI
Definition: PlayerCamera.h:46
Unk120 * unk120
Definition: PlayerCamera.h:79
void ForceFirstPerson()
std::uint8_t unk165
Definition: PlayerCamera.h:95
Definition: TESCamera.h:13
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_PlayerCamera(static_cast< std::uint64_t >(688779))
constexpr std::array< REL::ID, 1 > VTABLE_PlayerCamera
Definition: Offsets_VTABLE.h:12549
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:50
NiPointer< bhkSimpleShapePhantom * > unk00
Definition: PlayerCamera.h:51
NiPointer< bhkSimpleShapePhantom * > unk08
Definition: PlayerCamera.h:52