Public Member Functions | Static Public Member Functions | Public Attributes

sp::dim::vector3d< T > Class Template Reference

#include <spDimensionVector3D.hpp>

Inheritance diagram for sp::dim::vector3d< T >:
sp::dim::vector4d< T >

List of all members.

Public Member Functions

 vector3d ()
 vector3d (const T &Size)
 vector3d (const T &VecX, const T &VecY, const T &VecZ)
 vector3d (const T &VecX, const T &VecY, const T &VecZ, const T &VecW)
 vector3d (const vector3d< T > &Other)
 vector3d (const vector4d< T > &Other)
 vector3d (const point2d< T > &Other)
 vector3d (const size2d< T > &Other)
 ~vector3d ()
bool operator== (const vector3d< T > &other) const
bool operator!= (const vector3d< T > &other) const
bool operator<= (const vector3d< T > &other) const
bool operator>= (const vector3d< T > &other) const
bool operator< (const vector3d< T > &other) const
bool operator> (const vector3d< T > &other) const
vector3d< T > & operator++ ()
 Pre-increment operator.
vector3d< T > & operator++ (int)
 Post-increment operator.
vector3d< T > & operator-- ()
 Pre-decrement operator.
vector3d< T > & operator-- (int)
 Post-decrement operator.
vector3d< T > operator+ (const vector3d< T > &other) const
vector3d< T > & operator+= (const vector3d< T > &other)
vector3d< T > operator- (const vector3d< T > &other) const
vector3d< T > & operator-= (const vector3d< T > &other)
vector3d< T > operator/ (const vector3d< T > &other) const
vector3d< T > & operator/= (const vector3d< T > &other)
vector3d< T > operator* (const vector3d< T > &other) const
vector3d< T > & operator*= (const vector3d< T > &other)
vector3d< T > operator* (const T &Size) const
vector3d< T > & operator*= (const T &Size)
vector3d< T > operator/ (const T &Size) const
vector3d< T > & operator/= (const T &Size)
vector3d< T > operator- () const
const T operator[] (u32 i) const
T & operator[] (u32 i)
dot (const vector3d< T > &other) const
 Returns the dot (or rather scalar) product between this and the given vector.
vector3d< T > cross (const vector3d< T > &other) const
 Returns the cross (or rather vector) product between this and the given vector.
getLength () const
 Returns the vector's length.
getLengthSq () const
 Returns the square of the vector's length (Can be used for faster comparision between two distances).
getAngle (const vector3d< T > &other) const
 Returns the angle (in degrees) between this and the given vector.
vector3d< T > & setInvert ()
vector3d< T > getInvert () const
vector3d< T > & setRound (s32 Precision)
vector3d< T > getRound (s32 Precision) const
bool equal (const vector3d< T > &other, f32 Tolerance=math::ROUNDING_ERROR) const
bool empty () const
void make2DProjection (s32 ScreenWidth, s32 ScreenHeight)
void make2DProjection (f32 FOV, s32 ScreenWidth, s32 ScreenHeight)
vector3d< T > & setAbs ()
vector3d< T > getAbs () const
vector3d< T > & normalize ()
vector3d< T > & sign ()
vector3d< T > & setLength (const T &Length)
getDistanceFromSq (const vector3d< T > &other) const
bool isBetweenPoints (const vector3d< T > &Begin, const vector3d< T > &End) const
bool isPointInsideSphere (const vector3d< T > &Center, const f32 Radius) const
vector3d< T > getInterpolatedQuadratic (const vector3d< T > &v2, const vector3d< T > &v3, const T d) const
vector3d< T > getRotatedAxis (const T &Angle, vector3d< T > Axis) const
EAxisTypes getAxisType () const
 Returns the direction type of the dominant axis.
vector3d< T > getNormal () const
 Returns a normal vector to this vector.
getMin () const
 Returns the smalest vector component.
getMax () const
 Returns the greatest vector component.
getVolume () const
 Returns the volume of the bounding box clamped by this vector (X*Y*Z).
vector3d< T > getCoord () const
template<typename B >
vector3d< B > cast () const

Static Public Member Functions

static bool isPointOnSameSide (const vector3d< T > &P1, const vector3d< T > &P2, const vector3d< T > &A, const vector3d< T > &B)

Public Attributes

X
Y
Z

Detailed Description

template<typename T>
class sp::dim::vector3d< T >

Vector 3D class which has the three components X, Y and Z. This is the main class used for 3D scene directions, positions, scaling etc.


Constructor & Destructor Documentation

template<typename T>
sp::dim::vector3d< T >::vector3d (  )  [inline]
template<typename T>
sp::dim::vector3d< T >::vector3d ( const T &  Size  )  [inline]
template<typename T>
sp::dim::vector3d< T >::vector3d ( const T &  VecX,
const T &  VecY,
const T &  VecZ 
) [inline]
template<typename T>
sp::dim::vector3d< T >::vector3d ( const T &  VecX,
const T &  VecY,
const T &  VecZ,
const T &  VecW 
) [inline]
template<typename T>
sp::dim::vector3d< T >::vector3d ( const vector3d< T > &  Other  )  [inline]
template<typename T>
sp::dim::vector3d< T >::vector3d ( const vector4d< T > &  Other  ) 
template<typename T>
sp::dim::vector3d< T >::vector3d ( const point2d< T > &  Other  ) 
template<typename T>
sp::dim::vector3d< T >::vector3d ( const size2d< T > &  Other  ) 
template<typename T>
sp::dim::vector3d< T >::~vector3d (  )  [inline]

