Plasma Engine  2.0
Loading...
Searching...
No Matches
SimdBSphere.h
1#pragma once
2
3#include <Foundation/SimdMath/SimdTransform.h>
4
5class PL_FOUNDATION_DLL plSimdBSphere
6{
7public:
8 PL_DECLARE_POD_TYPE();
9
12
14 plSimdBSphere(const plSimdVec4f& vCenter, const plSimdFloat& fRadius); // [tested]
15
17 [[nodiscard]] static plSimdBSphere MakeZero();
18
23 [[nodiscard]] static plSimdBSphere MakeInvalid(const plSimdVec4f& vCenter = plSimdVec4f::MakeZero()); // [tested]
24
26 [[nodiscard]] static plSimdBSphere MakeFromCenterAndRadius(const plSimdVec4f& vCenter, const plSimdFloat& fRadius); // [tested]
27
32 [[nodiscard]] static plSimdBSphere MakeFromPoints(const plSimdVec4f* pPoints, plUInt32 uiNumPoints, plUInt32 uiStride = sizeof(plSimdVec4f));
33
34
35public:
37 [[deprecated("Use MakeInvalid() instead.")]] void SetInvalid(); // [tested]
38
40 bool IsValid() const; // [tested]
41
43 bool IsNaN() const; // [tested]
44
46 plSimdVec4f GetCenter() const; // [tested]
47
49 plSimdFloat GetRadius() const; // [tested]
50
52 [[deprecated("Use MakeFromPoints() instead.")]] void SetFromPoints(const plSimdVec4f* pPoints, plUInt32 uiNumPoints, plUInt32 uiStride = sizeof(plSimdVec4f));
53
55 void ExpandToInclude(const plSimdVec4f& vPoint); // [tested]
56
59 void ExpandToInclude(const plSimdVec4f* pPoints, plUInt32 uiNumPoints, plUInt32 uiStride = sizeof(plSimdVec4f)); // [tested]
60
62 void ExpandToInclude(const plSimdBSphere& rhs); // [tested]
63
64public:
66 void Transform(const plSimdTransform& t); // [tested]
67
69 void Transform(const plSimdMat4f& mMat); // [tested]
70
71public:
73 plSimdFloat GetDistanceTo(const plSimdVec4f& vPoint) const; // [tested]
74
77 plSimdFloat GetDistanceTo(const plSimdBSphere& rhs) const; // [tested]
78
80 bool Contains(const plSimdVec4f& vPoint) const; // [tested]
81
83 bool Contains(const plSimdBSphere& rhs) const; // [tested]
84
86 bool Overlaps(const plSimdBSphere& rhs) const; // [tested]
87
90 [[nodiscard]] plSimdVec4f GetClampedPoint(const plSimdVec4f& vPoint); // [tested]
91
92 [[nodiscard]] bool operator==(const plSimdBSphere& rhs) const; // [tested]
93 [[nodiscard]] bool operator!=(const plSimdBSphere& rhs) const; // [tested]
94
95public:
96 plSimdVec4f m_CenterAndRadius;
97};
98
99#include <Foundation/SimdMath/Implementation/SimdBSphere_inl.h>
Definition SimdBSphere.h:6
plSimdBSphere()
Default constructor does not initialize any data.
Definition SimdFloat.h:7
A 4x4 matrix class.
Definition SimdMat4f.h:7
Definition SimdTransform.h:6
A 4-component SIMD vector class.
Definition SimdVec4f.h:8
static plSimdVec4f MakeZero()
Creates an plSimdVec4f that is initialized to zero.
Definition SimdVec4f_inl.h:8