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

aeVector4 Class Reference

A 4D vector. More...

#include <vector4.h>

List of all members.

Public Member Functions

 aeVector4 ()
 Create a new uninitialized vector.

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

 aeVector4 (const aeVector4 &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.

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

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

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

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

aeVector4 operator+ () const
 Unary +.

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

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

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

void cross (const aeVector4 &v1, const aeVector4 &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.

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

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

float w
 The W component of the vector.


Friends

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

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

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

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

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

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

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

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

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

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

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

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


Detailed Description

A 4D vector.

Definition at line 33 of file vector4.h.


Constructor & Destructor Documentation

aeVector4::aeVector4   [inline]
 

Create a new uninitialized vector.

Definition at line 39 of file vector4.h.

Referenced by operator-().

aeVector4::aeVector4 float    nx,
float    ny,
float    nz,
float    nw
[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.
z The vector's W component.

Definition at line 49 of file vector4.h.

References w, x, y, and z.

aeVector4::aeVector4 const aeVector4 &    v [inline]
 

Create a new vector and initialize it to another vector.

Parameters:
v Vector to initialize this one to.

Definition at line 57 of file vector4.h.

References w, x, y, and z.


Member Function Documentation

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

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

Parameters:
v1 Vector1.
v2 Vector2.

float aeVector4::magnitude   const
 

Get the magnitude (lenght) of this vector.

Returns:
The vector's magnitude.

aeVector4 aeVector4::normalize   const
 

Normalize this vector.

Returns:
The normalized vector.

Referenced by unit().

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

Multiply by scalar float.

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

Definition at line 278 of file vector4.h.

aeVector4 aeVector4::operator+   const [inline]
 

Unary +.

Returns:
This vector.

Definition at line 308 of file vector4.h.

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

Add another vector to this vector.

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

Definition at line 248 of file vector4.h.

aeVector4 aeVector4::operator-   const [inline]
 

Unary - (negate this vector).

Returns:
This vector negated.

Definition at line 316 of file vector4.h.

References aeVector4().

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

Subtract another vector from this vector.

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

Definition at line 263 of file vector4.h.

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

Divide by scalar float.

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

Definition at line 293 of file vector4.h.

float& aeVector4::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 239 of file vector4.h.

float aeVector4::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 230 of file vector4.h.

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

Set this vector to another vector.

Parameters:
v Vector to set this vector to.

Definition at line 338 of file vector4.h.

void aeVector4::set float    nx,
float    ny,
float    nz,
float    nw
[inline]
 

Set this vector to given x, y, z, w.

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.
nw The value to set the w component of this vector to.

Definition at line 326 of file vector4.h.

aeVector4 aeVector4::unit   const [inline]
 

Get the unit vector of this vector.

This is essentialy the same as Normalize().

See also:
aeVector4::Normalize()
Returns:

Definition at line 368 of file vector4.h.

References normalize().


Friends And Related Function Documentation

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

Multiply by scalar integer.

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

Definition at line 170 of file vector4.h.

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

Multiply by scalar integer.

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

Definition at line 158 of file vector4.h.

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

Multiply by scalar float.

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

Definition at line 146 of file vector4.h.

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

Multiply by scalar float.

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

Definition at line 134 of file vector4.h.

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

Dot product of two vectors.

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

Definition at line 103 of file vector4.h.

bool operator!= const aeVector4 &    v1,
const aeVector4 &    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 219 of file vector4.h.

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

Cross product of two vectors.

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

Definition at line 115 of file vector4.h.

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

Add two vectors.

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

Definition at line 79 of file vector4.h.

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

Subtract two vectors.

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

Definition at line 91 of file vector4.h.

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

Divide by scalar integer.

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

Definition at line 195 of file vector4.h.

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

Divide by scalar float.

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

Definition at line 182 of file vector4.h.

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

Check if two vectors are equal.

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

Definition at line 207 of file vector4.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.