Main Page | Class Hierarchy | Class List | Class Members

SC::Math::Vector3 Struct Reference

List of all members.

Public Member Functions

 Vector3 (float x, float y, float z)
float Dot (Vector3 vector)
Vector3 Cross (Vector3 vector)
Vector3 Perpendicular ()
Vector3 RandomDeviant (float angle, Vector3 up)
Vector3 MidPoint (Vector3 vector)
void Ceil (Vector3 compare)
void Floor (Vector3 compare)
Quaternion GetRotationTo (Vector3 destination)
void Normalize ()
Vector3 Reflect (Vector3 normal)
override string ToString ()
override int GetHashCode ()
override bool Equals (object obj)

Static Public Member Functions

bool operator== (Vector3 left, Vector3 right)
bool operator!= (Vector3 left, Vector3 right)
Vector3 Multiply (Vector3 left, Vector3 right)
Vector3 operator * (Vector3 left, Vector3 right)
Vector3 Divide (Vector3 left, float scalar)
Vector3 operator/ (Vector3 left, float scalar)
Vector3 Add (Vector3 left, Vector3 right)
Vector3 operator+ (Vector3 left, Vector3 right)
Vector3 Multiply (Vector3 left, float scalar)
Vector3 operator * (Vector3 left, float scalar)
Vector3 Multiply (float scalar, Vector3 right)
Vector3 operator * (float scalar, Vector3 right)
Vector3 Subtract (Vector3 left, Vector3 right)
Vector3 operator- (Vector3 left, Vector3 right)
Vector3 Negate (Vector3 left)
Vector3 operator- (Vector3 left)
bool operator> (Vector3 left, Vector3 right)
bool operator< (Vector3 left, Vector3 right)
 operator Vector4 (Vector3 vec3)

Public Attributes

float x
 X component.

float y
 Y component.

float z
 Z component.


Properties

float this [int index]
float Length
float LengthSquared
Vector3 Zero
Vector3 UnitScale
Vector3 UnitX
Vector3 UnitY
Vector3 UnitZ
Vector3 NegativeUnitX
Vector3 NegativeUnitY
Vector3 NegativeUnitZ

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.


Constructor & Destructor Documentation

SC::Math::Vector3::Vector3 float  x,
float  y,
float  z
[inline]
 

Creates a new 3 dimensional Vector.


Member Function Documentation

Vector3 SC::Math::Vector3::Add Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is added to another Vector3.

void SC::Math::Vector3::Ceil Vector3  compare  )  [inline]
 

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

Vector3 SC::Math::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. A vector to perform the Cross Product against. A new Vector3 perpedicular to the 2 original vectors.

Vector3 SC::Math::Vector3::Divide Vector3  left,
float  scalar
[inline, static]
 

Used to divide a vector by a scalar value.

float SC::Math::Vector3::Dot Vector3  vector  )  [inline]
 

Performs a Dot Product operation on 2 vectors, which produces the angle between them. The vector to perform the Dot Product against. The angle between the 2 vectors.

override bool SC::Math::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.

void SC::Math::Vector3::Floor Vector3  compare  )  [inline]
 

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

override int SC::Math::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. <p/> The standard implementation is a simple XOR operation between all local member variables.

Quaternion SC::Math::Vector3::GetRotationTo Vector3  destination  )  [inline]
 

Gets the shortest arc quaternion to rotate this vector to the destination vector. Don't call this if you think the dest vector can be close to the inverse of this vector, since then ANY axis of rotation is ok.

Vector3 SC::Math::Vector3::MidPoint Vector3  vector  )  [inline]
 

Finds the midpoint between the supplied Vector and this vector.

Vector3 SC::Math::Vector3::Multiply float  scalar,
Vector3  right
[inline, static]
 

Used when a scalar value is multiplied by a Vector3.

Vector3 SC::Math::Vector3::Multiply Vector3  left,
float  scalar
[inline, static]
 

Used when a Vector3 is multiplied by a scalar value.

Vector3 SC::Math::Vector3::Multiply Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is multiplied by another vector.

Vector3 SC::Math::Vector3::Negate Vector3  left  )  [inline, static]
 

Used to negate the elements of a vector.

void SC::Math::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. <p/> This function will not crash for zero-sized vectors, but there will be no changes made to their components.

Vector3 SC::Math::Vector3::operator * float  scalar,
Vector3  right
[inline, static]
 

Used when a scalar value is multiplied by a Vector3.

Vector3 SC::Math::Vector3::operator * Vector3  left,
float  scalar
[inline, static]
 

Used when a Vector3 is multiplied by a scalar value.

Vector3 SC::Math::Vector3::operator * Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is multiplied by another vector.

SC::Math::Vector3::operator Vector4 Vector3  vec3  )  [inline, explicit, static]
 

bool SC::Math::Vector3::operator!= Vector3  left,
Vector3  right
[inline, static]
 

User to compare two Vector3 instances for inequality. true or false

Vector3 SC::Math::Vector3::operator+ Vector3  left,
Vector3  right
[inline, static]
 

Used when a Vector3 is added to another Vector3.

Vector3 SC::Math::Vector3::operator- Vector3  left  )  [inline, static]
 

Used to negate the elements of a vector.

Vector3 SC::Math::Vector3::operator- Vector3  left,
Vector3  right
[inline, static]
 

Used to subtract a Vector3 from another Vector3.

Vector3 SC::Math::Vector3::operator/ Vector3  left,
float  scalar
[inline, static]
 

Used to divide a vector by a scalar value.

bool SC::Math::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.

bool SC::Math::Vector3::operator== Vector3  left,
Vector3  right
[inline, static]
 

User to compare two Vector3 instances for equality. true or false

bool SC::Math::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.

Vector3 SC::Math::Vector3::Perpendicular  )  [inline]
 

Finds a vector perpendicular to this one.

Vector3 SC::Math::Vector3::RandomDeviant float  angle,
Vector3  up
[inline]
 

Vector3 SC::Math::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. Normal vector on which this vector will be reflected.

Vector3 SC::Math::Vector3::Subtract Vector3  left,
Vector3  right
[inline, static]
 

Used to subtract a Vector3 from another Vector3.

override string SC::Math::Vector3::ToString  )  [inline]
 

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


Property Documentation

float SC::Math::Vector3::Length [get]
 

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 SC::Math::Vector3::LengthSquared [get]
 

Returns the length (magnitude) of the vector squared.

Vector3 SC::Math::Vector3::NegativeUnitX [static, get]
 

Gets a Vector3 with the X set to -1, and the others set to 0.

Vector3 SC::Math::Vector3::NegativeUnitY [static, get]
 

Gets a Vector3 with the Y set to -1, and the others set to 0.

Vector3 SC::Math::Vector3::NegativeUnitZ [static, get]
 

Gets a Vector3 with the Z set to -1, and the others set to 0.

float SC::Math::Vector3::this[int index] [get, set]
 

Used to access a Vector by index 0 = x, 1 = y, 2 = z. Uses unsafe pointer arithmetic to reduce the code required.

Vector3 SC::Math::Vector3::UnitScale [static, get]
 

Gets a Vector3 with all components set to 1.

Vector3 SC::Math::Vector3::UnitX [static, get]
 

Gets a Vector3 with the X set to 1, and the others set to 0.

Vector3 SC::Math::Vector3::UnitY [static, get]
 

Gets a Vector3 with the Y set to 1, and the others set to 0.

Vector3 SC::Math::Vector3::UnitZ [static, get]
 

Gets a Vector3 with the Z set to 1, and the others set to 0.

Vector3 SC::Math::Vector3::Zero [static, get]
 

Gets a Vector3 with all components set to 0.


The documentation for this struct was generated from the following file:
Generated on Sat Jan 15 23:59:00 2005 for StreamCtrl by doxygen 1.3.6