#include <vectorMath.h>
Public Member Functions | |
Create methods | |
CVector3D () | |
Create a zero vector. | |
CVector3D (const unit inX, const unit inY, const unit inZ) | |
Create using 3 unit values. | |
CVector3D (const CVector3D &inVec) | |
Create using another vector. | |
CVector3D (const VECTOR *inVec) | |
Create using an Acknex vector. | |
Set/Reset methods | |
void | set (const unit inX, const unit inY, const unit inZ) |
Set using 3 unit values. | |
void | reset () |
Reset all values to zero. | |
void | x (const unit f) |
Set x. | |
void | y (const unit f) |
Set y. | |
void | z (const unit f) |
Set z. | |
unit | x () const |
Get x. | |
unit | y () const |
Get y. | |
unit | z () const |
Get z. | |
Add methods | |
void | add (const unit inX, const unit inY, const unit inZ) |
Add to the current values. | |
void | addX (const unit f) |
Add to the current X value. | |
void | addY (const unit f) |
Add to the current Y value. | |
void | addZ (const unit f) |
Add to the current Z value. | |
Compare methods | |
bool | is_close_to (const CVector3D &b) const |
| |
bool | is_close_to_zero () const |
| |
Move/Rotate methods | |
CVector3D | move (const CAngle3D &ang, const unit f) |
Create a new vector by moving f units along an angle from the current vector. | |
CVector3D | move (const CAngle3D &ang, const CVector3D &moveVec) |
Create a new vector by adding the rotated moveVec to the current vector. | |
void | rotate (const CAngle3D &ang) |
Rotate x,y,z values around origin by angle ang. | |
Operator Overloads | |
CVector3D | operator+ (const CVector3D &inVec) const |
Add two vectors. | |
CVector3D | operator- (const CVector3D &inVec) const |
Subtract vectors. | |
CVector3D | operator * (const unit f) const |
Scale vector. | |
void | operator *= (const unit f) |
Scale vector. | |
CVector3D | operator/ (const unit f) const |
Reduce vector. | |
void | operator+= (const CVector3D &inVec) |
Add another vector. | |
void | operator-= (const CVector3D &inVec) |
Subtract another vector. | |
CVector3D | operator * (const CVector3D &inVec) const |
Scale the values of the first vector by the values of the second. | |
void | operator *= (const CVector3D &inVec) |
Scale the values of this vector by the values of the other vector. | |
Misc methods | |
unit | get_pan () const |
| |
unit | get_tilt () const |
| |
void | get_array (unit array[]) const |
Get vector values as an array. | |
unit | get_length () const |
unit | get_length_sq () const |
CVector3D | get_normalized (const unit f=1.0) const |
Change the length of the vector (keeping the direction). |
(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.
Create a new vector by moving f units along an angle from the current vector.
ang | Angle we are moving along. | |
f | Distance moved. |
ang | Angle of rotation | |
f | Lenth of movement vector |
Create a new vector by adding the rotated moveVec to the current vector.
ang | Angle we are moving along. | |
moveVec | Vector to be rotated. |
ang | Angle of rotation | |
moveVec | Movement vector |
void CVector3D::rotate | ( | const CAngle3D & | ang | ) |
Rotate x,y,z values around origin by angle ang.
ang | Angle used for rotation. |
ang | Angle of rotation |
ang | rotate x,y,z values around origin by angle ang |
void CVector3D::get_array | ( | unit | array[] | ) | const [inline] |
Get vector values as an array.
array | A unit array of at least 3 values. |
unit CVector3D::get_length | ( | ) | const [inline] |
unit CVector3D::get_length_sq | ( | ) | const [inline] |
CVector3D CVector3D::get_normalized | ( | const unit | f = 1.0 |
) | const [inline] |
Change the length of the vector (keeping the direction).
f | New length. |