LkEngine 0.1.2
 
Loading...
Searching...
No Matches
LkEngine::TVector3< SizeType > Struct Template Reference

#include <Vector3.h>

Public Member Functions

 TVector3 (const SizeType InX, const SizeType InY, const SizeType InZ)
 
 TVector3 (const SizeType InXYZ)
 
 TVector3 (const glm::vec3 &InVec)
 
TVector3operator+= (const TVector3 &Other)
 
TVector3operator+= (const glm::vec3 &Other)
 
TVector3operator-= (const TVector3 &Other)
 
TVector3operator-= (const glm::vec3 &Other)
 
TVector3 operator+ (const TVector3 &Other) const
 
TVector3 operator+ (const glm::vec3 &Other) const
 
TVector3 operator- (const TVector3 &Other) const
 
TVector3 operator- (const glm::vec3 &Other) const
 
TVector3 operator/ (const float Value) const
 
TVector3 operator/ (const TVector3 &Other) const
 
TVector3 operator/ (const glm::vec3 &Other) const
 
TVector3 operator* (const float Value) const
 
TVector3 operator* (const TVector3 &Other) const
 
TVector3 operator* (const glm::vec3 &Other) const
 
bool operator== (const TVector3 &Other) const
 
bool operator!= (const TVector3 &Other) const
 
bool operator== (const glm::vec3 &Other) const
 
bool operator!= (const glm::vec3 &Other) const
 
FORCEINLINE void Normalize ()
 
FORCEINLINE void NormalizeSafe ()
 
FORCEINLINE std::string ToString () const
 
template<typename VectorType , typename = std::enable_if_t<std::is_same_v<VectorType, glm::vec3>>>
VectorType As () const
 

Static Public Member Functions

template<typename VectorTypeA , typename VectorTypeB >
static SizeType Dot (const VectorTypeA &A, const VectorTypeB &B)
 Calculate the dot product of two vectors.
 
template<typename VectorTypeA , typename VectorTypeB >
static SizeType Distance (const VectorTypeA &A, const VectorTypeB &B)
 Calculate the distance between two vectors.
 
template<typename VectorTypeA , typename VectorTypeB >
static SizeType DistanceSquared (const VectorTypeA &A, const VectorTypeB &B)
 Calculate the squared distance between two vectors.
 
template<typename VectorTypeA , typename VectorTypeB >
static TVector3< SizeType > Cross (const VectorTypeA &A, const VectorTypeB &B)
 
template<typename VectorType >
static TVector3< SizeType > Normalize (const VectorType &Vector)
 
template<typename VectorType >
static TVector3< SizeType > NormalizeSafe (const VectorType &Vector)
 
template<typename VectorTypeA , typename VectorTypeB , typename ReturnType = TVector3<SizeType>>
static ReturnType Min (const VectorTypeA &A, const VectorTypeB &B)
 
template<typename VectorTypeA , typename VectorTypeB , typename ReturnType = TVector3<SizeType>>
static ReturnType Max (const VectorTypeA &A, const VectorTypeB &B)
 
template<typename VectorType >
static VectorType Inverse (const VectorType &Vector)
 
template<typename VectorType >
static VectorType InverseSafe (const VectorType &Vector)
 

Public Attributes

union { 
 
   SizeType   X 
 
   SizeType   R 
 
   SizeType   S 
 
};  
 
union { 
 
   SizeType   Y 
 
   SizeType   G 
 
   SizeType   T 
 
};  
 
union { 
 
   SizeType   Z 
 
   SizeType   B 
 
   SizeType   P 
 
};  
 

Friends

FORCEINLINE friend std::ostream & operator<< (std::ostream &os, const TVector3 &Vector)
 

Detailed Description

template<typename SizeType>
struct LkEngine::TVector3< SizeType >

TVector3

Member Function Documentation

◆ DistanceSquared()

template<typename SizeType >
template<typename VectorTypeA , typename VectorTypeB >
static SizeType LkEngine::TVector3< SizeType >::DistanceSquared ( const VectorTypeA & A,
const VectorTypeB & B )
inlinestatic

Calculate the squared distance between two vectors.

Prefer this over TVector3::Distance if possible (performance).

Returns
The squared distance between the vectors.

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