Create and play with a Position3D. More...
#include <alposition3d.h>
Public Member Functions | |
Position3D () | |
Create a Position3D initialize with 0.0f. | |
Position3D (float pInit) | |
Create a Position3D initialize with the same float. | |
Position3D (float pX, float pY, float pZ) | |
Create a Position3D initialize with explicit value. | |
Position3D (const std::vector< float > &pFloats) | |
Create a Position3D with an std::vector. | |
Position3D | operator+ (const Position3D &pPos2) const |
Overloading of operator + for Position3D. | |
Position3D | operator- (const Position3D &pPos2) const |
Overloading of operator - for Position3D. | |
Position3D | operator+ () const |
Overloading of operator + for Position3D. | |
Position3D | operator- () const |
Overloading of operator - for Position3D. | |
Position3D & | operator+= (const Position3D &pPos2) |
Overloading of operator += for Position3D. | |
Position3D & | operator-= (const Position3D &pPos2) |
Overloading of operator -= for Position3D. | |
bool | operator== (const Position3D &pPos2) const |
Overloading of operator == for Position3D. | |
bool | operator!= (const Position3D &pPos2) const |
Overloading of operator != for Position3D. | |
Position3D | operator* (float pVal) const |
Overloading of operator * for Position3D. | |
Position3D | operator/ (float pVal) const |
Overloading of operator / for Position3D. | |
Position3D & | operator*= (float pVal) |
Overloading of operator *= for Position3D. | |
Position3D & | operator/= (float pVal) |
Overloading of operator /= for Position3D. | |
float | distanceSquared (const Position3D &pPos2) const |
Compute the squared distance between the actual Position3D and the one given in argument. | |
float | distance (const Position3D &pPos2) const |
Compute the distance between the actual Position3D and the one given in argument. | |
bool | isNear (const Position3D &pPos2, const float &pEpsilon=0.0001f) const |
Check if the actual Position3D is near the one give in argument. | |
float | norm () const |
Compute the norm of the actual Position3D. | |
Position3D | normalize () const |
Normalize the actual Position3D. | |
float | dotProduct (const Position3D &pPos2) const |
Compute the dot Product between the actual Position3D and the one give in argument. | |
Position3D | crossProduct (const Position3D &pPos2) const |
Compute the cross Product between the actual Position3D and the one give in argument. | |
std::vector< float > | toVector () const |
Return the Position3D as a vector of float [x, y, z]. |
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 optionnal epsilon distance |
float AL::Math::Position3D::norm | ( | ) | const |
Compute the norm of the actual Position3D.
Position3D AL::Math::Position3D::normalize | ( | ) | const |
Normalize the actual Position3D.
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 |
Position3D AL::Math::Position3D::operator+ | ( | const Position3D & | pPos2 | ) | const |
Overloading of operator + for Position3D.
pPos2 | the second Position3D |
Position3D AL::Math::Position3D::operator+ | ( | ) | const |
Overloading of operator + for Position3D.
Position3D& AL::Math::Position3D::operator+= | ( | const Position3D & | pPos2 | ) |
Overloading of operator += for Position3D.
pPos2 | the second Position3D |
Position3D AL::Math::Position3D::operator- | ( | const Position3D & | pPos2 | ) | const |
Overloading of operator - for Position3D.
pPos2 | the second Position3D |
Position3D AL::Math::Position3D::operator- | ( | ) | const |
Overloading of operator - for Position3D.
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 |
std::vector<float> AL::Math::Position3D::toVector | ( | ) | const |
Return the Position3D as a vector of float [x, y, z].
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.