#include <vector.h>

Public Member Functions | |
| vector3 (void) | |
| Default Constructor. | |
| vector3 (real_t x_, real_t y_, real_t z_) | |
| Constructor. | |
| vector3 (real_t *r3) | |
| Constructor. | |
| vector3 (const math::vector3 &p) | |
| Copy Constructor. | |
| math::vector3 & | operator= (const math::vector3 &p) |
| Assignment Operator. | |
| void | set (real_t x_, real_t y_, real_t z_) |
| Sets vector to (x_, y_, z_). | |
| void | set (real_t *r3) |
| Sets vector to array. | |
| real_t | operator() (unsigned int index) const |
| Array like read access to vector. | |
| real_t & | operator() (unsigned int index) |
| Array like write access to vector. | |
| math::vector3 | operator+ (const math::vector3 &rhs) const |
| Vector Addition. | |
| math::vector3 | operator- (const math::vector3 &rhs) const |
| Vector Subtraction. | |
| math::vector3 | operator* (const math::vector3 &rhs) const |
| Vector Component Multiplication. | |
| math::vector3 | operator/ (const math::vector3 &rhs) const |
| Vector Component Division. | |
| math::vector3 | operator- (void) const |
| Returns the negated (flipped) vector. | |
| math::vector3 | operator* (real_t rhs) const |
| Scalar Multiplication. | |
| math::vector3 | operator/ (real_t rhs) const |
| Scalar Division. | |
| void | operator-= (const math::vector3 &v) |
| Vector Subtraction. | |
| void | operator+= (const math::vector3 &v) |
| Vector Addition. | |
| void | operator*= (const math::vector3 &rhs) |
| Vector Component Multiplication. | |
| void | operator/= (const math::vector3 &rhs) |
| Vector Component Division. | |
| void | operator-= (real_t rhs) |
| Scalar Subtraction. | |
| void | operator+= (real_t rhs) |
| Scalar Addition. | |
| void | operator*= (real_t rhs) |
| Scalar Multiplication. | |
| void | operator/= (real_t rhs) |
| Scalar Division. | |
| real_t | x (void) const |
| Returns a copy of x. | |
| real_t | y (void) const |
| Returns a copy of y. | |
| real_t | z (void) const |
| Returns a copy of z. | |
| void | x (real_t x_) |
| Sets the value of x. | |
| void | y (real_t y_) |
| Sets the value of y. | |
| void | z (real_t z_) |
| Sets the value of z. | |
| double | length (void) const |
| Returns the length of the vector. | |
| void | normalize (void) |
| Normalizes the vector. | |
| void | negate (void) |
| Negates (flips) the vector. | |
| bool | operator== (const math::vector3 &rhs) const |
| Equals operator. | |
| bool | operator!= (const math::vector3 &rhs) const |
| Not equals operator. | |
| operator const real_t * (void) const | |
Cast operator to const real_t*. | |
Static Public Member Functions | |
| static math::vector3 | lerp (real_t percent, const math::vector3 &a, const math::vector3 &b) |
| Linear Interpretation. | |
Static Public Attributes | |
| static const vector3 | ZERO |
The vector . | |
| static const vector3 | X_AXIS |
The vector . | |
| static const vector3 | Y_AXIS |
The vector . | |
| static const vector3 | Z_AXIS |
The vector . | |
Friends | |
| math::vector3 | math::operator* (real_t lhs, const math::vector3 &rhs) |
| Scalar Multiplication. | |
| std::ostream & | math::operator<< (std::ostream &o, const math::vector3 &vec) |
stream output operator | |
| math::vector3 | math::cross (const math::vector3 &lhs, const math::vector3 &rhs) |
| Cross Product. | |
| void | math::add (math::vector3 &dest, const math::vector3 &lhs, const math::vector3 &rhs) |
| Vector Addition. | |
| void | math::subtract (math::vector3 &dest, const math::vector3 &lhs, const math::vector3 &rhs) |
| Vector Subtraction. | |
| void | math::multiply (math::vector3 &dest, const math::vector3 &lhs, const math::vector3 &rhs) |
| Vector Component Multiplication. | |
| void | math::divide (math::vector3 &dest, const math::vector3 &lhs, const math::vector3 &rhs) |
| Vector Component Division. | |
| void | math::multiply (math::vector3 &dest, const math::vector3 &lhs, real_t rhs) |
| Scalar Multiplication. | |
| void | math::multiply (math::vector3 &dest, real_t rhs, const math::vector3 &lhs) |
| Scalar Multiplication. | |
| real_t | math::dot (const math::vector3 &lhs, const math::vector3 &rhs) |
| Dot Product. | |
Definition at line 52 of file vector.h.
| math::vector3::vector3 | ( | void | ) | [inline] |
Default Constructor.
Initializes the x, y, and z components to 0.0.
Definition at line 170 of file vector.h.
Referenced by operator*(), operator+(), operator-(), and operator/().
| math::vector3::vector3 | ( | real_t * | r3 | ) | [inline] |
| double math::vector3::length | ( | void | ) | const [inline] |
Returns the length of the vector.
The length of a vector is defined as:
.
Definition at line 477 of file vector.h.
Referenced by math::quaternion::from_angle_axis(), and normalize().
| math::vector3 math::vector3::lerp | ( | real_t | percent, | |
| const math::vector3 & | a, | |||
| const math::vector3 & | b | |||
| ) | [static] |
Linear Interpretation.
Interprets the between the two vectors that a and b describe.
| percent | A real_t between [0-1] descibing how much to interpret between qa and qb. | |
| a | Initial vector. | |
| b | Ending vector. |
Definition at line 135 of file vector.cpp.
| void math::vector3::negate | ( | void | ) | [inline] |
Negates (flips) the vector.
Definition at line 502 of file vector.h.
Referenced by math::quaternion::slerp().
| void math::vector3::normalize | ( | void | ) | [inline] |
Normalizes the vector.
Sets this vector to be unit length. A unit length vector is defined as
.
Definition at line 488 of file vector.h.
References math::equals(), and length().
| math::vector3::operator const real_t * | ( | void | ) | const [inline] |
| bool math::vector3::operator!= | ( | const math::vector3 & | rhs | ) | const [inline] |
Not equals operator.
Checks if the vector is not equal to rhs.
Definition at line 528 of file vector.h.
References math::equals(), and m_data.
| real_t& math::vector3::operator() | ( | unsigned int | index | ) | [inline] |
| real_t math::vector3::operator() | ( | unsigned int | index | ) | const [inline] |
Array like read access to vector.
Returns a copy of either the x, y, or z component of the vector based on the index passed in. If the index is not 0, 1, or 3, abort( ) may be called.
| math::vector3 math::vector3::operator* | ( | real_t | rhs | ) | const [inline] |
Scalar Multiplication.
Returns the scalar product of the vector and rhs.
| rhs | A scalar. |
Definition at line 332 of file vector.h.
References vector3().
| math::vector3 math::vector3::operator* | ( | const math::vector3 & | rhs | ) | const [inline] |
| void math::vector3::operator*= | ( | real_t | rhs | ) | [inline] |
| void math::vector3::operator*= | ( | const math::vector3 & | rhs | ) | [inline] |
| math::vector3 math::vector3::operator+ | ( | const math::vector3 & | rhs | ) | const [inline] |
Vector Addition.
Returns the vector sum of the vector and rhs.
| void math::vector3::operator+= | ( | real_t | rhs | ) | [inline] |
| void math::vector3::operator+= | ( | const math::vector3 & | v | ) | [inline] |
| math::vector3 math::vector3::operator- | ( | void | ) | const [inline] |
| math::vector3 math::vector3::operator- | ( | const math::vector3 & | rhs | ) | const [inline] |
Vector Subtraction.
Returns the vector difference of the vector and rhs.
| void math::vector3::operator-= | ( | real_t | rhs | ) | [inline] |
| void math::vector3::operator-= | ( | const math::vector3 & | v | ) | [inline] |
| math::vector3 math::vector3::operator/ | ( | real_t | rhs | ) | const [inline] |
| math::vector3 math::vector3::operator/ | ( | const math::vector3 & | rhs | ) | const [inline] |
| void math::vector3::operator/= | ( | real_t | rhs | ) | [inline] |
| void math::vector3::operator/= | ( | const math::vector3 & | rhs | ) | [inline] |
| bool math::vector3::operator== | ( | const math::vector3 & | rhs | ) | const [inline] |
Equals operator.
Checks if the vector is equal to rhs.
Definition at line 515 of file vector.h.
References math::equals(), and m_data.
| void math::vector3::set | ( | real_t * | r3 | ) | [inline] |
| void math::add | ( | math::vector3 & | dest, | |
| const math::vector3 & | lhs, | |||
| const math::vector3 & | rhs | |||
| ) | [friend] |
Vector Addition.
Computes the vector sum of lhs and rhs, placing the result in dest.
| dest | Vector sum of lhs and rhs (ouput of function). |
| math::vector3 math::cross | ( | const math::vector3 & | lhs, | |
| const math::vector3 & | rhs | |||
| ) | [friend] |
Cross Product.
Returns the cross product of lhs and rhs.
| void math::divide | ( | math::vector3 & | dest, | |
| const math::vector3 & | lhs, | |||
| const math::vector3 & | rhs | |||
| ) | [friend] |
Vector Component Division.
Divides the corresponding components of lhs by rhs, and places the result in dest.
| dest | Result of the division of each component of lhs and rhs (ouput of function). |
| real_t math::dot | ( | const math::vector3 & | lhs, | |
| const math::vector3 & | rhs | |||
| ) | [friend] |
Dot Product.
Returns the dot product of lhs and rhs.
| void math::multiply | ( | math::vector3 & | dest, | |
| real_t | rhs, | |||
| const math::vector3 & | lhs | |||
| ) | [friend] |
Scalar Multiplication.
Computes the scalar product of lhs and rhs, placing the result in dest.
| dest | Scalar product of lhs and rhs (ouput of function). | |
| lhs | A scalar. |
| void math::multiply | ( | math::vector3 & | dest, | |
| const math::vector3 & | lhs, | |||
| real_t | rhs | |||
| ) | [friend] |
Scalar Multiplication.
Computes the scalar product of lhs and rhs, placing the result in dest.
| dest | Scalar product of lhs and rhs (ouput of function). | |
| rhs | A scalar. |
| void math::multiply | ( | math::vector3 & | dest, | |
| const math::vector3 & | lhs, | |||
| const math::vector3 & | rhs | |||
| ) | [friend] |
Vector Component Multiplication.
Multiplies the corresponding components of lhs and rhs, and places the result in dest.
| dest | Result of the multiplication of each component of lhs and rhs (ouput of function). |
| math::vector3 math::operator* | ( | real_t | lhs, | |
| const math::vector3 & | rhs | |||
| ) | [friend] |
Scalar Multiplication.
Returns the scalar product of lhs and rhs.
| lhs | A scalar. |
| std::ostream& math::operator<< | ( | std::ostream & | o, | |
| const math::vector3 & | vec | |||
| ) | [friend] |
stream output operator
Outputs vec as follows:
x y z
No new line is placed at the end of the stream.
| void math::subtract | ( | math::vector3 & | dest, | |
| const math::vector3 & | lhs, | |||
| const math::vector3 & | rhs | |||
| ) | [friend] |
Vector Subtraction.
Computes the vector difference of lhs and rhs, placing the result in dest.
| dest | Vector difference of lhs and rhs (ouput of function). |
1.5.7.1