Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <Vector3D.h>
Public Member Functions | |
Vector3D () | |
Vector3D (float x, float y, float z) | |
Vector3D (const Vector3D &v) | |
void | Add (const Vector3D &v1, const Vector3D &v2) |
void | Subtract (const Vector3D &v1, const Vector3D &v2) |
void | Multiply (const Vector3D &v1, const Vector3D &v2) |
void | Divide (const Vector3D &v1, const Vector3D &v2) |
void | Add (const Vector3D &v1, const float f) |
void | Subtract (const Vector3D &v1, const float f) |
void | Multiply (const Vector3D &v1, const float f) |
void | Divide (const Vector3D &v1, const float f) |
void | operator= (const Vector3D &v) |
void | operator+= (const Vector3D &v) |
void | operator-= (const Vector3D &v) |
void | operator/= (const Vector3D &v) |
void | operator*= (const Vector3D &v) |
Vector3D | operator+ (const Vector3D &v) const |
Vector3D | operator- (const Vector3D &v) const |
Vector3D | operator/ (const Vector3D &v) const |
Vector3D | operator* (const Vector3D &v) const |
Vector3D | operator+ (const float &f) const |
Vector3D | operator- (const float &f) const |
Vector3D | operator/ (const float &f) const |
Vector3D | operator* (const float &f) const |
void | Negate () |
float | Dot3 (const Vector3D &v) const |
float | Magnitude () const |
void | Normalize () |
void | Normalize (const Vector3D &p1, const Vector3D &p2, const Vector3D &p3) |
Vector3D | CrossProduct (const Vector3D &v) const |
Public Attributes | |
float | x |
float | y |
float | z |
Vector with 3 components (x,y,z).
Ult::Vector3D::Vector3D | ( | ) |
Vector3D constructor. Sets x=y=z=0.
Ult::Vector3D::Vector3D | ( | float | x, |
float | y, | ||
float | z ) |
Vector3D constructor from input values.
void Ult::Vector3D::Add | ( | const Vector3D & | v1, |
const float | f ) |
Sets this vector to the scalar addition of v1 and f.
Sets this vector to the addition of v1 and v2.
Returns the cross product of this vector and v.
void Ult::Vector3D::Divide | ( | const Vector3D & | v1, |
const float | f ) |
Sets this vector to the scalar division of v1 and f.
Sets this vector to the element-wise division of v1 and v2.
float Ult::Vector3D::Dot3 | ( | const Vector3D & | v | ) | const |
Returns the dot product of this vector and v.
float Ult::Vector3D::Magnitude | ( | ) | const |
Returns the magnitude of this vector.
void Ult::Vector3D::Multiply | ( | const Vector3D & | v1, |
const float | f ) |
Sets this vector to the scalar multiplication of v1 and f.
Sets this vector to the element-wise multiplication of v1 and v2.
void Ult::Vector3D::Negate | ( | ) |
Sets this vector to -x,-y,-z.
void Ult::Vector3D::Normalize | ( | ) |
Normalizes this vector.
Sets this vector to the normal of the triangle made up of p1,p2,p3.
Vector3D Ult::Vector3D::operator* | ( | const float & | f | ) | const |
Returns the scalar multiplication of this vector and f.
Returns the element-wise multiplication of this vector and v.
void Ult::Vector3D::operator*= | ( | const Vector3D & | v | ) |
Multiplies this vector element-wise by v.
Vector3D Ult::Vector3D::operator+ | ( | const float & | f | ) | const |
Returns the scalar addition of this vector and f.
void Ult::Vector3D::operator+= | ( | const Vector3D & | v | ) |
Adds v to this vector.
Vector3D Ult::Vector3D::operator- | ( | const float & | f | ) | const |
Returns the scalar subtraction of this vector and f.
Returns the difference of this vector and v.
void Ult::Vector3D::operator-= | ( | const Vector3D & | v | ) |
Subtracts v from this vector.
Vector3D Ult::Vector3D::operator/ | ( | const float & | f | ) | const |
Returns the scalar division of this vector and f.
Returns the element-wise division of this vector and v.
void Ult::Vector3D::operator/= | ( | const Vector3D & | v | ) |
Divides this vector element-wise by v.
void Ult::Vector3D::operator= | ( | const Vector3D & | v | ) |
Sets this vector equal to v.
void Ult::Vector3D::Subtract | ( | const Vector3D & | v1, |
const float | f ) |
Sets this vector to the scalar subtraction of v1 and f.
Sets this vector to the subtraction of v1 and v2.
float Ult::Vector3D::x |
The 3 components of this vector.
float Ult::Vector3D::y |
float Ult::Vector3D::z |