Base Class Reference

#include <math.h>

Class Description

Represents a local coordinate basis comprising three axes that define a coordinate system.

The axes don't have to be normalized or orthogonal, but no pair of them should be parallel.

Definition at line 1044 of file math.h.

Public Member Functions

 Base (void)
 Creates a empty base with no valid axises. More...
 
 Base (const Vector &vA, const Vector &vB, const Vector &vC)
 Creates a base with the three specified vector axes. More...
 
bool operator!= (const Base &o) const
 Returns true if the two base objects are different. More...
 
void Derive (unsigned int iIndex, bool bRightHand=true)
 Derives one axis from the two others. (The new axis will be orthagonal to the other two) More...
 
void Orthogonalize (unsigned int iIndex, unsigned int iSource=(unsigned int)-1 )
 Force one basis axis to be orthagonal to another (or both other) basis axes. More...
 
void Normalize (void)
 Normalize all the three axes. More...
 
Vector TransformFrom (const Vector &cSource) const
 Converts a point (represented as a vector) from basis space to world space and returns it. More...
 
Vector TransformTo (const Vector &cSource) const
 Converts a point (represented as a vector) from world space to this basis space and returns it. More...
 
Base operator* (float fFactor) const
 Multiplies the base vectors with a scalar value and returns the result. More...
 
Base operator+ (const Base &bOther) const
 Adds two bases. More...
 
Base operator- (const Base &bOther) const
 Substracts two bases. More...
 
VectorAxis (unsigned int iIndex)
 Returns a reference to a basis axis. More...
 
const VectorAxis (unsigned int iIndex) const
 Returns a reference to a basis axis. More...
 

Public Attributes

Vector a
 
Vector b
 
Vector c
 

Constructor & Destructor Documentation

Base ( void  )

Creates a empty base with no valid axises.

Base ( const Vector vA,
const Vector vB,
const Vector vC 
)

Creates a base with the three specified vector axes.

Member Function Documentation

bool operator!= ( const Base o) const
inline

Returns true if the two base objects are different.

Definition at line 1055 of file math.h.

1055 { return a != o.a || b != o.b || c != o.c; };
GLubyte GLubyte b
Definition: GLee.h:5404
const GLubyte * c
Definition: GLee.h:5419
GLubyte GLubyte GLubyte a
Definition: GLee.h:5404
void Derive ( unsigned int  iIndex,
bool  bRightHand = true 
)

Derives one axis from the two others. (The new axis will be orthagonal to the other two)

Parameters
[in]iIndexThe axis to be recalculated. 0 for x, 1 for y, and 2 for z
[in]bRightHandIf true, make this a right-handed coordinate system
void Orthogonalize ( unsigned int  iIndex,
unsigned int  iSource = (unsigned int)-1 
)

Force one basis axis to be orthagonal to another (or both other) basis axes.

Parameters
[in]iIndexSpecifies which axis to orthogonalize. 0 for x, 1 for y, and 2 for z.
[in]iSourceSpecifies which axis to use as a reference. 0 for x, 1 for y, and 2 for z – and -1 means "use both other axes"
void Normalize ( void  )
inline

Normalize all the three axes.

Definition at line 1073 of file math.h.

1073 { a.Normalize(); b.Normalize(); c.Normalize(); };
GLubyte GLubyte b
Definition: GLee.h:5404
const GLubyte * c
Definition: GLee.h:5419
GLubyte GLubyte GLubyte a
Definition: GLee.h:5404
Vector TransformFrom ( const Vector cSource) const

Converts a point (represented as a vector) from basis space to world space and returns it.

Vector TransformTo ( const Vector cSource) const

Converts a point (represented as a vector) from world space to this basis space and returns it.

Base operator* ( float  fFactor) const

Multiplies the base vectors with a scalar value and returns the result.

Base operator+ ( const Base bOther) const

Adds two bases.

Base operator- ( const Base bOther) const

Substracts two bases.

Vector& Axis ( unsigned int  iIndex)

Returns a reference to a basis axis.

Parameters
[in]iIndex0 for x; 1 for y; 2 for z
const Vector& Axis ( unsigned int  iIndex) const

Returns a reference to a basis axis.

Parameters
[in]iIndex0 for x; 1 for y; 2 for z

Member Data Documentation

Definition at line 1102 of file math.h.

Definition at line 1102 of file math.h.

Definition at line 1102 of file math.h.


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