OpenBarnyard
 
Loading...
Searching...
No Matches
TPlane Class Reference

#include <TPlane.h>

Public Types

enum  PlaneComparison { PlaneComparison_InFront = -1 , PlaneComparison_Intersects , PlaneComparison_InBack }
 

Public Member Functions

constexpr TPlane ()=default
 
constexpr TPlane (const TVector4 &a_PlaneData)
 
constexpr TPlane (const TVector3 &a_Normal, TFLOAT a_fDistance)
 
constexpr TPlane (const TVector3 &a_Normal, const TVector3 &a_Point)
 
constexpr TPlane (TFLOAT a_fNormalX, TFLOAT a_fNormalY, TFLOAT a_fNormalZ, TFLOAT a_fDistance)
 
constexpr TPlane (const TPlane &a_Other)
 
constexpr void Set (const TVector4 &a_PlaneData)
 
constexpr void Set (const TVector3 &a_Normal, TFLOAT a_fDistance)
 
constexpr void Set (const TVector3 &a_Normal, const TVector3 &a_Point)
 
constexpr void Set (TFLOAT a_fNormalX, TFLOAT a_fNormalY, TFLOAT a_fNormalZ, TFLOAT a_fDistance)
 
constexpr void Set (const TPlane &a_Other)
 
TFORCEINLINE constexpr TFLOAT GetD () const
 
TFORCEINLINE constexpr void SetD (TFLOAT a_fDistance)
 
TFORCEINLINE constexpr const TVector3GetNormal () const
 
TFORCEINLINE constexpr void SetNormal (const TVector3 &a_rNormal)
 
TFORCEINLINE constexpr void SetNormal (TFLOAT a_fNormalX, TFLOAT a_fNormalY, TFLOAT a_fNormalZ)
 
TFORCEINLINE void GetPoint (TVector3 &a_rPoint)
 
TFORCEINLINE void SetPoint (const TVector3 &a_rPoint)
 
TFORCEINLINE void Negate (const TPlane &a_rPlane)
 
TFORCEINLINE void Negate ()
 
constexpr TPlaneoperator= (const TPlane &a_rPlane)
 
TFORCEINLINE constexpr TVector3AsNormal ()
 
TFORCEINLINE constexpr const TVector3AsNormal () const
 
TFORCEINLINE TVector4AsVector4 ()
 
TFORCEINLINE const TVector4AsVector4 () const
 

Detailed Description

Definition at line 6 of file TPlane.h.

Member Enumeration Documentation

◆ PlaneComparison

Enumerator
PlaneComparison_InFront 
PlaneComparison_Intersects 
PlaneComparison_InBack 

Definition at line 9 of file TPlane.h.

10 {
14 };
@ PlaneComparison_InBack
Definition TPlane.h:13
@ PlaneComparison_Intersects
Definition TPlane.h:12
@ PlaneComparison_InFront
Definition TPlane.h:11

Constructor & Destructor Documentation

◆ TPlane() [1/6]

TPlane::TPlane ( )
constexprdefault

◆ TPlane() [2/6]

TPlane::TPlane ( const TVector4 & a_PlaneData)
inlineconstexpr

Definition at line 19 of file TPlane.h.

20 : m_Normal( a_PlaneData.AsVector3() ), m_fDistance( a_PlaneData.w )
21 {}
TVector3 & AsVector3()
Definition TVector4.h:321
TFLOAT w
Definition TVector4.h:367

◆ TPlane() [3/6]

TPlane::TPlane ( const TVector3 & a_Normal,
TFLOAT a_fDistance )
inlineconstexpr

Definition at line 23 of file TPlane.h.

24 : m_Normal( a_Normal ), m_fDistance( a_fDistance )
25 {}

◆ TPlane() [4/6]

TPlane::TPlane ( const TVector3 & a_Normal,
const TVector3 & a_Point )
inlineconstexpr

Definition at line 27 of file TPlane.h.

28 : m_Normal( a_Normal ), m_fDistance( TVector3::DotProduct( a_Normal, a_Point ) )
29 {}
static constexpr TFLOAT DotProduct(const TVector3 &vec1, const TVector3 &vec2)
Definition TVector3.h:147

◆ TPlane() [5/6]

TPlane::TPlane ( TFLOAT a_fNormalX,
TFLOAT a_fNormalY,
TFLOAT a_fNormalZ,
TFLOAT a_fDistance )
inlineconstexpr

Definition at line 31 of file TPlane.h.

32 : m_Normal( a_fNormalX, a_fNormalY, a_fNormalZ ), m_fDistance( a_fDistance )
33 {}

◆ TPlane() [6/6]

TPlane::TPlane ( const TPlane & a_Other)
inlineconstexpr

Definition at line 35 of file TPlane.h.

36 : m_Normal( a_Other.m_Normal ), m_fDistance( a_Other.m_fDistance )
37 {}

Member Function Documentation

◆ AsNormal() [1/2]

TFORCEINLINE constexpr TVector3 & TPlane::AsNormal ( )
inlineconstexpr

Definition at line 121 of file TPlane.h.

121{ return m_Normal; }

◆ AsNormal() [2/2]

TFORCEINLINE constexpr const TVector3 & TPlane::AsNormal ( ) const
inlineconstexpr

Definition at line 122 of file TPlane.h.

122{ return m_Normal; }

◆ AsVector4() [1/2]

TFORCEINLINE TVector4 & TPlane::AsVector4 ( )
inline

Definition at line 124 of file TPlane.h.

124{ return *TREINTERPRETCAST( TVector4*, this ); }
#define TREINTERPRETCAST(TYPE, VALUE)
Definition Defines.h:68

◆ AsVector4() [2/2]

TFORCEINLINE const TVector4 & TPlane::AsVector4 ( ) const
inline

Definition at line 125 of file TPlane.h.

125{ return *TREINTERPRETCAST( const TVector4*, this ); }

◆ GetD()

TFORCEINLINE constexpr TFLOAT TPlane::GetD ( ) const
inlineconstexpr

Definition at line 69 of file TPlane.h.

70 {
71 return m_fDistance;
72 }

◆ GetNormal()

TFORCEINLINE constexpr const TVector3 & TPlane::GetNormal ( ) const
inlineconstexpr

Definition at line 79 of file TPlane.h.

80 {
81 return m_Normal;
82 }

◆ GetPoint()

TFORCEINLINE void TPlane::GetPoint ( TVector3 & a_rPoint)
inline

Definition at line 94 of file TPlane.h.

95 {
96 a_rPoint.Multiply( m_Normal, m_fDistance );
97 }
constexpr void Multiply(const TVector3 &vec)
Definition TVector3.h:103

◆ Negate() [1/2]

TFORCEINLINE void TPlane::Negate ( )
inline

Definition at line 109 of file TPlane.h.

110 {
111 AsVector4().Negate4();
112 }
TFORCEINLINE TVector4 & AsVector4()
Definition TPlane.h:124
constexpr void Negate4(const TVector4 &vec)
Definition TVector4.h:274

◆ Negate() [2/2]

TFORCEINLINE void TPlane::Negate ( const TPlane & a_rPlane)
inline

Definition at line 104 of file TPlane.h.

105 {
106 AsVector4().Negate4( a_rPlane.AsVector4() );
107 }

◆ operator=()

TPlane & TPlane::operator= ( const TPlane & a_rPlane)
inlineconstexpr

Definition at line 114 of file TPlane.h.

115 {
116 m_Normal = a_rPlane.m_Normal;
117 m_fDistance = a_rPlane.m_fDistance;
118 return *this;
119 }

◆ Set() [1/5]

void TPlane::Set ( const TPlane & a_Other)
inlineconstexpr

Definition at line 63 of file TPlane.h.

64 {
65 m_Normal = a_Other.m_Normal;
66 m_fDistance = a_Other.m_fDistance;
67 }

◆ Set() [2/5]

void TPlane::Set ( const TVector3 & a_Normal,
const TVector3 & a_Point )
inlineconstexpr

Definition at line 51 of file TPlane.h.

52 {
53 m_Normal = a_Normal;
54 m_fDistance = TVector3::DotProduct( a_Normal, a_Point );
55 }

◆ Set() [3/5]

void TPlane::Set ( const TVector3 & a_Normal,
TFLOAT a_fDistance )
inlineconstexpr

Definition at line 45 of file TPlane.h.

46 {
47 m_Normal = a_Normal;
48 m_fDistance = a_fDistance;
49 }

◆ Set() [4/5]

void TPlane::Set ( const TVector4 & a_PlaneData)
inlineconstexpr

Definition at line 39 of file TPlane.h.

40 {
41 m_Normal = a_PlaneData.AsVector3();
42 m_fDistance = a_PlaneData.w;
43 }

◆ Set() [5/5]

void TPlane::Set ( TFLOAT a_fNormalX,
TFLOAT a_fNormalY,
TFLOAT a_fNormalZ,
TFLOAT a_fDistance )
inlineconstexpr

Definition at line 57 of file TPlane.h.

58 {
59 m_Normal.Set( a_fNormalX, a_fNormalY, a_fNormalZ );
60 m_fDistance = a_fDistance;
61 }

◆ SetD()

TFORCEINLINE constexpr void TPlane::SetD ( TFLOAT a_fDistance)
inlineconstexpr

Definition at line 74 of file TPlane.h.

75 {
76 m_fDistance = a_fDistance;
77 }

◆ SetNormal() [1/2]

TFORCEINLINE constexpr void TPlane::SetNormal ( const TVector3 & a_rNormal)
inlineconstexpr

Definition at line 84 of file TPlane.h.

85 {
86 m_Normal = a_rNormal;
87 }

◆ SetNormal() [2/2]

TFORCEINLINE constexpr void TPlane::SetNormal ( TFLOAT a_fNormalX,
TFLOAT a_fNormalY,
TFLOAT a_fNormalZ )
inlineconstexpr

Definition at line 89 of file TPlane.h.

90 {
91 m_Normal.Set( a_fNormalX, a_fNormalY, a_fNormalZ );
92 }

◆ SetPoint()

TFORCEINLINE void TPlane::SetPoint ( const TVector3 & a_rPoint)
inline

Definition at line 99 of file TPlane.h.

100 {
101 m_fDistance = TVector3::DotProduct( m_Normal, a_rPoint );
102 }

The documentation for this class was generated from the following file: