FMVector3 Class Reference
[Mathematics Classes.]

A 3 dimensional vector. More...

#include <FMVector3.h>

List of all members.

Public Member Functions

 FMVector3 ()
 Creates an empty FMVector3.
 FMVector3 (float _x, float _y, float _z)
 Creates the FMVector3 with the coordinates given.
 FMVector3 (const FMVector3 &rhs)
 Copy constuctor.
 FMVector3 (const FMVector4 &vect4)
 Constructor.
 FMVector3 (const float *source, uint32 startIndex=0)
 Creates the FMVector3 from a list of floating-point values.
 FMVector3 (const double *source, uint32 startIndex=0)
 See above.
float LengthSquared () const
 Retrieves the squared length of the vector.
float Length () const
 Retrieves the length of the vector.
void NormalizeIt ()
 Normalizes this vector.
FMVector3 Normalize () const
 Get a normalized FMVector3 with the same direction as this vector.
void Project (const FMVector3 &unto)
 Project this FMVector3 onto another FMVector3.
FMVector3 Projected (const FMVector3 &unto) const
 Get the projection of this FMVector3 onto another FMVector3.
 operator float * ()
 Get this FMVector3 as an array of floats.
 operator const float * () const
 Get this FMVector3 as an array of floats.
void Set (float x, float y, float z)
 Set the values of this vector.
FMVector3operator= (const float *v)
 Assign this FMVector3 to the given float array.
FMVector3operator= (const FMVector3 &rhs)
 Assigns the FMVector3 passed to outselves.
void ComponentMinimum (const FMVector3 &min)
 Update each component of this FMVector to the minimum of two FMVector3s.
float ComponentMinimum () const
 Retrieves the smallest component of the vector.
void ComponentMaximum (const FMVector3 &max)
 Update each component of this FMVector to the maximum of two FMVector3s.
float ComponentMaximum () const
 Retrieves the largest component of the vector.
void ComponentClamp (const FMVector3 &min, const FMVector3 &max)
 Clamp each component of this FMVector by the corresponding components in the specified min and max FMVector3.
float ComponentAverage () const
 Retrieves the average of the three vector components.

Public Attributes

float x
 The first coordinate.
float y
 The second coordinate.
float z
 The third coordinate.

Static Public Attributes

static const FMVector3 XAxis
 The FMVector3 representing the x axis.
static const FMVector3 YAxis
 The FMVector3 representing the y axis.
static const FMVector3 ZAxis
 The FMVector3 representing the z axis.
static const FMVector3 Origin
 The FMVector3 representing the origin.
static const FMVector3 Zero
 The FMVector3 containing all zeroes: (0,0,0).
static const FMVector3 One
 The FMVector3 containing all ones: (1,1,1).


Detailed Description

A 3 dimensional vector.

Simple, non-optimized vector class: * is the dot-product, ^ is the cross-product.


Constructor & Destructor Documentation

FMVector3::FMVector3 float  _x,
float  _y,
float  _z
[inline]
 

Creates the FMVector3 with the coordinates given.

Parameters:
_x The first coordinate.
_y The second coordinate.
_z The third coordinate.

FMVector3::FMVector3 const FMVector3 rhs  )  [inline]
 

Copy constuctor.

Parameters:
rhs A second 3D vector.

FMVector3::FMVector3 const FMVector4 vect4  ) 
 

Constructor.

Reduces the 4D vector into 3D by removing the 4th dimension.

Parameters:
vect4 A 4D vector.

FMVector3::FMVector3 const float *  source,
uint32  startIndex = 0
 

Creates the FMVector3 from a list of floating-point values.

It takes the first three floating-point starting from and including startIndex (0 indexing) in the array as the 3 coordinates. The first as the first coordinate, the second as the second, and the third as the third.

Parameters:
source The floating-point value array.
startIndex The index of the first element.


Member Function Documentation

float FMVector3::ComponentAverage  )  const [inline]
 

Retrieves the average of the three vector components.

Returns:
The component average.

void FMVector3::ComponentClamp const FMVector3 min,
const FMVector3 max
[inline]
 

Clamp each component of this FMVector by the corresponding components in the specified min and max FMVector3.

Clamp refers to setting a value within a given range. If the value is lower than the minimum of the range, it is set to the minimum; same for the maximum.

Parameters:
min The FMVector to take the minimum values from.
max The FMVector to take the maximum values from.

float FMVector3::ComponentMaximum  )  const [inline]
 

Retrieves the largest component of the vector.

Returns:
The largest component of the vector.

void FMVector3::ComponentMaximum const FMVector3 max  )  [inline]
 

Update each component of this FMVector to the maximum of two FMVector3s.

Updates each of the three components to be the maximum of the current value and that of the corresponding value of the given FMVector3.

Parameters:
max The FMVector to take values from.

float FMVector3::ComponentMinimum  )  const [inline]
 

Retrieves the smallest component of the vector.

Returns:
The smallest component of the vector.

void FMVector3::ComponentMinimum const FMVector3 min  )  [inline]
 

Update each component of this FMVector to the minimum of two FMVector3s.

Updates each of the three components to be the minimum of the current value and that of the corresponding value of the given FMVector3.

Parameters:
min The FMVector to take values from.

float FMVector3::Length  )  const [inline]
 

Retrieves the length of the vector.

Returns:
The length of this vector.

float FMVector3::LengthSquared  )  const [inline]
 

Retrieves the squared length of the vector.

Returns:
The squared length of this vector.

FMVector3 FMVector3::Normalize  )  const [inline]
 

Get a normalized FMVector3 with the same direction as this vector.

Returns:
A FMVector3 with length 1 and same direction as this vector.

FMVector3::operator const float *  )  const [inline]
 

Get this FMVector3 as an array of floats.

Returns:
The float array.

FMVector3::operator float *  )  [inline]
 

Get this FMVector3 as an array of floats.

Returns:
The float array.

FMVector3& FMVector3::operator= const FMVector3 rhs  )  [inline]
 

Assigns the FMVector3 passed to outselves.

Copies XYZ from the passed vector

Parameters:
rhs The vector copy off

FMVector3& FMVector3::operator= const float *  v  )  [inline]
 

Assign this FMVector3 to the given float array.

Assigns each coordinate of this FMVector3 to the elements in the float array. The first element to the first coordinate, the second to the second, and the third to the third. It returns this FMVector3.

Parameters:
v The float array to assign with.
Returns:
This vector.

void FMVector3::Project const FMVector3 unto  )  [inline]
 

Project this FMVector3 onto another FMVector3.

Parameters:
unto The FMVector3 to project onto.

FMVector3 FMVector3::Projected const FMVector3 unto  )  const [inline]
 

Get the projection of this FMVector3 onto another FMVector3.

Parameters:
unto The FMVector3 to project onto.
Returns:
The projected FMVector3.

void FMVector3::Set float  x,
float  y,
float  z
[inline]
 

Set the values of this vector.

Parameters:
x The new X value
y The new Y value
z The new Z value


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:40 2008 for FCollada by  doxygen 1.4.6-NO