basic vector class (vertex, normal...) More...
#include <mat.h>
Public Member Functions | |
TVector (GLfloat vx=0.0, GLfloat vy=0.0, GLfloat vz=0.0, GLfloat vw=0.0) | |
Set null values. | |
TVector (const TVector &start, const TVector &end) | |
Construct vector from two points. | |
void | Create (const TVector &start, const TVector &end) |
Create vector from two points. | |
void | Set (GLfloat vx, GLfloat vy, GLfloat vz, GLfloat vw=0.0) |
Set values explicitly from floats. | |
void | LoadIdentity () |
null all vector values | |
GLfloat | Lenght () |
Returns vector length. | |
void | Normalize () |
Normalize vector values (sets values from 0.0 to 1.0). | |
bool | IsEmpty () |
Return, if is vector empty. | |
operator GLfloat * () const | |
retype operator | |
Public Attributes | |
GLfloat | x |
X - component. | |
GLfloat | y |
Y - component. | |
GLfloat | z |
Z - component. | |
GLfloat | w |
W - component. | |
Friends | |
TVector | operator+ (const TVector &v, const float con) |
add constant to vector | |
TVector | operator* (const TVector &v, const float con) |
multiply by constant operator | |
TVector | operator- (const TVector &v1, const TVector &v2) |
subtract two vectors | |
TVector | operator/ (const TVector &v, const float con) |
divide vector by constant | |
TVector | operator- (const TVector &v) |
invert values in vector |
basic vector class (vertex, normal...)
float TVector::Lenght | ( | ) |
Returns vector length.
GLfloat TVector::x |
X - component.
has four vector coordinates (can be XYZ position, RGB color...)