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

lsm::CVector2Base< _tType, _tInher > Class Template Reference

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

#include <LSMVector2Base.h>

List of all members.

Public Member Functions

LSE_CALLCTOR CVector2Base (const _tInher &_v2bOther)
LSE_CALLCTOR CVector2Base (_tType _fX, _tType _fY)
LSE_CALLCTOR CVector2Base (_tType *_pfValues)
_tType LSE_FCALL operator[] (LSUINT32 _ui32Index) const
_tType &LSE_FCALL operator[] (LSUINT32 _ui32Index)
_tInher &LSE_FCALL operator= (const _tInher &_v2bOther)
_tInher LSE_FCALL operator- () const
_tInher LSE_FCALL operator+ (const _tInher &_v2bOther) const
_tInher LSE_FCALL operator- (const _tInher &_v2bOther) const
_tInher LSE_FCALL operator* (_tType _tValue) const
_tInher LSE_FCALL operator/ (_tType _tValue) const
_tInher &LSE_FCALL operator+= (const _tInher &_v2bOther)
_tInher &LSE_FCALL operator-= (const _tInher &_v2bOther)
_tInher &LSE_FCALL operator*= (_tType _tValue)
_tInher &LSE_FCALL operator/= (_tType _tValue)
_tType LSE_FCALL operator* (const _tInher &_v2bOther) const
LSBOOL LSE_FCALL operator== (const _tInher &_v2bOther) const
LSBOOL LSE_FCALL operator!= (const _tInher &_v2bOther) const
LSVOID LSE_FCALL Set (_tType _fX, _tType _fY)
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 CVector2Base< _tType, _tInher > &_v2bOther) const

Static Public Member Functions

static _tType LSE_FCALL DotProduct (const CVector2Base< _tType, _tInher > &_v2bLeft, const CVector2Base< _tType, _tInher > &_v2bRight)
static CVector2Base< _tType,
_tInher > LSE_FCALL 
Lerp (const CVector2Base< _tType, _tInher > &_v2bLeft, const CVector2Base< _tType, _tInher > &_v2bRight, _tType _fFrac)
static CVector2Base< _tType,
_tInher > LSE_FCALL 
Hermite (const CVector2Base< _tType, _tInher > &_v2bLeft, const CVector2Base< _tType, _tInher > &_v2bT0, const CVector2Base< _tType, _tInher > &_v2bRight, const CVector2Base< _tType, _tInher > &_v2bT1, _tType _fFrac)
static CVector2Base< _tType,
_tInher > LSE_FCALL 
CatmullRom (const CVector2Base< _tType, _tInher > &_v2bV0, const CVector2Base< _tType, _tInher > &_v2bV1, const CVector2Base< _tType, _tInher > &_v2bV2, const CVector2Base< _tType, _tInher > &_v2bV3, _tType _fFrac)

Public Attributes

_tType x
_tType y

Detailed Description

template<typename _tType, typename _tInher>
class lsm::CVector2Base< _tType, _tInher >

A template for any type of 2D vector.

Class CVector2Base Description: A template for any type of 2D vector.


Member Function Documentation

template<typename _tType, typename _tInher>
static CVector2Base<_tType, _tInher> LSE_FCALL lsm::CVector2Base< _tType, _tInher >::CatmullRom ( const CVector2Base< _tType, _tInher > &  _v2bV0,
const CVector2Base< _tType, _tInher > &  _v2bV1,
const CVector2Base< _tType, _tInher > &  _v2bV2,
const CVector2Base< _tType, _tInher > &  _v2bV3,
_tType  _fFrac 
) [inline, static]

Perform a Catmull-Rom spline interpolation between the supplied vectors

Parameters:
_v2bV0Input point 0.
_v2bV1Input point 1.
_v2bV2Input point 2.
_v2bV3Input point 3.
_fFracAmount by which to interpolate between _v2bV1 and _v2bV2.
Returns:
Returns the vector interpolated between _v2bV1 and _v2bV2 by _fFrac.
template<typename _tType, typename _tInher>
LSVOID LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Clear ( ) [inline]

Sets all axes on this vector to 0.

template<typename _tType, typename _tInher>
_tType LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Dot ( const CVector2Base< _tType, _tInher > &  _v2bOther) const [inline]

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

