Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Vector3C Class Reference

3D vector class. More...

#include <Vector3C.h>

List of all members.

Public Methods

 Vector3C (float32 f32X=0, float32 f32Y=0, float32 f32Z=0)
 Default constructor.

 Vector3C (const Vector3C &rVec)
 Copy constructor.

 Vector3C (float32 f32A[3])
 Creates a new vector with the values as the array pointed by the argument.

virtual ~Vector3C ()
 Default destructor.

float32operator[] (int32 i)
 Returns reference to the component pointed by the index.

const float32operator[] (int32 i) const
 Returns reference to the component pointed by the index.

Vector3C operator- () const
 Negated vector.

bool operator== (const Vector3C &rVec) const
 Returns true if both vectors are equal, else false.

bool operator!= (const Vector3C &rVec) const
 Returns true if both vectors are not equal, else false.

Vector3C & operator-= (const Vector3C &rVec)
 Substracts the vector specified by argument from the vector and stores the result.

Vector3C & operator+= (const Vector3C &rVec)
 Adds the vector specified by argument from the vector and stores the result.

Vector3C & operator *= (float32 f32S)
 Multiplies the vector by a scalar value specified by the argument and stores the result.

Vector3C & operator/= (float32 f32S)
 Divides the vector by a scalar value specified by the argument and stores the result.

Vector3C operator * (float32 f32S)
 Multiplies the vector by a scalar value specified by the argument and returns the result.

Vector3C operator/ (float32 f32S)
 Divides the vector by a scalar value specified by the argument and returns the result.

Vector3C operator- (const Vector3C &rVec) const
 Substracts the vector specified by argument from the vector and returns the result.

Vector3C operator+ (const Vector3C &rVec) const
 Adds the vector specified by argument from the vector and returns the result.

Vector3C operator * (const Vector3C &rVec) const
 Multiplies the vector specified by argument from the vector and returns the result.

Vector3C normalize () const
 Normalizes the vector to unit size and returns the result.

float32 length () const
 Returns the length of the vector.

float32 dot (const Vector3C &v) const
 Computes the dot product of the two vectors and returns the result.

Vector3C cross (const Vector3C &v) const
 Computes the cross product of the two vectors and returns the result.


Friends

Vector3C operator * (float32 f32S, const Vector3C &rVec)
 Multiplies the vector by a scalar value specified by the argument and returns the result.


Detailed Description

3D vector class.

Vector3C class defines a three dimensional vector class which is used by the Demopaja system. The vector class implements standard set of methods and overdriven opertators for easy use.

This class is implemented by the system.


Constructor & Destructor Documentation

Vector3C float32    f32X = 0,
float32    f32Y = 0,
float32    f32Z = 0
 

Default constructor.

Vector3C const Vector3C &    rVec
 

Copy constructor.

Vector3C float32    f32A[3]
 

Creates a new vector with the values as the array pointed by the argument.

virtual ~Vector3C   [virtual]
 

Default destructor.


Member Function Documentation

Vector3C cross const Vector3C &    v const
 

Computes the cross product of the two vectors and returns the result.

float32 dot const Vector3C &    v const [inline]
 

Computes the dot product of the two vectors and returns the result.

float32 length   const [inline]
 

Returns the length of the vector.

Vector3C normalize   const
 

Normalizes the vector to unit size and returns the result.

Vector3C operator * const Vector3C &    rVec const [inline]
 

Multiplies the vector specified by argument from the vector and returns the result.

The multiplication is done component vise (that is, each corresponding component is multiplied).

Vector3C operator * float32    f32S [inline]
 

Multiplies the vector by a scalar value specified by the argument and returns the result.

Vector3C & operator *= float32    f32S [inline]
 

Multiplies the vector by a scalar value specified by the argument and stores the result.

bool operator!= const Vector3C &    rVec const
 

Returns true if both vectors are not equal, else false.

Vector3C operator+ const Vector3C &    rVec const [inline]
 

Adds the vector specified by argument from the vector and returns the result.

Vector3C & operator+= const Vector3C &    rVec [inline]
 

Adds the vector specified by argument from the vector and stores the result.

Vector3C operator- const Vector3C &    rVec const [inline]
 

Substracts the vector specified by argument from the vector and returns the result.

Vector3C operator-   const [inline]
 

Negated vector.

Vector3C & operator-= const Vector3C &    rVec [inline]
 

Substracts the vector specified by argument from the vector and stores the result.

Vector3C operator/ float32    f32S [inline]
 

Divides the vector by a scalar value specified by the argument and returns the result.

Vector3C & operator/= float32    f32S [inline]
 

Divides the vector by a scalar value specified by the argument and stores the result.

bool operator== const Vector3C &    rVec const
 

Returns true if both vectors are equal, else false.

const float32 & operator[] int32    i const [inline]
 

Returns reference to the component pointed by the index.

The index values from 0 to 2 corresponds to components X, Y, and Z respectively. There are two versions of this method, this version is for retrieving the values.

float32 & operator[] int32    i [inline]
 

Returns reference to the component pointed by the index.

The index values from 0 to 2 corresponds to components X, Y, and Z respectively. There are two versions of this method, this version is to assign values.


Friends And Related Function Documentation

Vector3C operator * float32    s,
const Vector3C &    v
[friend]
 

Multiplies the vector by a scalar value specified by the argument and returns the result.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions