Axiom::MathLib::Vector3 Struct Reference

Standard 3-dimensional vector. More...

List of all members.

Public Member Functions

 Vector3 (float x, float y, float z)
 Creates a new 3 dimensional Vector.
float Dot (Vector3 vector)
 Performs a Dot Product operation on 2 vectors, which produces the angle between them.
Vector3 Cross (Vector3 vector)
 Performs a Cross Product operation on 2 vectors, which returns a vector that is perpendicular to the intersection of the 2 vectors. Useful for finding face normals.
Vector3 Perpendicular ()
 Finds a vector perpendicular to this one.
Vector3 ToNormalized ()
 Finds the midpoint between the supplied Vector and this vector.

Compares the supplied vector and updates it's x/y/z components of they are higher in value.

Compares the supplied vector and updates it's x/y/z components of they are lower in value.

float Normalize ()
 Normalizes the vector.
Vector3 Reflect (Vector3 normal)
 Calculates a reflection vector to the plane with the given normal.
override string ToString ()
 Overrides the Object.ToString() method to provide a text representation of a Vector3.
string ToIntegerString ()
 Overrides the Object.ToString() method to provide a text representation of a Vector3.
string ToString (bool shortenDecmialPlaces)
 Overrides the Object.ToString() method to provide a text representation of a Vector3.
override int GetHashCode ()
 Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class.

The standard implementation is a simple XOR operation between all local member variables.

override bool Equals (object obj)
 Compares this Vector to another object. This should be done because the equality operators (==, !=) have been overriden by this class.

Static Public Member Functions

static bool operator== (Vector3 left, Vector3 right)
 User to compare two Vector3 instances for equality.
static bool operator!= (Vector3 left, Vector3 right)
 User to compare two Vector3 instances for inequality.
static Vector3 Multiply (Vector3 left, Vector3 right)
 Used when a Vector3 is multiplied by another vector.
static Vector3 operator * (Vector3 left, Vector3 right)
 Used when a Vector3 is multiplied by another vector.
static Vector3 Divide (Vector3 left, float scalar)
 Used to divide a vector by a scalar value.
static Vector3 operator/ (Vector3 left, Vector3 right)
 Used when a Vector3 is divided by another vector.
static Vector3 Divide (Vector3 left, Vector3 right)
 Used when a Vector3 is divided by another vector.
static Vector3 operator/ (Vector3 left, float scalar)
 Used to divide a vector by a scalar value.
static Vector3 Add (Vector3 left, Vector3 right)
 Used when a Vector3 is added to another Vector3.
static Vector3 operator+ (Vector3 left, Vector3 right)
 Used when a Vector3 is added to another Vector3.
static Vector3 Multiply (Vector3 left, float scalar)
 Used when a Vector3 is multiplied by a scalar value.
static Vector3 operator * (Vector3 left, float scalar)
 Used when a Vector3 is multiplied by a scalar value.
static Vector3 Multiply (float scalar, Vector3 right)
 Used when a scalar value is multiplied by a Vector3.
static Vector3 operator * (float scalar, Vector3 right)
 Used when a scalar value is multiplied by a Vector3.
static Vector3 Subtract (Vector3 left, Vector3 right)
 Used to subtract a Vector3 from another Vector3.
static Vector3 operator- (Vector3 left, Vector3 right)
 Used to subtract a Vector3 from another Vector3.
static Vector3 Negate (Vector3 left)
 Used to negate the elements of a vector.
static Vector3 operator- (Vector3 left)
 Used to negate the elements of a vector.
static bool operator> (Vector3 left, Vector3 right)
 Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
static bool operator< (Vector3 left, Vector3 right)
 Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.

Public Attributes

float x
 X component.
float y
 Y component.
float z
 Z component.

Properties

float Length
 Gets the length (magnitude) of this Vector3. The Sqrt operation is expensive, so only use this if you need the exact length of the Vector. If vector lengths are only going to be compared, use LengthSquared instead.
float LengthSquared
 Returns the length (magnitude) of the vector squared.
static Vector3 Zero
 Gets a Vector3 with all components set to 0.
static Vector3 UnitScale
 Gets a Vector3 with all components set to 1.
static Vector3 UnitX
 Gets a Vector3 with the X set to 1, and the others set to 0.
static Vector3 UnitY
 Gets a Vector3 with the Y set to 1, and the others set to 0.
static Vector3 UnitZ
 Gets a Vector3 with the Z set to 1, and the others set to 0.
static Vector3 NegativeUnitX
 Gets a Vector3 with the X set to -1, and the others set to 0.
static Vector3 NegativeUnitY
 Gets a Vector3 with the Y set to -1, and the others set to 0.
static Vector3 NegativeUnitZ
 Gets a Vector3 with the Z set to -1, and the others set to 0.


Detailed Description

Standard 3-dimensional vector.

A direction in 3D space represented as distances along the 3 orthoganal axes (x, y, z). Note that positions, directions and scaling factors can be represented by a vector, depending on how you interpret the values.


Member Function Documentation

static Vector3 Axiom::MathLib::Vector3::Add Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is added to another Vector3.

Parameters:
left 
right 
Returns:

Vector3 Axiom::MathLib::Vector3::Cross Vector3  vector  )  [inline]
 

Performs a Cross Product operation on 2 vectors, which returns a vector that is perpendicular to the intersection of the 2 vectors. Useful for finding face normals.

Parameters:
vector A vector to perform the Cross Product against.
Returns:
A new Vector3 perpedicular to the 2 original vectors.

static Vector3 Axiom::MathLib::Vector3::Divide Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is divided by another vector.

Parameters:
left 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::Divide Vector3  left,
float  scalar
[inline, static]
 

Used to divide a vector by a scalar value.

Parameters:
left 
scalar 
Returns:

float Axiom::MathLib::Vector3::Dot Vector3  vector  )  [inline]
 

Performs a Dot Product operation on 2 vectors, which produces the angle between them.

Parameters:
vector The vector to perform the Dot Product against.
Returns:
The angle between the 2 vectors.

override bool Axiom::MathLib::Vector3::Equals object  obj  )  [inline]
 

Compares this Vector to another object. This should be done because the equality operators (==, !=) have been overriden by this class.

Parameters:
obj 
Returns:

override int Axiom::MathLib::Vector3::GetHashCode  )  [inline]
 

Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class.

The standard implementation is a simple XOR operation between all local member variables.

Returns:

static Vector3 Axiom::MathLib::Vector3::Multiply float  scalar,
Vector3  right
[inline, static]
 

Used when a scalar value is multiplied by a Vector3.

Parameters:
scalar 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::Multiply Vector3  left,
float  scalar
[inline, static]
 

Used when a Vector3 is multiplied by a scalar value.

Parameters:
left 
scalar 
Returns:

static Vector3 Axiom::MathLib::Vector3::Multiply Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is multiplied by another vector.

Parameters:
left 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::Negate Vector3  left  )  [inline, static]
 

Used to negate the elements of a vector.

Parameters:
left 
Returns:

float Axiom::MathLib::Vector3::Normalize  )  [inline]
 

Normalizes the vector.

This method normalises the vector such that it's length / magnitude is 1. The result is called a unit vector.

This function will not crash for zero-sized vectors, but there will be no changes made to their components.

Returns:
The previous length of the vector.

static Vector3 Axiom::MathLib::Vector3::operator * float  scalar,
Vector3  right
[inline, static]
 

Used when a scalar value is multiplied by a Vector3.

Parameters:
scalar 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator * Vector3  left,
float  scalar
[inline, static]
 

Used when a Vector3 is multiplied by a scalar value.

Parameters:
left 
scalar 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator * Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is multiplied by another vector.

Parameters:
left 
right 
Returns:

static bool Axiom::MathLib::Vector3::operator!= Vector3  left,
Vector3  right
[inline, static]
 

User to compare two Vector3 instances for inequality.

Parameters:
left 
right 
Returns:
true or false

static Vector3 Axiom::MathLib::Vector3::operator+ Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is added to another Vector3.

Parameters:
left 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator- Vector3  left  )  [inline, static]
 

Used to negate the elements of a vector.

Parameters:
left 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator- Vector3  left,
Vector3  right
[inline, static]
 

Used to subtract a Vector3 from another Vector3.

Parameters:
left 
right 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator/ Vector3  left,
float  scalar
[inline, static]
 

Used to divide a vector by a scalar value.

Parameters:
left 
scalar 
Returns:

static Vector3 Axiom::MathLib::Vector3::operator/ Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is divided by another vector.

Parameters:
left 
right 
Returns:

static bool Axiom::MathLib::Vector3::operator< Vector3  left,
Vector3  right
[inline, static]
 

Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.

Parameters:
left 
right 
Returns:

static bool Axiom::MathLib::Vector3::operator== Vector3  left,
Vector3  right
[inline, static]
 

User to compare two Vector3 instances for equality.

Parameters:
left 
right 
Returns:
true or false

static bool Axiom::MathLib::Vector3::operator> Vector3  left,
Vector3  right
[inline, static]
 

Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.

Parameters:
left 
right 
Returns:

Vector3 Axiom::MathLib::Vector3::Perpendicular  )  [inline]
 

Finds a vector perpendicular to this one.

Returns:

Vector3 Axiom::MathLib::Vector3::Reflect Vector3  normal  )  [inline]
 

Calculates a reflection vector to the plane with the given normal.

Assumes this vector is pointing AWAY from the plane, invert if not.

Parameters:
normal Normal vector on which this vector will be reflected.
Returns:

static Vector3 Axiom::MathLib::Vector3::Subtract Vector3  left,
Vector3  right
[inline, static]
 

Used to subtract a Vector3 from another Vector3.

Parameters:
left 
right 
Returns:

string Axiom::MathLib::Vector3::ToIntegerString  )  [inline]
 

Overrides the Object.ToString() method to provide a text representation of a Vector3.

Returns:
A string representation of a vector3.

Vector3 Axiom::MathLib::Vector3::ToNormalized  )  [inline]
 

Finds the midpoint between the supplied Vector and this vector.

Compares the supplied vector and updates it's x/y/z components of they are higher in value.

Compares the supplied vector and updates it's x/y/z components of they are lower in value.

Parameters:
compare 
Returns:

string Axiom::MathLib::Vector3::ToString bool  shortenDecmialPlaces  )  [inline]
 

Overrides the Object.ToString() method to provide a text representation of a Vector3.

Returns:
A string representation of a vector3.

override string Axiom::MathLib::Vector3::ToString  )  [inline]
 

Overrides the Object.ToString() method to provide a text representation of a Vector3.

Returns:
A string representation of a vector3.


The documentation for this struct was generated from the following file:
Generated on Mon Jan 23 19:31:15 2006 for FlowVis by  doxygen 1.4.5