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 float *source, uint32 startIndex=0)
 Creates the FMVector3 from a list of floats.
float LengthSquared () const
 Get the squared length.
float Length () const
 Retrieves the length of the vector.
void NormalizeIt ()
 Normalize this FMVector3.
FMVector3 Normalize () const
 Get a normalized FMVector3 with the same direction as this FMVector3.
void Project (const FMVector3 &unto)
 Project this FMVector3 onto another FMVector3.
FMVector3 Projected (const FMVector3 &unto)
 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.
FMVector3operator= (const float *v)
 Assign this FMVector3 to the given float array.
void ComponentMinimum (const FMVector3 &min)
 Update each component of this FMVector to the minimum of two FMVector3s.
void ComponentMaximum (const FMVector3 &max)
 Update each component of this FMVector to the maximum of two FMVector3s.
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.

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 Zero
 The FMVector3 representing zero.
static const FMVector3 Origin
 The FMVector3 representing the origin.


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 float *  source,
uint32  startIndex = 0
 

Creates the FMVector3 from a list of floats.

It takes the first 3 floats 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 float array.
startIndex The index of the first element.


Member Function Documentation

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.

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.

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 FMVector3.

float FMVector3::LengthSquared  )  const [inline]
 

Get the squared length.

Returns:
The squared length of this FMVector3.

FMVector3 FMVector3::Normalize  )  const [inline]
 

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

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

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 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 FMVector3.

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  )  [inline]
 

Get the projection of this FMVector3 onto another FMVector3.

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


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:44 2006 for FCollada by  doxygen 1.4.6-NO