Parameters:
_v2bOtherThe vector against which the dot product is to be determined.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tInher>
static _tType LSE_FCALL lsm::CVector2Base< _tType, _tInher >::DotProduct ( const CVector2Base< _tType, _tInher > &  _v2bLeft,
const CVector2Base< _tType, _tInher > &  _v2bRight 
) [inline, static]

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

Parameters:
_v2bLeftThe left operand.
_v2bRightThe right operand.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tInher>
static CVector2Base<_tType, _tInher> LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Hermite ( const CVector2Base< _tType, _tInher > &  _v2bLeft,
const CVector2Base< _tType, _tInher > &  _v2bT0,
const CVector2Base< _tType, _tInher > &  _v2bRight,
const CVector2Base< _tType, _tInher > &  _v2bT1,
_tType  _fFrac 
) [inline, static]

Perform a Hermite spline interpolation between the supplied vectors.

Parameters:
_v2bLeftLeft operand.
_v2bT0Left tangent.
_v2bRightRight operand.
_v2bT1Right tangent.
_fFracAmount by which to interpolate between the vectors.
Returns:
Returns the vector interpolated between _v2bLeft and _v2bRight by _fFrac.
template<typename _tType, typename _tInher>
LSVOID LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Invert ( ) [inline]

Negates each axis on this vector.

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

Calculates the length of the vector.

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

Calculates the squared length of the vector.

Returns:
Returns the squared length of the vector.
template<typename _tType, typename _tInher>
static CVector2Base<_tType, _tInher> LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Lerp ( const CVector2Base< _tType, _tInher > &  _v2bLeft,
const CVector2Base< _tType, _tInher > &  _v2bRight,
_tType  _fFrac 
) [inline, static]

Linearly interpolate between two vectors, returning the resulting vector.

Parameters:
_v2bLeftLeft operand.
_v2bRightRight operand.
_fFracAmount by which to interpolate between the vectors.
Returns:
Returns the vector interpolated between _v2bLeft and _v2bRight by _fFrac.
template<typename _tType, typename _tInher>
LSVOID LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
LSBOOL LSE_FCALL lsm::CVector2Base< _tType, _tInher >::operator!= ( const _tInher &  _v2bOther) const [inline]

Inequality.

Parameters:
_v2bOtherThe vector to check for inequality.
Returns:
Returns true if both vectors are not equal.
template<typename _tType, typename _tInher>
_tInher LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
_tType LSE_FCALL lsm::CVector2Base< _tType, _tInher >::operator* ( const _tInher &  _v2bOther) const [inline]

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

Parameters:
_v2bOtherThe vector against which the dot product is to be determined.
Returns:
Returns the dot product between the two vectors.
template<typename _tType, typename _tInher>
_tInher& LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
_tInher LSE_FCALL lsm::CVector2Base< _tType, _tInher >::operator+ ( const _tInher &  _v2bOther) const [inline]

Binary addition.

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

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

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

Unary -.

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

Binary subtraction.

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

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

Parameters:
_v2bOtherThe vector to subtract from this vector.
Returns:
Returns this vector, after the subtraction operation has been applied.
template<typename _tType, typename _tInher>
_tInher LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
_tInher& LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
_tInher& LSE_FCALL lsm::CVector2Base< _tType, _tInher >::operator= ( const _tInher &  _v2bOther) [inline]

Assignment.

Parameters:
_v2bOtherThe vector to copy.
Returns:
Returns the copied vector.
template<typename _tType, typename _tInher>
LSBOOL LSE_FCALL lsm::CVector2Base< _tType, _tInher >::operator== ( const _tInher &  _v2bOther) const [inline]

Equality.

Parameters:
_v2bOtherThe vector to check for equality.
Returns:
Returns true if both vectors are equal.
template<typename _tType, typename _tInher>
_tType LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
_tType& LSE_FCALL lsm::CVector2Base< _tType, _tInher >::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 _tInher>
LSVOID LSE_FCALL lsm::CVector2Base< _tType, _tInher >::Set ( _tType  _fX,
_tType  _fY 
) [inline]

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

Parameters:
_fXThe new X-axis value.
_fYThe new Y-axis value.

Member Data Documentation

template<typename _tType, typename _tInher>
_tType lsm::CVector2Base< _tType, _tInher >::x

The X value.

template<typename _tType, typename _tInher>
_tType lsm::CVector2Base< _tType, _tInher >::y

The Y value.


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