CommonLibSSE NG
Loading...
Searching...
No Matches
NiPoint2.h
Go to the documentation of this file.
1#pragma once
2
3namespace 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;
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 };
41 static_assert(sizeof(NiPoint2) == 0x8);
42}
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
float & operator[](std::size_t a_idx)
NiPoint2 & operator*=(float a_scalar)
float GetDistance(const NiPoint2 &a_pt) const noexcept
const float & operator[](std::size_t a_idx) const
float y
Definition NiPoint2.h:39
NiPoint2 operator-(const NiPoint2 &a_rhs) const
NiPoint2 & operator/=(float a_scalar)
bool operator==(const NiPoint2 &a_rhs) const
bool operator!=(const NiPoint2 &a_rhs) const
float GetSquaredDistance(const NiPoint2 &a_pt) const noexcept
NiPoint2 & operator-=(const NiPoint2 &a_rhs)
float Unitize()
NiPoint2 operator+(const NiPoint2 &a_rhs) const
float Length() const
float operator*(const NiPoint2 &a_rhs) const
float SqrLength() const
Definition AbsorbEffect.h:6