Create and play with a Position3D. More...
#include <alposition3d.h>
Public Member Functions | |
Position3D () | |
Create a Position3D initialize with 0.0f. More... | |
Position3D (float pInit) | |
Create a Position3D initialize with the same float. More... | |
Position3D (float pX, float pY, float pZ) | |
Create a Position3D initialize with explicit value. More... | |
Position3D (const std::vector< float > &pFloats) | |
Create a Position3D with an std::vector. More... | |
Position3D | operator+ (const Position3D &pPos2) const |
Overloading of operator + for Position3D. More... | |
Position3D | operator- (const Position3D &pPos2) const |
Overloading of operator - for Position3D. More... | |
Position3D | operator+ (void) const |
Overloading of operator + for Position3D. More... | |
Position3D | operator- () const |
Overloading of operator - for Position3D. More... | |
Position3D & | operator+= (const Position3D &pPos2) |
Overloading of operator += for Position3D. More... | |
Position3D & | operator-= (const Position3D &pPos2) |
Overloading of operator -= for Position3D. More... | |
bool | operator== (const Position3D &pPos2) const |
Overloading of operator == for Position3D. More... | |
bool | operator!= (const Position3D &pPos2) const |
Overloading of operator != for Position3D. More... | |
Position3D | operator* (float pVal) const |
Overloading of operator * for Position3D. More... | |
Position3D | operator/ (float pVal) const |
Overloading of operator / for Position3D. More... | |
Position3D & | operator*= (float pVal) |
Overloading of operator *= for Position3D. More... | |
Position3D & | operator/= (float pVal) |
Overloading of operator /= for Position3D. More... | |
float | distanceSquared (const Position3D &pPos2) const |
Compute the squared distance between the actual Position3D and the one given in argument. More... | |
float | distance (const Position3D &pPos2) const |
Compute the distance between the actual Position3D and the one given in argument. More... | |
bool | isNear (const Position3D &pPos2, const float &pEpsilon=0.0001f) const |
Check if the actual Position3D is near the one give in argument. More... | |
float | norm () const |
Compute the norm of the actual Position3D. More... | |
Position3D | normalize () const |
Normalize the actual Position3D. More... | |
float | dotProduct (const Position3D &pPos2) const |
Compute the dot Product between the actual Position3D and the one give in argument. More... | |
Position3D | crossProduct (const Position3D &pPos2) const |
Compute the cross Product between the actual Position3D and the one give in argument. More... | |
void | toVector (std::vector< float > &pReturnVector) const |
Return the Position3D as a vector of float [x, y, z]. More... | |
std::vector< float > | toVector (void) const |
void | writeToVector (std::vector< float >::iterator &pIt) const |
Write [x, y, z] in the vector and update the iterator. It is assumed the vector has enough space. More... | |
bool | isUnitVector (const float &pEpsilon=0.0001f) const |
Checks if the norm of the Position3D is near to 1.0 More... | |
bool | isOrthogonal (const Position3D &pPos, const float &pEpsilon=0.0001f) const |
Checks if this Position3D is orthogonal to Position3D pPos More... | |
Public Attributes | |
float | x |
float | y |
float | z |
Create and play with a Position3D.
A Position3D is just defined by x, y and z.
Definition at line 23 of file alposition3d.h.
AL::Math::Position3D::Position3D | ( | ) |
Create a Position3D initialize with 0.0f.
|
explicit |
Create a Position3D initialize with the same float.
pInit | the float value for each member |
AL::Math::Position3D::Position3D | ( | float | pX, |
float | pY, | ||
float | pZ | ||
) |
Create a Position3D initialize with explicit value.
pX | the float value for x |
pY | the float value for y |
pZ | the float value for z |
AL::Math::Position3D::Position3D | ( | const std::vector< float > & | pFloats | ) |
Create a Position3D with an std::vector.
pFloats | An std::vector<float> of size 3 for respectively: x, y and z |
Position3D AL::Math::Position3D::crossProduct | ( | const Position3D & | pPos2 | ) | const |
Compute the cross Product between the actual Position3D and the one give in argument.
pPos2 | the second Position3D |
float AL::Math::Position3D::distance | ( | const Position3D & | pPos2 | ) | const |
Compute the distance between the actual Position3D and the one given in argument.
pPos2 | the second Position3D |
float AL::Math::Position3D::distanceSquared | ( | const Position3D & | pPos2 | ) | const |
Compute the squared distance between the actual Position3D and the one given in argument.
pPos2 | the second Position3D |
float AL::Math::Position3D::dotProduct | ( | const Position3D & | pPos2 | ) | const |
Compute the dot Product between the actual Position3D and the one give in argument.
pPos2 | the second Position3D |
bool AL::Math::Position3D::isNear | ( | const Position3D & | pPos2, |
const float & | pEpsilon = 0.0001f |
||
) | const |
Check if the actual Position3D is near the one give in argument.
pPos2 | the second Position3D |
pEpsilon | an optional epsilon distance |
float AL::Math::Position3D::norm | ( | ) | const |
Position3D AL::Math::Position3D::normalize | ( | ) | const |
bool AL::Math::Position3D::operator!= | ( | const Position3D & | pPos2 | ) | const |
Overloading of operator != for Position3D.
pPos2 | the second Position3D |
Position3D AL::Math::Position3D::operator* | ( | float | pVal | ) | const |
Overloading of operator * for Position3D.
pVal | the float factor |
Position3D& AL::Math::Position3D::operator*= | ( | float | pVal | ) |
Overloading of operator *= for Position3D.
pVal | the float factor |
|
inline |
Overloading of operator + for Position3D.
pPos2 | the second Position3D |
Definition at line 119 of file alposition3d.h.
|
inline |
Overloading of operator + for Position3D.
Definition at line 136 of file alposition3d.h.
Position3D& AL::Math::Position3D::operator+= | ( | const Position3D & | pPos2 | ) |
Overloading of operator += for Position3D.
pPos2 | the second Position3D |
|
inline |
Overloading of operator - for Position3D.
pPos2 | the second Position3D |
Definition at line 128 of file alposition3d.h.
|
inline |
Overloading of operator - for Position3D.
Definition at line 144 of file alposition3d.h.
Position3D& AL::Math::Position3D::operator-= | ( | const Position3D & | pPos2 | ) |
Overloading of operator -= for Position3D.
pPos2 | the second Position3D |
Position3D AL::Math::Position3D::operator/ | ( | float | pVal | ) | const |
Overloading of operator / for Position3D.
pVal | the float factor |
Position3D& AL::Math::Position3D::operator/= | ( | float | pVal | ) |
Overloading of operator /= for Position3D.
pVal | the float factor |
bool AL::Math::Position3D::operator== | ( | const Position3D & | pPos2 | ) | const |
Overloading of operator == for Position3D.
pPos2 | the second Position3D |
void AL::Math::Position3D::toVector | ( | std::vector< float > & | pReturnVector | ) | const |
Return the Position3D as a vector of float [x, y, z].
std::vector<float> AL::Math::Position3D::toVector | ( | void | ) | const |
void AL::Math::Position3D::writeToVector | ( | std::vector< float >::iterator & | pIt | ) | const |
Write [x, y, z] in the vector and update the iterator. It is assumed the vector has enough space.
float AL::Math::Position3D::x |
Definition at line 25 of file alposition3d.h.
float AL::Math::Position3D::y |
Definition at line 27 of file alposition3d.h.
float AL::Math::Position3D::z |
Definition at line 29 of file alposition3d.h.