Home | Download | Screen shots | Discussion | Documentation |
---|
Public Member Functions | |
vec3f () throw () | |
Construct. | |
vec3f (const float(&vec)[3]) throw () | |
Construct from an array. | |
vec3f (float x, float y, float z) throw () | |
Construct from x , y , and z components. | |
vec3f & | operator *= (const vec3f &vec) throw () |
Cross multiply. | |
vec3f & | operator *= (const mat4f &mat) throw () |
Multiply by a matrix. | |
vec3f & | operator *= (float scalar) throw () |
Multiply by a scalar. | |
vec3f & | operator/= (float scalar) throw () |
Divide by a scalar. | |
vec3f & | operator+= (const vec3f &vec) throw () |
Add a vector. | |
vec3f & | operator-= (const vec3f &vec) throw () |
Subtract a vector. | |
const vec3f | operator- () const throw () |
Negate. | |
const float & | operator[] (size_t index) const throw () |
Index-based component access. | |
float & | operator[] (size_t index) throw () |
Index-based component access. | |
float | x () const throw () |
Get the x component. | |
float | y () const throw () |
Get the y component. | |
float | z () const throw () |
Get the z component. | |
void | x (float value) throw () |
Set the x component. | |
void | y (float value) throw () |
Set the y component. | |
void | z (float value) throw () |
Set the z component. | |
float | dot (const vec3f &vec) const throw () |
Dot product. | |
float | length () const throw () |
Geometric length. | |
const vec3f | normalize () const throw () |
Normalize. | |
Private Attributes | |
float | vec [3] |
Vector components. | |
Related Functions | |
(Note that these are not member functions.) | |
const vec3f | operator * (const vec3f &lhs, const vec3f &rhs) throw() |
Cross multiply two vectors. | |
const vec3f | operator * (const vec3f &vec, const mat4f &mat) throw() |
Multiply a vector by a matrix. | |
const vec3f | operator * (const mat4f &mat, const vec3f &vec) throw() |
Multiply a matrix by a vector. | |
const vec3f | operator/ (const vec3f &lhs, float rhs) throw() |
Divide a vector by a scalar. | |
const vec3f | operator+ (const vec3f &lhs, const vec3f &rhs) throw() |
Add two vectors. | |
const vec3f | operator- (const vec3f &lhs, const vec3f &rhs) throw() |
Subtract two vectors. | |
bool | operator== (const vec3f &lhs, const vec3f &rhs) throw() |
Compare for equality. | |
bool | operator!= (const vec3f &lhs, const vec3f &rhs) throw() |
Compare for inequality. | |
std::ostream & | operator<< (std::ostream &out, const vec3f &v) |
Stream output. |
|
Construct.
|
|
Construct from an array.
|
|
Construct from
|
|
Dot product.
|
|
Geometric length.
|
|
Normalize.
|
|
Multiply by a scalar.
|
|
Multiply by a matrix.
|
|
Cross multiply.
|
|
Add a vector.
|
|
Negate.
|
|
Subtract a vector.
|
|
Divide by a scalar.
|
|
Index-based component access.
|
|
Index-based component access.
|
|
Set the x component.
|
|
Get the x component.
|
|
Set the y component.
|
|
Get the y component.
|
|
Set the z component.
|
|
Get the z component.
|
|
Multiply a matrix by a vector.
|
|
Multiply a vector by a matrix.
|
|
Cross multiply two vectors.
|
|
Compare for inequality.
|
|
Add two vectors.
|
|
Subtract two vectors.
|
|
Divide a vector by a scalar.
|
|
Stream output.
|
|
Compare for equality.
|
|
Vector components.
For internal use only.
|