[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

aeVector3 Class Reference

A 3D vector. More...

#include <vector3.h>

List of all members.

Public Member Functions

 aeVector3 ()
 Create a new uninitialized vector.

 aeVector3 (float nx, float ny, float nz)
 Create a new vector and initialize it to given values.

 aeVector3 (const aeVector3 &v)
 Create a new vector and initialize it to another vector.

float operator[] (int n) const
 Return the Nth component of the vector.

float & operator[] (int n)
 Return the Nth component of the vector.

aeVector3 & operator+= (const aeVector3 &v1)
 Add another vector to this vector.

aeVector3 & operator-= (const aeVector3 &v1)
 Subtract another vector from this vector.

aeVector3 & operator *= (float s)
 Multiply by scalar float.

aeVector3 & operator/= (float s)
 Divide by scalar float.

aeVector3 operator+ () const
 Unary +.

aeVector3 operator- () const
 Unary - (negate this vector).

void set (float nx, float ny, float nz)
 Set this vector to given x, y, z.

void set (const aeVector3 &v)
 Set this vector to another vector.

void cross (const aeVector3 &v1, const aeVector3 &v2)
 Get the cross product of two vectors and store the result in this vector.

float magnitude () const
 Get the magnitude (lenght) of this vector.

aeVector3 unit () const
 Get the unit vector of this vector.

aeVector3 normalize () const
 Normalize this vector.


Public Attributes

float x
 The X component of the vector.

float y
 The Y component of the vector.

float z
 The Z component of the vector.


Friends

aeVector3 operator+ (const aeVector3 &v1, const aeVector3 &v2)
 Add two vectors.

aeVector3 operator- (const aeVector3 &v1, const aeVector3 &v2)
 Subtract two vectors.

float operator * (const aeVector3 &v1, const aeVector3 &v2)
 Dot product of two vectors.

aeVector3 operator% (const aeVector3 &v1, const aeVector3 &v2)
 Cross product of two vectors.

aeVector3 operator * (const aeVector3 &v1, float s)
 Multiply by scalar float.

aeVector3 operator * (float s, const aeVector3 &v1)
 Multiply by scalar float.

aeVector3 operator * (int s, const aeVector3 &v1)
 Multiply by scalar integer.

aeVector3 operator/ (const aeVector3 &v1, float s)
 Divide by scalar float.

aeVector3 operator/ (const aeVector3 &v1, int s)
 Divide by scalar integer.

bool operator== (const aeVector3 &v1, const aeVector3 &v2)
 Check if two vectors are equal.

bool operator!= (const aeVector3 &v1, const aeVector3 &v2)
 Check if two vectors are not equal.


Detailed Description

A 3D vector.

Definition at line 33 of file vector3.h.


Constructor & Destructor Documentation

aeVector3::aeVector3   [inline]
 

Create a new uninitialized vector.

Definition at line 39 of file vector3.h.

Referenced by operator-().

aeVector3::aeVector3 float    nx,
float    ny,
float    nz
[inline]
 

Create a new vector and initialize it to given values.

Parameters:
x The vector's X component.
y The vector's Y component.
z The vector's Z component.

Definition at line 48 of file vector3.h.

References x, y, and z.

aeVector3::aeVector3 const aeVector3 &    v [inline]
 

Create a new vector and initialize it to another vector.

Parameters:
v Vector to initialize this one to.

Definition at line 56 of file vector3.h.

References x, y, and z.


Member Function Documentation

void aeVector3::cross const aeVector3 &    v1,
const aeVector3 &    v2
 

Get the cross product of two vectors and store the result in this vector.

Parameters:
v1 Vector1.
v2 Vector2.

float aeVector3::magnitude   const
 

Get the magnitude (lenght) of this vector.

Returns:
The vector's magnitude.

aeVector3 aeVector3::normalize   const
 

Normalize this vector.

Returns:
The normalized vector.

Referenced by unit().

aeVector3& aeVector3::operator *= float    s [inline]
 

Multiply by scalar float.

Parameters:
s Scalar float
Returns:
This vector * scalar float.

Definition at line 256 of file vector3.h.

aeVector3 aeVector3::operator+   const [inline]
 

Unary +.

Returns:
This vector.

Definition at line 284 of file vector3.h.

aeVector3& aeVector3::operator+= const aeVector3 &    v1 [inline]
 

Add another vector to this vector.

Parameters:
v1 Vector to add.
Returns:
This vector + another vector.

Definition at line 228 of file vector3.h.

aeVector3 aeVector3::operator-   const [inline]
 

Unary - (negate this vector).

Returns:
This vector negated.

Definition at line 292 of file vector3.h.

References aeVector3().

aeVector3& aeVector3::operator-= const aeVector3 &    v1 [inline]
 

Subtract another vector from this vector.

Parameters:
v1 Vector to subtract.
Returns:
This vector / another vector.

Definition at line 242 of file vector3.h.

aeVector3& aeVector3::operator/= float    s [inline]
 

Divide by scalar float.

Parameters:
s Scalar float.
Returns:
This vector / scalar float.

Definition at line 270 of file vector3.h.

float& aeVector3::operator[] int    n [inline]
 

Return the Nth component of the vector.

Parameters:
n The component.
Returns:
The Nth component of the vector.

Definition at line 219 of file vector3.h.

float aeVector3::operator[] int    n const [inline]
 

Return the Nth component of the vector.

Parameters:
n The component.
Returns:
The Nth component of the vector.

Definition at line 210 of file vector3.h.

void aeVector3::set const aeVector3 &    v [inline]
 

Set this vector to another vector.

Parameters:
v Vector to set this vector to.

Definition at line 312 of file vector3.h.

void aeVector3::set float    nx,
float    ny,
float    nz
[inline]
 

Set this vector to given x, y, z.

Parameters:
nx The value to set the x component of this vector to.
ny The value to set the y component of this vector to.
nz The value to set the z component of this vector to.

Definition at line 301 of file vector3.h.

aeVector3 aeVector3::unit   const [inline]
 

Get the unit vector of this vector.

This is essentialy the same as Normalize().

See also:
aeVector3::Normalize()
Returns:

Definition at line 341 of file vector3.h.

References normalize().


Friends And Related Function Documentation

aeVector3 operator * int    s,
const aeVector3 &    v1
[friend]
 

Multiply by scalar integer.

Parameters:
s Scalar integer.
v1 Vector.
Returns:
Scalar integer * vector

Definition at line 150 of file vector3.h.

aeVector3 operator * float    s,
const aeVector3 &    v1
[friend]
 

Multiply by scalar float.

Parameters:
s Scalar float.
v1 Vector.
Returns:
Scalar float * vector.

Definition at line 138 of file vector3.h.

aeVector3 operator * const aeVector3 &    v1,
float    s
[friend]
 

Multiply by scalar float.

Parameters:
v1 Vector.
s Scalar float.
Returns:
Vector * scalar float.

Definition at line 126 of file vector3.h.

float operator * const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Dot product of two vectors.

Parameters:
v1 Vector1.
v2 Vector2.
Returns:
Vector1 . Vector2.

Definition at line 100 of file vector3.h.

bool operator!= const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Check if two vectors are not equal.

Parameters:
v1 Vector1
v2 Vector2
Returns:
True if Vector1 != Vector2, false if not.

Definition at line 199 of file vector3.h.

aeVector3 operator% const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Cross product of two vectors.

Parameters:
v1 Vector1.
v2 Vector2.
Returns:
Vector1 X Vector2.

Definition at line 112 of file vector3.h.

aeVector3 operator+ const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Add two vectors.

Parameters:
v1 Vector1.
v2 Vector2.
Returns:
Vector1 + Vector2.

Definition at line 76 of file vector3.h.

aeVector3 operator- const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Subtract two vectors.

Parameters:
v1 Vector1.
v2 Vector2.
Returns:
Vector1 - Vector2.

Definition at line 88 of file vector3.h.

aeVector3 operator/ const aeVector3 &    v1,
int    s
[friend]
 

Divide by scalar integer.

Parameters:
v1 Vector.
s Scalar integer.
Returns:
Vector / scalar integer.

Definition at line 175 of file vector3.h.

aeVector3 operator/ const aeVector3 &    v1,
float    s
[friend]
 

Divide by scalar float.

Parameters:
v1 Vector.
s Scalar float.
Returns:
Vector / scalar float.

Definition at line 162 of file vector3.h.

bool operator== const aeVector3 &    v1,
const aeVector3 &    v2
[friend]
 

Check if two vectors are equal.

Parameters:
v1 Vector1
v2 Vector1
Returns:
True if Vector1 == Vector2, false if not.

Definition at line 187 of file vector3.h.


The documentation for this class was generated from the following file:
AE Engine Public API Reference
Generated on Wed Apr 9 09:43:41 2003 by Doxygen.