Angel 3.2
A 2D Game Prototyping Engine

A threedimensional floating point vector and associated math functions. More...
#include <Vector3.h>
Public Member Functions  
Vector3 (float x, float y, float z)  
Vector3 (float value)  
Vector3 ()  
float  Length () 
float  LengthSquared () 
void  Normalize () 
bool  operator== (const Vector3 &v) const 
bool  operator!= (const Vector3 &v) const 
Vector3  operator () const 
Vector3  operator (const Vector3 &v) const 
Vector3  operator+ (const Vector3 &v) const 
Vector3  operator/ (float divider) const 
Vector3  operator* (float scaleFactor) const 
Vector3 &  operator+= (const Vector3 &v) 
Vector3 &  operator= (const Vector3 &v) 
Vector3 &  operator*= (float f) 
Vector3 &  operator/= (float f) 
Static Public Member Functions  
static float  Distance (const Vector3 &value1, const Vector3 &value2) 
static float  DistanceSquared (const Vector3 &value1, const Vector3 &value2) 
static float  Dot (const Vector3 &value1, const Vector3 &value2) 
static Vector3  Normalize (const Vector3 &value) 
static Vector3  Reflect (const Vector3 &vector, const Vector3 &normal) 
static Vector3  Min (const Vector3 &value1, const Vector3 &value2) 
static Vector3  Max (const Vector3 &value1, const Vector3 &value2) 
static Vector3  Clamp (const Vector3 &value1, const Vector3 &min, const Vector3 &max) 
static Vector3  Lerp (const Vector3 &value1, const Vector3 &value2, float amount) 
static Vector3  Negate (const Vector3 &value) 
Public Attributes  
float  X 
float  Y 
float  Z 
Static Public Attributes  
static Vector3  Zero 
static Vector3  One 
static Vector3  UnitX 
static Vector3  UnitY 
static Vector3  UnitZ 
A floating point threedimensional vector. Can be used either as a traditional vector (indicating a direction) or a position (treating X, Y, and Z as coordinates).
Vector3::Vector3  (  float  x, 
float  y,  
float  z  
) 
Constructor to initialize the vector to set dimensions
x  The X dimension 
y  The Y dimension 
z  The Z dimension 
Definition at line 43 of file Vector3.cpp.
Vector3::Vector3  (  float  value  ) 
Constructor to initialize the vector to uniform dimensions
value  The value to use for the X, Y, and Z dimensions 
Definition at line 49 of file Vector3.cpp.
Vector3::Vector3  (  ) 
Constructor to initialize a zerolength vector (0, 0, 0)
Definition at line 55 of file Vector3.cpp.
float Vector3::Length  (  ) 
Get the absolute magnitude of the vector. Uses a squareroot, so be careful calling this too much within a loop.
Definition at line 61 of file Vector3.cpp.
float Vector3::LengthSquared  (  ) 
Get the squared magnitude of the vector – if all you care about is comparison, it's a lot faster to consider the squared lengths of the vectors.
Definition at line 66 of file Vector3.cpp.
Get the absolute distance between two points (most useful if the Vector2 represents a position). Uses a squareroot, so be careful calling this too much within a loop.
value1  The first point 
value2  The second point 
Definition at line 71 of file Vector3.cpp.
Get the absolute distance between two points – if all you care about is comparison, it's a lot faster to consider the squared lengths of the vectors.
value1  The first point 
value2  The second point 
Definition at line 76 of file Vector3.cpp.
Get the dot product of two vectors.
value1  The first vector 
value2  The second vector 
Definition at line 82 of file Vector3.cpp.
void Vector3::Normalize  (  ) 
Normalizes a vector in place – retains its direction, but ensures that its magnitude is equal to 1.0.
Definition at line 87 of file Vector3.cpp.
Get the normalized value for a Vector2 without affecting the original.
value  The Vector3 to normalize 
Definition at line 107 of file Vector3.cpp.
Reflect one Vector around another
vector  The vector to reflect 
normal  The normal to reflect it around 
Definition at line 114 of file Vector3.cpp.
Get a new vector from the minimum X, Y, and Z of the two
Definition at line 119 of file Vector3.cpp.
Get a new vector from the maximum X, Y, and Z of the two
Definition at line 124 of file Vector3.cpp.
Clamp a vector to a given minimum and maximum
value  The vector to be clamped 
min  The vector representing the X, Y, and Z minimums for the clamping 
max  The vector representing the X, Y, and Z maximums for the clamping 
Definition at line 129 of file Vector3.cpp.
Perform a linear interpolation between two vectors
value1  The starting point vector 
value2  The ending point vector 
amount  The amount (from 0.0 to 1.0) to interpolate between them 
Definition at line 134 of file Vector3.cpp.
Get a negated vector – if you add the result and the original, you should get a zerolength vector (0, 0)
value  The vector to negate 
Definition at line 138 of file Vector3.cpp.
float Vector3::X 
float Vector3::Y 
float Vector3::Z 

static 

static 

static 

static 

static 