#include <GLVector.h>
Collaboration diagram for mathglpp::GLIVector2< T >:
Definition at line 252 of file GLVector.h.
Public Types | |
enum | { D = 2 } |
Public Member Functions | |
GLIVector2 (const GLIVector2 &gv) | |
Address another vector. | |
GLIVector2 (T *f) | |
Wrap a vector from an array. | |
~GLIVector2 () | |
Default destructor. | |
void | set (const T &v1, const T &v2) |
element by element initialiser | |
T & | operator[] (int ind) |
element by element accessor | |
operator T * (void) | |
implicit casting to a pointer | |
operator const T * (void) const | |
implicit casting to a const pointer | |
void | glScale () const |
GL interface, glScale(). | |
void | glRotate (const T &ang) const |
GL interface, glRotate(). | |
void | glTranslate () const |
GL interface, glTranslate(). | |
void | glVertex () const |
GL interface, glVertex(). | |
void | glNormal () const |
GL interface, glNormal(). | |
const GLVector2< T > | operator+ (const GLVector2< T > &gv) const |
Get the sum of this and a vector. | |
const GLVector2< T > | operator+ (const GLIVector2 &gv) const |
Get the sum of this and a vector. | |
const GLVector2< T > | operator- (const GLVector2< T > &gv) const |
Get the difference of this and a vector. | |
const GLVector2< T > | operator- (const GLIVector2 &gv) const |
Get the difference of this and a vector. | |
const GLVector2< T > | operator * (const GLVector2< T > &gv) const |
Get the element-by-element product of this and a vector. | |
const GLVector2< T > | operator * (const GLIVector2 &gv) const |
Get the element-by-element product of this and a vector. | |
const GLVector2< T > | operator/ (const GLVector2< T > &gv) const |
Get the element-by-element quota of this and a vector. | |
const GLVector2< T > | operator/ (const GLIVector2 &gv) const |
Get the element-by-element quota of this and a vector. | |
const GLVector2< T > | operator * (const T &v) const |
Get the element-by-element product of this and a scalar. | |
const GLVector2< T > | operator/ (const T &v) const |
Get the element-by-element quota of this and a scalar. | |
GLIVector2 & | operator+= (const GLVector2< T > &gv) |
Add a vector to this. | |
GLIVector2 & | operator+= (const GLIVector2 &gv) |
Add a vector to this. | |
GLIVector2 & | operator-= (const GLVector2< T > &gv) |
Subtract a vector from this. | |
GLIVector2 & | operator-= (const GLIVector2< T > &gv) |
Subtract a vector from this. | |
GLIVector2 & | operator *= (const T &f) |
Multiply this by a scalar. | |
GLIVector2 & | operator/= (const T &f) |
Divide this by a scalar. | |
GLIVector2 & | operator= (const GLVector2< T > &v) |
copy this from a vector | |
GLIVector2 & | operator= (const GLIVector2 &v) |
copy this from a vector | |
const GLVector2< T > | operator- () const |
negate this | |
const T | dot (const GLVector2< T > &gv) const |
Get the dot product of this and a vector. | |
const T | dot (const GLIVector2 &gv) const |
Get the dot product of this and a vector. | |
T | length () const |
Get the length of this. | |
T | lengthSqr () const |
Get the length squared, less computation than length(). | |
const GLVector2< T > | unit () const |
Get the the unit vector of this. | |
GLIVector2 & | normalize () |
Normalize this, makes this a unit vector, US spelling. | |
const T | projection (const GLVector2< T > &in) const |
Get the projection of this and a vector. | |
const T | projection (const GLIVector2 &in) const |
Get the projection of this and a vector. | |
GLVector2< T > | orthogonalProjection (const GLVector2< T > &in) const |
Get the orthogonal projection of this and a vector. | |
GLVector2< T > | orthogonalProjection (const GLIVector2 &in) const |
Get the orthogonal projection of this and a vector. | |
GLVector2< T > | vectorProjection (const GLVector2< T > &in) const |
Get the vector projection of this and a vector. | |
GLVector2< T > | vectorProjection (const GLIVector2 &in) const |
Get the vector projection of this and a vector. | |
Public Attributes | |
T * | val |
anonymous enum |
mathglpp::GLIVector2< T >::GLIVector2 | ( | const GLIVector2< T > & | gv | ) | [inline] |
mathglpp::GLIVector2< T >::GLIVector2 | ( | T * | f | ) | [inline] |
mathglpp::GLIVector2< T >::~GLIVector2 | ( | ) | [inline] |
void mathglpp::GLIVector2< T >::set | ( | const T & | v1, | |
const T & | v2 | |||
) | [inline] |
element by element initialiser
Definition at line 271 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
T& mathglpp::GLIVector2< T >::operator[] | ( | int | ind | ) | [inline] |
element by element accessor
Definition at line 275 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
00276 { return val[ind]; }
mathglpp::GLIVector2< T >::operator T * | ( | void | ) | [inline] |
implicit casting to a pointer
Definition at line 279 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
00280 { return val; }
mathglpp::GLIVector2< T >::operator const T * | ( | void | ) | const [inline] |
implicit casting to a const pointer
Definition at line 283 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
00284 { return val; }
void mathglpp::GLIVector2< T >::glScale | ( | ) | const [inline] |
GL interface, glScale().
void mathglpp::GLIVector2< T >::glRotate | ( | const T & | ang | ) | const [inline] |
GL interface, glRotate().
void mathglpp::GLIVector2< T >::glTranslate | ( | ) | const [inline] |
GL interface, glTranslate().
void mathglpp::GLIVector2< T >::glVertex | ( | ) | const [inline] |
GL interface, glVertex().
Definition at line 293 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
00293 { mathglpp::glVertexv<D,T>(val); }
void mathglpp::GLIVector2< T >::glNormal | ( | ) | const [inline] |
GL interface, glNormal().
const GLVector2<T> mathglpp::GLIVector2< T >::operator+ | ( | const GLVector2< T > & | gv | ) | const [inline] |
Get the sum of this and a vector.
Definition at line 298 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
const GLVector2<T> mathglpp::GLIVector2< T >::operator+ | ( | const GLIVector2< T > & | gv | ) | const [inline] |
Get the sum of this and a vector.
Definition at line 304 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator- | ( | const GLVector2< T > & | gv | ) | const [inline] |
Get the difference of this and a vector.
Definition at line 310 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
const GLVector2<T> mathglpp::GLIVector2< T >::operator- | ( | const GLIVector2< T > & | gv | ) | const [inline] |
Get the difference of this and a vector.
Definition at line 316 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator * | ( | const GLVector2< T > & | gv | ) | const [inline] |
Get the element-by-element product of this and a vector.
Definition at line 322 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
const GLVector2<T> mathglpp::GLIVector2< T >::operator * | ( | const GLIVector2< T > & | gv | ) | const [inline] |
Get the element-by-element product of this and a vector.
Definition at line 328 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator/ | ( | const GLVector2< T > & | gv | ) | const [inline] |
Get the element-by-element quota of this and a vector.
Definition at line 334 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
const GLVector2<T> mathglpp::GLIVector2< T >::operator/ | ( | const GLIVector2< T > & | gv | ) | const [inline] |
Get the element-by-element quota of this and a vector.
Definition at line 340 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator * | ( | const T & | v | ) | const [inline] |
Get the element-by-element product of this and a scalar.
Definition at line 346 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator/ | ( | const T & | v | ) | const [inline] |
Get the element-by-element quota of this and a scalar.
Definition at line 352 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator+= | ( | const GLVector2< T > & | gv | ) | [inline] |
Add a vector to this.
Definition at line 358 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
GLIVector2& mathglpp::GLIVector2< T >::operator+= | ( | const GLIVector2< T > & | gv | ) | [inline] |
Add a vector to this.
Definition at line 366 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator-= | ( | const GLVector2< T > & | gv | ) | [inline] |
Subtract a vector from this.
Definition at line 374 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
GLIVector2& mathglpp::GLIVector2< T >::operator-= | ( | const GLIVector2< T > & | gv | ) | [inline] |
Subtract a vector from this.
Definition at line 382 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator *= | ( | const T & | f | ) | [inline] |
Multiply this by a scalar.
Definition at line 390 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator/= | ( | const T & | f | ) | [inline] |
Divide this by a scalar.
Definition at line 398 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator= | ( | const GLVector2< T > & | v | ) | [inline] |
copy this from a vector
Definition at line 406 of file GLVector.h.
References mathglpp::GLIVector2< T >::D, mathglpp::GLVector2< T >::val, and mathglpp::GLIVector2< T >::val.
GLIVector2& mathglpp::GLIVector2< T >::operator= | ( | const GLIVector2< T > & | v | ) | [inline] |
copy this from a vector
Definition at line 410 of file GLVector.h.
References mathglpp::GLIVector2< T >::D, and mathglpp::GLIVector2< T >::val.
const GLVector2<T> mathglpp::GLIVector2< T >::operator- | ( | ) | const [inline] |
negate this
Definition at line 414 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
00415 { 00416 return GLVector2<T>(-val[0],-val[1]); 00417 }
const T mathglpp::GLIVector2< T >::dot | ( | const GLVector2< T > & | gv | ) | const [inline] |
Get the dot product of this and a vector.
Definition at line 420 of file GLVector.h.
References mathglpp::GLIVector2< T >::val, mathglpp::GLVector2< T >::x, and mathglpp::GLVector2< T >::y.
Referenced by mathglpp::GLIVector2< T >::projection(), and mathglpp::GLIVector2< T >::vectorProjection().
const T mathglpp::GLIVector2< T >::dot | ( | const GLIVector2< T > & | gv | ) | const [inline] |
Get the dot product of this and a vector.
Definition at line 424 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
T mathglpp::GLIVector2< T >::length | ( | ) | const [inline] |
Get the length of this.
Definition at line 428 of file GLVector.h.
References mathglpp::GLIVector2< T >::lengthSqr().
Referenced by mathglpp::GLIVector2< T >::normalize(), and mathglpp::GLIVector2< T >::unit().
00429 { return sqrt(lengthSqr()); }
Here is the call graph for this function:
T mathglpp::GLIVector2< T >::lengthSqr | ( | ) | const [inline] |
Get the length squared, less computation than length().
Definition at line 432 of file GLVector.h.
References mathglpp::GLIVector2< T >::val.
Referenced by mathglpp::GLIVector2< T >::length().
const GLVector2<T> mathglpp::GLIVector2< T >::unit | ( | ) | const [inline] |
Get the the unit vector of this.
Definition at line 436 of file GLVector.h.
References mathglpp::GLIVector2< T >::length().
00437 { 00438 return (*this)/length(); 00439 }
Here is the call graph for this function:
GLIVector2& mathglpp::GLIVector2< T >::normalize | ( | ) | [inline] |
Normalize this, makes this a unit vector, US spelling.
Definition at line 442 of file GLVector.h.
References mathglpp::GLIVector2< T >::length().
00443 { 00444 (*this)/=length(); 00445 return *this; 00446 }
Here is the call graph for this function:
const T mathglpp::GLIVector2< T >::projection | ( | const GLVector2< T > & | in | ) | const [inline] |
Get the projection of this and a vector.
Definition at line 449 of file GLVector.h.
References mathglpp::GLIVector2< T >::dot().
00450 { return dot(in); }
Here is the call graph for this function:
const T mathglpp::GLIVector2< T >::projection | ( | const GLIVector2< T > & | in | ) | const [inline] |
Get the projection of this and a vector.
Definition at line 453 of file GLVector.h.
References mathglpp::GLIVector2< T >::dot().
00454 { return dot(in); }
Here is the call graph for this function:
GLVector2<T> mathglpp::GLIVector2< T >::orthogonalProjection | ( | const GLVector2< T > & | in | ) | const [inline] |
Get the orthogonal projection of this and a vector.
Definition at line 457 of file GLVector.h.
References mathglpp::GLIVector2< T >::vectorProjection().
00458 { return in - vectorProjection(in); }
Here is the call graph for this function:
GLVector2<T> mathglpp::GLIVector2< T >::orthogonalProjection | ( | const GLIVector2< T > & | in | ) | const [inline] |
Get the orthogonal projection of this and a vector.
Definition at line 461 of file GLVector.h.
References mathglpp::GLIVector2< T >::vectorProjection().
00462 { return in - vectorProjection(in); }
Here is the call graph for this function:
GLVector2<T> mathglpp::GLIVector2< T >::vectorProjection | ( | const GLVector2< T > & | in | ) | const [inline] |
Get the vector projection of this and a vector.
Definition at line 465 of file GLVector.h.
References mathglpp::GLIVector2< T >::dot().
Referenced by mathglpp::GLIVector2< T >::orthogonalProjection().
00466 { return (*this) * dot(in); }
Here is the call graph for this function:
GLVector2<T> mathglpp::GLIVector2< T >::vectorProjection | ( | const GLIVector2< T > & | in | ) | const [inline] |
Get the vector projection of this and a vector.
Definition at line 469 of file GLVector.h.
References mathglpp::GLIVector2< T >::dot().
00470 { return (*this) * dot(in); }
Here is the call graph for this function: