"L. Spiro Engine"
Public Member Functions | Static Public Member Functions | Public Attributes

lsm::CVector4Base< _tType, _tVec3 > Class Template Reference

A template for any type of 4D vector. More...

#include <LSMVector4Base.h>

List of all members.

Public Member Functions

LSE_CALLCTOR CVector4Base (_tType _fX, _tType _fY, _tType _fZ, _tType _fW)
LSE_CALLCTOR CVector4Base (_tType *_pfValues)
_tType LSE_FCALL operator[] (LSUINT32 _ui32Index) const
_tType &LSE_FCALL operator[] (LSUINT32 _ui32Index)
CVector4Base< _tType, _tVec3 >
LSE_FCALL 
operator- () const
CVector4Base< _tType, _tVec3 >
LSE_FCALL 
operator+ (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
CVector4Base< _tType, _tVec3 >
LSE_FCALL 
operator- (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
CVector4Base< _tType, _tVec3 >
LSE_FCALL 
operator* (_tType _tValue) const
CVector4Base< _tType, _tVec3 >
LSE_FCALL 
operator/ (_tType _tValue) const
CVector4Base< _tType, _tVec3 >
&LSE_FCALL 
operator+= (const CVector4Base< _tType, _tVec3 > &_v4bOther)
CVector4Base< _tType, _tVec3 >
&LSE_FCALL 
operator-= (const CVector4Base< _tType, _tVec3 > &_v4bOther)
CVector4Base< _tType, _tVec3 >
&LSE_FCALL 
operator*= (_tType _tValue)
CVector4Base< _tType, _tVec3 >
&LSE_FCALL 
operator/= (_tType _tValue)
_tType LSE_FCALL operator* (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
LSBOOL LSE_FCALL operator== (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
LSBOOL LSE_FCALL operator!= (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
LSVOID LSE_FCALL Set (_tType _fX, _tType _fY, _tType _fZ, _tType _fW)
LSVOID LSE_FCALL Clear ()
LSVOID LSE_FCALL Invert ()
_tType LSE_FCALL Len () const
_tType LSE_FCALL LenSq () const
LSVOID LSE_FCALL Normalize ()
_tType LSE_FCALL Dot (const CVector4Base< _tType, _tVec3 > &_v4bOther) const
_tVec3 LSE_FCALL Vec3 () const

Static Public Member Functions

static _tType LSE_FCALL DotProduct (const CVector4Base< _tType, _tVec3 > &_v4bLeft, const CVector4Base< _tType, _tVec3 > &_v4bRight)
static CVector4Base< _tType,
_tVec3 > LSE_FCALL 
Lerp (const CVector4Base< _tType, _tVec3 > &_v4bLeft, const CVector4Base< _tType, _tVec3 > &_v4bRight, _tType _fFrac)
static CVector4Base< _tType,
_tVec3 > LSE_FCALL 
Hermite (const CVector4Base< _tType, _tVec3 > &_v4bLeft, const CVector4Base< _tType, _tVec3 > &_v4bT0, const CVector4Base< _tType, _tVec3 > &_v4bRight, const CVector4Base< _tType, _tVec3 > &_v4bT1, _tType _fFrac)
static CVector4Base< _tType,
_tVec3 > LSE_FCALL 
CatmullRom (const CVector4Base< _tType, _tVec3 > &_v4bV0, const CVector4Base< _tType, _tVec3 > &_v4bV1, const CVector4Base< _tType, _tVec3 > &_v4bV2, const CVector4Base< _tType, _tVec3 > &_v4bV3, _tType _fFrac)

Public Attributes

_tType x
_tType y
_tType z
_tType w

Detailed Description

template<typename _tType, typename _tVec3>
class lsm::CVector4Base< _tType, _tVec3 >

A template for any type of 4D vector.

Class CVector4Base Description: A template for any type of 4D vector.


Member Function Documentation

template<typename _tType, typename _tVec3>
static CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::CatmullRom ( const CVector4Base< _tType, _tVec3 > &  _v4bV0,
const CVector4Base< _tType, _tVec3 > &  _v4bV1,
const CVector4Base< _tType, _tVec3 > &  _v4bV2,
const CVector4Base< _tType, _tVec3 > &  _v4bV3,
_tType  _fFrac 
) [inline, static]

Perform a Catmull-Rom spline interpolation between the supplied vectors

Parameters:
_v4bV0Input point 0.
_v4bV1Input point 1.
_v4bV2Input point 2.
_v4bV3Input point 3.
_fFracAmount by which to interpolate between _v4bV1 and _v4bV2.
Returns:
Returns the vector interpolated between _v4bV1 and _v4bV2 by _fFrac.
template<typename _tType, typename _tVec3>
LSVOID LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Clear ( ) [inline]

Sets all axes on this vector to 0.

template<typename _tType, typename _tVec3>
_tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Dot ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Performs a dot-product operation. The dot product of two normalized vectors is the cosine of the angle between them.

Parameters:
_v4bOtherThe vector against which the dot product is to be determined.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tVec3>
static _tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::DotProduct ( const CVector4Base< _tType, _tVec3 > &  _v4bLeft,
const CVector4Base< _tType, _tVec3 > &  _v4bRight 
) [inline, static]

Performs a dot-product operation. The dot product of two normalized vectors is the cosine of the angle between them.

Parameters:
_v4bLeftThe left operand.
_v4bRightThe right operand.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tVec3>
static CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Hermite ( const CVector4Base< _tType, _tVec3 > &  _v4bLeft,
const CVector4Base< _tType, _tVec3 > &  _v4bT0,
const CVector4Base< _tType, _tVec3 > &  _v4bRight,
const CVector4Base< _tType, _tVec3 > &  _v4bT1,
_tType  _fFrac 
) [inline, static]

Perform a Hermite spline interpolation between the supplied vectors.

Parameters:
_v4bLeftLeft operand.
_v4bT0Left tangent.
_v4bRightRight operand.
_v4bT1Right tangent.
_fFracAmount by which to interpolate between the vectors.
Returns:
Returns the vector interpolated between _v4bLeft and _v4bRight by _fFrac.
template<typename _tType, typename _tVec3>
LSVOID LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Invert ( ) [inline]

Negates each axis on this vector.

template<typename _tType, typename _tVec3>
_tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Len ( ) const [inline]

Calculates the length of the vector.

Returns:
Returns the length of the vector.
template<typename _tType, typename _tVec3>
_tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::LenSq ( ) const [inline]

Calculates the squared length of the vector.

Returns:
Returns the squared length of the vector.
template<typename _tType, typename _tVec3>
static CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Lerp ( const CVector4Base< _tType, _tVec3 > &  _v4bLeft,
const CVector4Base< _tType, _tVec3 > &  _v4bRight,
_tType  _fFrac 
) [inline, static]

Linearly interpolate between two vectors, returning the resulting vector.

Parameters:
_v4bLeftLeft operand.
_v4bRightRight operand.
_fFracAmount by which to interpolate between the vectors.
Returns:
Returns the vector interpolated between _v4bLeft and _v4bRight by _fFrac.
template<typename _tType, typename _tVec3>
LSVOID LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Normalize ( ) [inline]

Normalizes this vector. Normalization is the process of adjusting the length of the vector so that it is unit length (1 unit in length) while maintaining its direction. Accuracy/speed depends on the LSM_PERFORMANCE macro.

template<typename _tType, typename _tVec3>
LSBOOL LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator!= ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Inequality.

Parameters:
_v4bOtherThe vector to check for inequality.
Returns:
Returns true if both vectors are not equal.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator* ( _tType  _tValue) const [inline]

Binary multiplication.

Parameters:
_tValueThe amount by which to multiply each component in this vector.
Returns:
Returns a new vector representing the product.
template<typename _tType, typename _tVec3>
_tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator* ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Performs a dot-product operation. The dot product of two normalized vectors is the cosine of the angle between them.

Parameters:
_v4bOtherThe vector against which the dot product is to be determined.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3>& LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator*= ( _tType  _tValue) [inline]

Multiply the vector by a given amount, storing the result in this vector.

Parameters:
_tValueThe amount by which to multiply each component in this vector.
Returns:
Returns this vector, after the muliplication operation has been applied.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator+ ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Binary addition.

Parameters:
_v4bOtherThe vector to add to this one componentwise.
Returns:
Returns a new vector representing the addition.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3>& LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator+= ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) [inline]

Add a vector to this vector, storing the result in this vector.

Parameters:
_v4bOtherThe vector to add to this vector.
Returns:
Returns this vector, after the addition operation has been applied.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator- ( ) const [inline]

Unary -.

Returns:
Returns a copy of this vector with each axis negated.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator- ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Binary subtraction.

Parameters:
_v4bOtherThe vector to subtract from this one componentwise.
Returns:
Returns a new vector representing the difference.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3>& LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator-= ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) [inline]

Subtract a vector from this vector, storing the result in this vector.

Parameters:
_v4bOtherThe vector to subtract from this vector.
Returns:
Returns this vector, after the subtraction operation has been applied.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3> LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator/ ( _tType  _tValue) const [inline]

Binary division.

Parameters:
_tValueThe amount by which to divide each component in this vector.
Returns:
Returns a new vector representing the quotient.
template<typename _tType, typename _tVec3>
CVector4Base<_tType, _tVec3>& LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator/= ( _tType  _tValue) [inline]

Divide the vector by a given amount, storing the result in this vector.

Parameters:
_tValueThe amount by which to divide each component in this vector.
Returns:
Returns this vector, after the division operation has been applied.
template<typename _tType, typename _tVec3>
LSBOOL LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator== ( const CVector4Base< _tType, _tVec3 > &  _v4bOther) const [inline]

Equality.

Parameters:
_v4bOtherThe vector to check for equality.
Returns:
Returns true if both vectors are equal.
template<typename _tType, typename _tVec3>
_tType LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator[] ( LSUINT32  _ui32Index) const [inline]

Array access.

Parameters:
_ui32IndexIndex of the dimension to get.
Returns:
Returns the value at the given dimension.
template<typename _tType, typename _tVec3>
_tType& LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::operator[] ( LSUINT32  _ui32Index) [inline]

Array access.

Parameters:
_ui32IndexIndex of the dimension to get.
Returns:
Returns the value at the given dimension.
template<typename _tType, typename _tVec3>
LSVOID LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Set ( _tType  _fX,
_tType  _fY,
_tType  _fZ,
_tType  _fW 
) [inline]

Apply the given values to each of the axes on this vector.

Parameters:
_fXThe new X-axis value.
_fYThe new Y-axis value.
_fZThe new Z-axis value.
_fWThe new W-axis value.
template<typename _tType, typename _tVec3>
_tVec3 LSE_FCALL lsm::CVector4Base< _tType, _tVec3 >::Vec3 ( ) const [inline]

Get the X, Y, and Z values of this vector as a 3D vector.

Returns:
Returns a 3D vector representing the XYZ of this vector.

Member Data Documentation

template<typename _tType, typename _tVec3>
_tType lsm::CVector4Base< _tType, _tVec3 >::w

The W value.

template<typename _tType, typename _tVec3>
_tType lsm::CVector4Base< _tType, _tVec3 >::x

The X value.

template<typename _tType, typename _tVec3>
_tType lsm::CVector4Base< _tType, _tVec3 >::y

The Y value.

template<typename _tType, typename _tVec3>
_tType lsm::CVector4Base< _tType, _tVec3 >::z

The Z value.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator