#include <ddgvec.h>
Public Members | |||
operator float * () | |||
return the value of the vector as a float array. | |||
float | operator[] (int n) const | ||
Get value of one dimension of the vector. | |||
float& | operator[] (int n) | ||
Returns n-th component of the vector. | |||
bool | operator== (ddgVector3& u) | ||
Test for equivalence. | |||
bool | operator!= (ddgVector3& u) | ||
Test for inequivalence. | |||
void | assign ( float *a) | ||
Assign the value of a float array to this vector. | |||
ddgVector3 (void ) | |||
Create undefine vector. | |||
ddgVector3 (float *a ) | |||
ddgVector3 (float a, float b, float c ) | |||
ddgVector3 ( const ddgVector3* u ) | |||
Construct with initial values from another vector. | |||
ddgVector3& | operator= (const ddgVector3& s) | ||
Assign to another vector. | |||
void | zero ( void ) | ||
Initialize vector to zero. | |||
void | set (float a, float b, float c ) | ||
void | set ( const ddgVector3 *u ) | ||
void | get (float *a, float *b, float *c) | ||
void | add ( const ddgVector3 *u ) | ||
ddgVector3& | operator+= ( const ddgVector3& u) | ||
Add two vectors. | |||
ddgVector3& | operator-= ( const ddgVector3& u) | ||
Subtract two vectors. | |||
ddgVector3& | operator *= ( const ddgVector3& u) | ||
Multiply two vectors. | |||
ddgVector3& | operator *= ( const float d) | ||
Multiply vector by scalar. | |||
ddgVector3& | operator/= ( const ddgVector3& u) | ||
Divide two vectors. | |||
ddgVector3& | operator/= ( const float d) | ||
Divide vector by scalar. | |||
void | subtract ( const ddgVector3 *u ) | ||
void | multiply ( float s ) | ||
void | multiply ( const ddgVector3 *u ) | ||
Multiply his this and a vector. | |||
void | divide ( float s ) | ||
void | divide ( const ddgVector3* u ) | ||
float | sizesq ( void ) | ||
float | size ( void ) | ||
bool | null ( void ) | ||
void | normalize ( void ) | ||
float | angle ( const ddgVector3 *u ) | ||
Returns the angle between 2 normalized vectors. | |||
void | vectortoangle ( void ) | ||
Convert this vector to yaw, pitch, roll angles in degrees. More... | |||
void | angletovector (ddgVector3 *forward, ddgVector3 *right =0, ddgVector3 *up =0) | ||
Convert angles of this to vectors for forward, right and up. More... | |||
void | cross ( const ddgVector3 *u, const ddgVector3 *w ) | ||
Assign the cross product of u X w to this. | |||
float | dot ( const ddgVector3 *u ) | ||
Calculate the dot product of this and u. | |||
void | inverse () | ||
Reverse direction of vector. | |||
void | normal ( const ddgVector3 *p0, const ddgVector3 *p1, const ddgVector3 *p2 ) | ||
Assumes p0 p1 and p2 are in counterclockwise order. | |||
void | normal ( const ddgVector3* v[9] ) | ||
Uses all neigbouring points. | |||
void | reflect ( ddgVector3 *n) | ||
Renderman spec. | |||
void | refract ( const ddgVector3 *n, float eta ) | ||
Refrect a vector w.r.t. More... | |||
void | minimum (const ddgVector3* m ) | ||
Adjust this object to minimum values of given vector. | |||
void | maximum (const ddgVector3* m ) | ||
Adjust this object to maximum values of given vector. | |||
float | v [3] | ||
Three floating point values. | |||
Friends | |||
bool | operator== (const ddgVector3& u, const ddgVector3& v) | ||
Test for equivalence. | |||
bool | operator!= (const ddgVector3& u, const ddgVector3& v) | ||
Test for inequivalence. | |||
ddgVector3 | operator+ ( const ddgVector3& u, const ddgVector3& w) | ||
Add two vectors. | |||
ddgVector3 | operator- ( const ddgVector3& u, const ddgVector3& w) | ||
Subtract two vectors. | |||
ddgVector3 | operator * ( const ddgVector3& u, const ddgVector3& w) | ||
Multiply two vectors. | |||
ddgVector3 | operator/ ( const ddgVector3& u, const ddgVector3& w) | ||
Divide two vectors. | |||
ddgVector3 | operator% ( const ddgVector3& u, const ddgVector3& w) | ||
Cross product of two vectors. | |||
float | operator| ( const ddgVector3& u, const ddgVector3& w) | ||
Dot product of two vectors. | |||
ddgVector3 | operator * ( const float d, const ddgVector3& u) | ||
Scale a vector by a constant and assign result. | |||
ddgVector3 | operator * ( const ddgVector3& u, const float d) | ||
Scale a vector by a constant and assign result. | |||
ddgVector3 | operator/ ( const ddgVector3& u, const float d) | ||
Divide a vector by a constant and assign result. |
void ddgVector3::vectortoangle (void) [inline]
|
Convert this vector to yaw, pitch, roll angles in degrees.
QUAKE II UNTESTED: See angletovector, problably needs correction for Left Handed coords sys.
void ddgVector3::angletovector (ddgVector3 * forward, ddgVector3 * right = 0, ddgVector3 * up = 0) [inline]
|
Convert angles of this to vectors for forward, right and up.
Any of the output vectors are optional. Quake II q_shared (73) For Q Right All angles at 0 looks down the X axis. Y is left. Z is up. Right handed system. All angles at 0 looks down the -Z axis. X is right. Y is up. Left handed system.
void ddgVector3::refract (const ddgVector3 * n, float eta) [inline]
|
Refrect a vector w.r.t.
a normal and a relative index of refraction. eta is the ratio of the index of refraction inthe volume containing the indicent vector to that of the volume being entered. This vector is computed using Snell's law. UNTESTED: Renderman spec.