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  NiPoint3 operator+(const NiPoint3& a_rhs) const;
20  NiPoint3 operator-(const NiPoint3& a_rhs) const;
21  float operator*(const NiPoint3& a_rhs) const;
22  NiPoint3 operator*(float a_scalar) const;
23  NiPoint3 operator/(float a_scalar) const;
25  NiPoint3& operator+=(const NiPoint3& a_rhs);
26  NiPoint3& operator-=(const NiPoint3& a_rhs);
27  NiPoint3& operator*=(float a_scalar);
28  NiPoint3& operator/=(float a_scalar);
29 
30  [[nodiscard]] NiPoint3 Cross(const NiPoint3& pt) const;
31  [[nodiscard]] float GetDistance(const NiPoint3& a_pt) const noexcept;
32  [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_pt) const noexcept;
33  [[nodiscard]] float Length() const;
34  [[nodiscard]] float SqrLength() const;
35  [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_pt) const;
36  float Unitize();
37 
38  // members
39  float x{ 0.0F }; // 0
40  float y{ 0.0F }; // 4
41  float z{ 0.0F }; // 8
42  };
43  static_assert(sizeof(NiPoint3) == 0xC);
44 }
Definition: NiPoint3.h:6
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/=(float a_scalar)
NiPoint3 & operator*=(float a_scalar)
NiPoint3 operator-(const NiPoint3 &a_rhs) const
bool operator!=(const NiPoint3 &a_rhs) const
float z
Definition: NiPoint3.h:41
bool operator==(const NiPoint3 &a_rhs) const
NiPoint3 operator/(float a_scalar) const
NiPoint3 operator+(const NiPoint3 &a_rhs) const
float Unitize()
NiPoint3 UnitCross(const NiPoint3 &a_pt) const
constexpr NiPoint3() noexcept=default
float x
Definition: NiPoint3.h:39
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:40
float SqrLength() const
Definition: AbsorbEffect.h:6