CommonLibSSE (powerof3)
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  float worldToCam[4][4]; // 110
40  float minNearPlaneDist; // 16C
41  float maxFarNearRatio; // 170
43  float lodAdjust; // 184
44  };
45  static_assert(sizeof(NiCamera) == 0x188);
46 }
Definition: NiAVObject.h:51
Definition: NiBound.h:8
Definition: NiCamera.h:11
void SaveBinary(NiStream &a_stream) override
float worldToCam[4][4]
Definition: NiCamera.h:38
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:39
bool IsEqual(NiObject *a_object) override
float lodAdjust
Definition: NiCamera.h:43
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:42
float minNearPlaneDist
Definition: NiCamera.h:40
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:41
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:26
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