CommonLibVR
Loading...
Searching...
No Matches
NiPoint3.h
Go to the documentation of this file.
1#pragma once
2
3namespace 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;
30 NiPoint3& operator*=(float a_scalar);
31 NiPoint3& operator/=(float a_scalar);
32
33 friend NiPoint3 operator+(float a_lhs, const NiPoint3& a_rhs);
34 friend NiPoint3 operator-(float a_lhs, const NiPoint3& a_rhs);
35 friend NiPoint3 operator*(float a_lhs, const NiPoint3& a_rhs);
36 friend NiPoint3 operator/(float a_lhs, const NiPoint3& a_rhs);
37
38 [[nodiscard]] NiPoint3 Cross(const NiPoint3& pt) const;
39 [[nodiscard]] float Dot(const NiPoint3& pt) const;
40 [[nodiscard]] float GetDistance(const NiPoint3& a_pt) const noexcept;
41 [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_pt) const noexcept;
42 [[nodiscard]] float Length() const;
43 [[nodiscard]] float SqrLength() const;
44 [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_pt) const;
45 float Unitize();
46
47 static const NiPoint3& Zero();
48
49 // members
50 float x{ 0.0F }; // 0
51 float y{ 0.0F }; // 4
52 float z{ 0.0F }; // 8
53 private:
55 };
56 static_assert(sizeof(NiPoint3) == 0xC);
57}
#define KEEP_FOR_RE()
Definition PCH.h:517
Definition NiPoint3.h:6
bool operator<(const NiPoint3 &a_rhs) const
friend NiPoint3 operator+(float a_lhs, const NiPoint3 &a_rhs)
friend NiPoint3 operator*(float a_lhs, const NiPoint3 &a_rhs)
NiPoint3 operator*(float a_scalar) const
NiPoint3 Cross(const NiPoint3 &pt) const
float GetDistance(const NiPoint3 &a_pt) const noexcept
NiPoint3 operator-() const
NiPoint3 & operator/=(const NiPoint3 &a_rhs)
float operator*(const NiPoint3 &a_rhs) const
static const NiPoint3 & Zero()
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:52
friend NiPoint3 operator-(float a_lhs, const NiPoint3 &a_rhs)
bool operator==(const NiPoint3 &a_rhs) const
NiPoint3 operator/(float a_scalar) const
NiPoint3 & operator-=(const NiPoint3 &a_rhs)
friend NiPoint3 operator/(float a_lhs, const NiPoint3 &a_rhs)
NiPoint3 operator+(const NiPoint3 &a_rhs) const
const float & operator[](std::size_t a_idx) const
NiPoint3 & operator/=(float a_scalar)
float Unitize()
NiPoint3 UnitCross(const NiPoint3 &a_pt) const
constexpr NiPoint3() noexcept=default
float x
Definition NiPoint3.h:50
float & operator[](std::size_t a_idx)
float GetSquaredDistance(const NiPoint3 &a_pt) const noexcept
NiPoint3 & operator+=(const NiPoint3 &a_rhs)
NiPoint3 & operator*=(const NiPoint3 &a_rhs)
float Length() const
float y
Definition NiPoint3.h:51
float SqrLength() const
Definition AbsorbEffect.h:6