CommonLibVR
NiCamera.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiAVObject.h"
4 #include "RE/N/NiFrustum.h"
5 #include "RE/N/NiPoint3.h"
6 #include "RE/N/NiRect.h"
7 
8 namespace RE
9 {
10  class NiCamera : public NiAVObject
11  {
12  public:
13  inline static constexpr auto RTTI = RTTI_NiCamera;
14  inline static constexpr auto Ni_RTTI = NiRTTI_NiCamera;
15  inline static constexpr auto VTABLE = VTABLE_NiCamera;
16 
17  ~NiCamera() override; // 00
18 
19  // override (NiAVObject)
20  const NiRTTI* GetRTTI() const override; // 02
21  NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17 - { return this; }
22  void LoadBinary(NiStream& a_stream) override; // 18 - { return; }
23  void LinkObject(NiStream& a_stream) override; // 19 - { return; }
24  bool RegisterStreamables(NiStream& a_stream) override; // 1A
25  void SaveBinary(NiStream& a_stream) override; // 1B - { return; }
26  bool IsEqual(NiObject* a_object) override; // 1C
27  void UpdateWorldBound() override; // 2F - { return; }
28  void UpdateWorldData(NiUpdateData* a_data) override; // 30
29 
30  static bool BoundInFrustum(const NiBound& a_bound, NiCamera* a_camera);
31  static bool NodeInFrustum(NiAVObject* a_node, NiCamera* a_camera);
32  static bool PointInFrustum(const NiPoint3& a_point, NiCamera* a_camera, float a_radius);
33  bool WindowPointToRay(std::int32_t a_x, std::int32_t a_y, NiPoint3& a_origin, NiPoint3& a_dir, float a_windowWidth, float a_windowHeight);
34  bool WorldPtToScreenPt3(const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance);
35  static bool WorldPtToScreenPt3(const float a_matrix[4][4], const NiRect<float>& a_port, const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance);
36 
37  // members
38 #ifndef SKYRIMVR
39  float worldToCam[4][4]; // 110
41  float minNearPlaneDist; // 16C
42  float maxFarNearRatio; // 170
44  float lodAdjust; // 184
45  private:
46  KEEP_FOR_RE()
47  };
48  static_assert(sizeof(NiCamera) == 0x188);
49 #else
50  float worldToCam[4][4]; // 138
51  NiFrustum* viewFrustumPtr; // 178
52  BSTArray<void*> unk180; // 180
53  BSTArray<void*> unk198; // 198
54  BSTArray<void*> unk1B0; // 1B0
55  std::uint32_t unk1C8; // 1C8
56  NiFrustum viewFrustum; // 1CC
57  float minNearPlaneDist; // 1E8
58  float maxFarNearRatio; // 1EC
59  NiRect<float> port; // 1F0
60  float lodAdjust; // 200
61  private:
62  KEEP_FOR_RE()
63  };
64  static_assert(sizeof(NiCamera) == 0x208);
65 #endif
66 
67 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: NiAVObject.h:57
Definition: NiBound.h:8
Definition: NiCamera.h:11
void SaveBinary(NiStream &a_stream) override
float worldToCam[4][4]
Definition: NiCamera.h:39
static bool BoundInFrustum(const NiBound &a_bound, NiCamera *a_camera)
static bool PointInFrustum(const NiPoint3 &a_point, NiCamera *a_camera, float a_radius)
NiFrustum viewFrustum
Definition: NiCamera.h:40
bool IsEqual(NiObject *a_object) override
float lodAdjust
Definition: NiCamera.h:44
bool WindowPointToRay(std::int32_t a_x, std::int32_t a_y, NiPoint3 &a_origin, NiPoint3 &a_dir, float a_windowWidth, float a_windowHeight)
bool WorldPtToScreenPt3(const NiPoint3 &a_point, float &a_xOut, float &a_yOut, float &a_zOut, float a_zeroTolerance)
NiRect< float > port
Definition: NiCamera.h:43
float minNearPlaneDist
Definition: NiCamera.h:41
void LinkObject(NiStream &a_stream) override
NiObject * CreateClone(NiCloningProcess &a_cloning) override
static constexpr auto VTABLE
Definition: NiCamera.h:15
bool RegisterStreamables(NiStream &a_stream) override
static bool WorldPtToScreenPt3(const float a_matrix[4][4], const NiRect< float > &a_port, const NiPoint3 &a_point, float &a_xOut, float &a_yOut, float &a_zOut, float a_zeroTolerance)
float maxFarNearRatio
Definition: NiCamera.h:42
static bool NodeInFrustum(NiAVObject *a_node, NiCamera *a_camera)
static constexpr auto Ni_RTTI
Definition: NiCamera.h:14
const NiRTTI * GetRTTI() const override
void UpdateWorldBound() override
~NiCamera() override
void LoadBinary(NiStream &a_stream) override
static constexpr auto RTTI
Definition: NiCamera.h:13
void UpdateWorldData(NiUpdateData *a_data) override
Definition: NiCloningProcess.h:10
Definition: NiFrustum.h:6
Definition: NiObject.h:37
Definition: NiPoint3.h:6
Definition: NiRTTI.h:6
Definition: NiStream.h:29
Definition: NiAVObject.h:28
Definition: AbsorbEffect.h:6
constexpr REL::ID NiRTTI_NiCamera(static_cast< std::uint64_t >(523926))
constexpr REL::ID RTTI_NiCamera(static_cast< std::uint64_t >(690424))
constexpr std::array< REL::ID, 1 > VTABLE_NiCamera
Definition: Offsets_VTABLE.h:12184