Member Function Documentation

template<typename T>
template<typename B >
vector3d<B> sp::dim::vector3d< T >::cast (  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::cross ( const vector3d< T > &  other  )  const [inline]

Returns the cross (or rather vector) product between this and the given vector.

template<typename T>
T sp::dim::vector3d< T >::dot ( const vector3d< T > &  other  )  const [inline]

Returns the dot (or rather scalar) product between this and the given vector.

template<typename T>
bool sp::dim::vector3d< T >::empty (  )  const [inline]
template<typename T>
bool sp::dim::vector3d< T >::equal ( const vector3d< T > &  other,
f32  Tolerance = math::ROUNDING_ERROR 
) const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::getAbs (  )  const [inline]
template<typename T>
T sp::dim::vector3d< T >::getAngle ( const vector3d< T > &  other  )  const [inline]

Returns the angle (in degrees) between this and the given vector.

template<typename T>
EAxisTypes sp::dim::vector3d< T >::getAxisType (  )  const [inline]

Returns the direction type of the dominant axis.

template<typename T>
vector3d<T> sp::dim::vector3d< T >::getCoord (  )  const [inline]

Just returns this vector. This is only required that this call can be used for several templates. Write your own vertex class for example and add this function so that it can be used for polygon clipping as well. Some templates expect a class with this function (e.g. 'mathCollisionLibrary::clipPolygon').

See also:
CollisionLibrary::clipPolygon
template<typename T>
T sp::dim::vector3d< T >::getDistanceFromSq ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::getInterpolatedQuadratic ( const vector3d< T > &  v2,
const vector3d< T > &  v3,
const T  d 
) const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::getInvert (  )  const [inline]
template<typename T>
T sp::dim::vector3d< T >::getLength (  )  const [inline]

Returns the vector's length.

template<typename T>
T sp::dim::vector3d< T >::getLengthSq (  )  const [inline]

Returns the square of the vector's length (Can be used for faster comparision between two distances).

template<typename T>
T sp::dim::vector3d< T >::getMax (  )  const [inline]

Returns the greatest vector component.

template<typename T>
T sp::dim::vector3d< T >::getMin (  )  const [inline]

Returns the smalest vector component.

template<typename T>
vector3d<T> sp::dim::vector3d< T >::getNormal (  )  const [inline]

Returns a normal vector to this vector.

template<typename T>
vector3d<T> sp::dim::vector3d< T >::getRotatedAxis ( const T &  Angle,
vector3d< T >  Axis 
) const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::getRound ( s32  Precision  )  const [inline]
template<typename T>
T sp::dim::vector3d< T >::getVolume (  )  const [inline]

Returns the volume of the bounding box clamped by this vector (X*Y*Z).

template<typename T>
bool sp::dim::vector3d< T >::isBetweenPoints ( const vector3d< T > &  Begin,
const vector3d< T > &  End 
) const [inline]
template<typename T>
bool sp::dim::vector3d< T >::isPointInsideSphere ( const vector3d< T > &  Center,
const f32  Radius 
) const [inline]
template<typename T>
static bool sp::dim::vector3d< T >::isPointOnSameSide ( const vector3d< T > &  P1,
const vector3d< T > &  P2,
const vector3d< T > &  A,
const vector3d< T > &  B 
) [inline, static]
template<typename T>
void sp::dim::vector3d< T >::make2DProjection ( s32  ScreenWidth,
s32  ScreenHeight 
) [inline]
template<typename T>
void sp::dim::vector3d< T >::make2DProjection ( f32  FOV,
s32  ScreenWidth,
s32  ScreenHeight 
) [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::normalize (  )  [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator!= ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator* ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator* ( const T &  Size  )  const [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator*= ( const vector3d< T > &  other  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator*= ( const T &  Size  )  [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator+ ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator++ (  )  [inline]

Pre-increment operator.

template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator++ ( int   )  [inline]

Post-increment operator.

template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator+= ( const vector3d< T > &  other  )  [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator- ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator- (  )  const [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator-- (  )  [inline]

Pre-decrement operator.

template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator-- ( int   )  [inline]

Post-decrement operator.

template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator-= ( const vector3d< T > &  other  )  [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator/ ( const T &  Size  )  const [inline]
template<typename T>
vector3d<T> sp::dim::vector3d< T >::operator/ ( const vector3d< T > &  other  )  const [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator/= ( const vector3d< T > &  other  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::operator/= ( const T &  Size  )  [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator< ( const vector3d< T > &  other  )  const [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator<= ( const vector3d< T > &  other  )  const [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator== ( const vector3d< T > &  other  )  const [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator> ( const vector3d< T > &  other  )  const [inline]
template<typename T>
bool sp::dim::vector3d< T >::operator>= ( const vector3d< T > &  other  )  const [inline]
template<typename T>
T& sp::dim::vector3d< T >::operator[] ( u32  i  )  [inline]
template<typename T>
const T sp::dim::vector3d< T >::operator[] ( u32  i  )  const [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::setAbs (  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::setInvert (  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::setLength ( const T &  Length  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::setRound ( s32  Precision  )  [inline]
template<typename T>
vector3d<T>& sp::dim::vector3d< T >::sign (  )  [inline]

Member Data Documentation

template<typename T>
T sp::dim::vector3d< T >::X
template<typename T>
T sp::dim::vector3d< T >::Y
template<typename T>
T sp::dim::vector3d< T >::Z

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines