CommonLibSSE NG
hkVector4.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/H/hkSseMathTypes.h"
4 #include "RE/N/NiPoint3.h"
5 
6 namespace RE
7 {
8  class hkVector4
9  {
10  public:
12  quad(_mm_set1_ps(0.0f))
13  {}
14 
15  hkVector4(const float& a_x) :
16  quad(_mm_set1_ps(a_x))
17  {}
18 
19  hkVector4(const float& a_x, const float& a_y, const float& a_z, const float& a_w) :
20  quad(_mm_setr_ps(a_x, a_y, a_z, a_w))
21  {}
22 
23  hkVector4(const hkVector4& a_rhs) :
24  quad(a_rhs.quad)
25  {}
26 
27  hkVector4(const hkQuadReal& a_rhs) :
28  quad(a_rhs)
29  {}
30 
31  hkVector4(const NiPoint3& a_point) :
32  quad(_mm_setr_ps(a_point.x, a_point.y, a_point.z, 0.0f))
33  {}
34 
35  hkVector4& operator=(const hkVector4& a_rhs);
36  hkVector4 operator+(const hkVector4& a_rhs) const;
37  hkVector4 operator-(const hkVector4& a_rhs) const;
38  hkVector4 operator*(const hkVector4& a_rhs) const;
39  hkVector4 operator/(const hkVector4& a_rhs) const;
40 
41  [[nodiscard]] bool IsEqual(const hkVector4& a_pt, float a_epsilon = 1e-3f) const;
42  [[nodiscard]] hkVector4 Cross(const hkVector4& a_pt) const;
43  [[nodiscard]] float Dot3(const hkVector4& a_pt) const;
44  [[nodiscard]] float Dot4(const hkVector4& a_pt) const;
45  [[nodiscard]] float GetDistance3(const hkVector4& a_pt) const noexcept;
46  [[nodiscard]] float GetSquaredDistance3(const hkVector4& a_pt) const noexcept;
47  [[nodiscard]] float Length3() const;
48  [[nodiscard]] float SqrLength3() const;
49  [[nodiscard]] float Length4() const;
50  [[nodiscard]] float SqrLength4() const;
51 
52  // members
53  hkQuadReal quad{}; // 00
54  };
55  static_assert(sizeof(hkVector4) == 0x10);
56 }
Definition: NiPoint3.h:6
Definition: hkVector4.h:9
hkVector4(const hkVector4 &a_rhs)
Definition: hkVector4.h:23
float Dot4(const hkVector4 &a_pt) const
hkVector4 Cross(const hkVector4 &a_pt) const
hkVector4 operator-(const hkVector4 &a_rhs) const
hkVector4()
Definition: hkVector4.h:11
hkVector4(const hkQuadReal &a_rhs)
Definition: hkVector4.h:27
hkQuadReal quad
Definition: hkVector4.h:53
hkVector4 operator/(const hkVector4 &a_rhs) const
float Length4() const
float GetDistance3(const hkVector4 &a_pt) const noexcept
bool IsEqual(const hkVector4 &a_pt, float a_epsilon=1e-3f) const
hkVector4(const float &a_x, const float &a_y, const float &a_z, const float &a_w)
Definition: hkVector4.h:19
float Length3() const
hkVector4 & operator=(const hkVector4 &a_rhs)
float SqrLength3() const
hkVector4(const float &a_x)
Definition: hkVector4.h:15
hkVector4(const NiPoint3 &a_point)
Definition: hkVector4.h:31
float SqrLength4() const
float GetSquaredDistance3(const hkVector4 &a_pt) const noexcept
hkVector4 operator*(const hkVector4 &a_rhs) const
float Dot3(const hkVector4 &a_pt) const
hkVector4 operator+(const hkVector4 &a_rhs) const
Definition: AbsorbEffect.h:6
__m128 hkQuadReal
Definition: hkSseMathTypes.h:7