#include <vecmath.h>
Public Member Functions | |
CVec () | |
CVec (PRECISION x, PRECISION y, PRECISION z) | |
void | set (PRECISION x, PRECISION y, PRECISION z) |
void | print () |
Prints vector as (x,y,z) to console. | |
CVec | operator * (PRECISION s) const |
Scalar multiplication. | |
CVec & | operator= (const CVec &v) |
Assigns values of vector v to vector. | |
PRECISION | operator[] (unsigned int i) const |
Array access (read). | |
PRECISION & | operator[] (unsigned int i) |
Array access (write). | |
CVec | operator+ (const CVec &v) const |
Vector addition. | |
CVec | operator- (const CVec &v) const |
Vector difference. | |
CVec | operator- () const |
Vector negation. | |
PRECISION | operator| (const CVec &v) const |
Dot product. | |
CVec | operator^ (const CVec &v) const |
Cross product. | |
Public Attributes | |
PRECISION | x |
PRECISION | y |
PRECISION | z |
PRECISION | w |
CVec::CVec | ( | ) |
CVec::CVec | ( | PRECISION | x, | |
PRECISION | y, | |||
PRECISION | z | |||
) |
void CVec::set | ( | PRECISION | x, | |
PRECISION | y, | |||
PRECISION | z | |||
) |
void CVec::print | ( | ) |
Prints vector as (x,y,z) to console.
CVec CVec::operator * | ( | PRECISION | s | ) | const |
Scalar multiplication.
PRECISION CVec::operator[] | ( | unsigned int | i | ) | const |
Array access (read).
PRECISION & CVec::operator[] | ( | unsigned int | i | ) |
Array access (write).
CVec CVec::operator- | ( | ) | const |
Vector negation.
PRECISION CVec::operator| | ( | const CVec & | v | ) | const |
Dot product.
PRECISION CVec::x |
PRECISION CVec::y |
PRECISION CVec::z |
PRECISION CVec::w |