CommonLibVR
NiPoint2.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  class NiPoint2
6  {
7  public:
8  constexpr NiPoint2() noexcept = default;
9 
10  constexpr NiPoint2(float a_x, float a_y) noexcept :
11  x(a_x),
12  y(a_y){};
13 
14  float& operator[](std::size_t a_idx);
15  const float& operator[](std::size_t a_idx) const;
16  bool operator==(const NiPoint2& a_rhs) const;
17  bool operator!=(const NiPoint2& a_rhs) const;
18  NiPoint2 operator+(const NiPoint2& a_rhs) const;
19  NiPoint2 operator-(const NiPoint2& a_rhs) const;
20  float operator*(const NiPoint2& a_rhs) const;
21  NiPoint2 operator*(float a_scalar) const;
22  NiPoint2 operator/(float a_scalar) const;
24  NiPoint2& operator+=(const NiPoint2& a_rhs);
25  NiPoint2& operator-=(const NiPoint2& a_rhs);
26  NiPoint2& operator*=(float a_scalar);
27  NiPoint2& operator/=(float a_scalar);
28 
29  [[nodiscard]] float Cross(const NiPoint2& a_pt) const;
30  [[nodiscard]] float Dot(const NiPoint2& a_pt) const;
31  [[nodiscard]] float GetDistance(const NiPoint2& a_pt) const noexcept;
32  [[nodiscard]] float GetSquaredDistance(const NiPoint2& a_pt) const noexcept;
33  [[nodiscard]] float Length() const;
34  [[nodiscard]] float SqrLength() const;
35  float Unitize();
36 
37  // members
38  float x{ 0.0F }; // 0
39  float y{ 0.0F }; // 4
40  private:
41  KEEP_FOR_RE()
42  };
43  static_assert(sizeof(NiPoint2) == 0x8);
44 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: NiPoint2.h:6
NiPoint2 operator/(float a_scalar) const
NiPoint2 operator-() const
NiPoint2 operator*(float a_scalar) const
float x
Definition: NiPoint2.h:38
float Dot(const NiPoint2 &a_pt) const
float Cross(const NiPoint2 &a_pt) const
NiPoint2 & operator+=(const NiPoint2 &a_rhs)
constexpr NiPoint2() noexcept=default
NiPoint2 & operator/=(float a_scalar)
float GetDistance(const NiPoint2 &a_pt) const noexcept
NiPoint2 & operator*=(float a_scalar)
float y
Definition: NiPoint2.h:39
NiPoint2 operator-(const NiPoint2 &a_rhs) const
bool operator==(const NiPoint2 &a_rhs) const
const float & operator[](std::size_t a_idx) const
bool operator!=(const NiPoint2 &a_rhs) const
float GetSquaredDistance(const NiPoint2 &a_pt) const noexcept
float & operator[](std::size_t a_idx)
float Unitize()
NiPoint2 & operator-=(const NiPoint2 &a_rhs)
NiPoint2 operator+(const NiPoint2 &a_rhs) const
float Length() const
float operator*(const NiPoint2 &a_rhs) const
float SqrLength() const
Definition: AbsorbEffect.h:6