CommonLibSSE (powerof3)
NiPoint3.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  class NiPoint3
6  {
7  public:
8  constexpr NiPoint3() noexcept = default;
9 
10  constexpr NiPoint3(float a_x, float a_y, float a_z) noexcept :
11  x(a_x),
12  y(a_y),
13  z(a_z){};
14 
15  float& operator[](std::size_t a_idx);
16  const float& operator[](std::size_t a_idx) const;
17  bool operator==(const NiPoint3& a_rhs) const;
18  bool operator!=(const NiPoint3& a_rhs) const;
19  bool operator<(const NiPoint3& a_rhs) const;
20  NiPoint3 operator+(const NiPoint3& a_rhs) const;
21  NiPoint3 operator-(const NiPoint3& a_rhs) const;
22  float operator*(const NiPoint3& a_rhs) const;
23  NiPoint3 operator*(float a_scalar) const;
24  NiPoint3 operator/(float a_scalar) const;
26  NiPoint3& operator+=(const NiPoint3& a_rhs);
27  NiPoint3& operator-=(const NiPoint3& a_rhs);
28  NiPoint3& operator*=(const NiPoint3& a_rhs);
29  NiPoint3& operator/=(const NiPoint3& a_rhs);
30  NiPoint3& operator*=(float a_scalar);
31  NiPoint3& operator/=(float a_scalar);
32 
33  [[nodiscard]] NiPoint3 Cross(const NiPoint3& pt) const;
34  [[nodiscard]] float Dot(const NiPoint3& pt) const;
35  [[nodiscard]] float GetDistance(const NiPoint3& a_pt) const noexcept;
36  [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_pt) const noexcept;
37  [[nodiscard]] float Length() const;
38  [[nodiscard]] float SqrLength() const;
39  [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_pt) const;
40  float Unitize();
41 
42  static const NiPoint3& Zero();
43 
44  // members
45  float x{ 0.0F }; // 0
46  float y{ 0.0F }; // 4
47  float z{ 0.0F }; // 8
48  };
49  static_assert(sizeof(NiPoint3) == 0xC);
50 }
Definition: NiPoint3.h:6
bool operator<(const NiPoint3 &a_rhs) const
NiPoint3 & operator+=(const NiPoint3 &a_rhs)
const float & operator[](std::size_t a_idx) const
NiPoint3 operator*(float a_scalar) const
NiPoint3 Cross(const NiPoint3 &pt) const
float GetDistance(const NiPoint3 &a_pt) const noexcept
NiPoint3 operator-() const
float operator*(const NiPoint3 &a_rhs) const
NiPoint3 & operator*=(const NiPoint3 &a_rhs)
NiPoint3 & operator/=(const NiPoint3 &a_rhs)
NiPoint3 & operator/=(float a_scalar)
NiPoint3 & operator*=(float a_scalar)
float Dot(const NiPoint3 &pt) const
NiPoint3 operator-(const NiPoint3 &a_rhs) const
bool operator!=(const NiPoint3 &a_rhs) const
float z
Definition: NiPoint3.h:47
bool operator==(const NiPoint3 &a_rhs) const
NiPoint3 operator/(float a_scalar) const
NiPoint3 operator+(const NiPoint3 &a_rhs) const
static const NiPoint3 & Zero()
float Unitize()
NiPoint3 UnitCross(const NiPoint3 &a_pt) const
constexpr NiPoint3() noexcept=default
float x
Definition: NiPoint3.h:45
float GetSquaredDistance(const NiPoint3 &a_pt) const noexcept
float & operator[](std::size_t a_idx)
NiPoint3 & operator-=(const NiPoint3 &a_rhs)
float Length() const
float y
Definition: NiPoint3.h:46
float SqrLength() const
Definition: AbsorbEffect.h:6