libalmath  1.14.5
 All Classes Namespaces Functions Variables
Public Member Functions | Public Attributes
AL::Math::Velocity3D Struct Reference

Create and play with a Velocity3D. More...

#include <alvelocity3d.h>

List of all members.

Public Member Functions

 Velocity3D ()
 Create a Velocity3D initialize with 0.0f.
 Velocity3D (float pInit)
 Create a Velocity3D initialize with the same float.
 Velocity3D (float pXd, float pYd, float pZd)
 Create a Velocity3D initialize with explicit value.
 Velocity3D (const std::vector< float > &pFloats)
 Create a Velocity3D with an std::vector.
Velocity3D operator+ (const Velocity3D &pVel2) const
 Overloading of operator + for Velocity3D.
Velocity3D operator- (const Velocity3D &pVel2) const
 Overloading of operator - for Velocity3D.
Velocity3D operator+ () const
 Overloading of operator + for Velocity3D.
Velocity3D operator- () const
 Overloading of operator - for Velocity3D.
Velocity3Doperator+= (const Velocity3D &pVel2)
 Overloading of operator += for Velocity3D.
Velocity3Doperator-= (const Velocity3D &pVel2)
 Overloading of operator -= for Velocity3D.
bool operator== (const Velocity3D &pVel2) const
 Overloading of operator == for Velocity3D.
bool operator!= (const Velocity3D &pVel2) const
 Overloading of operator != for Velocity3D.
Velocity3D operator* (const float pVal) const
 Overloading of operator * for Velocity3D.
Velocity3D operator/ (const float pVal) const
 Overloading of operator / for Velocity3D.
Velocity3Doperator*= (const float pVal)
 Overloading of operator *= for Velocity3D.
Velocity3Doperator/= (const float pVal)
 Overloading of operator /= for Velocity3D.
bool isNear (const Velocity3D &pVel2, const float &pEpsilon=0.0001f) const
 Check if the actual Velocity3D is Near the one given in argument.
float norm () const
 Compute the norm of the actual Velocity3D:
Velocity3D normalize () const
 Normalize the actual Velocity3D:
std::vector< float > toVector () const
 Return the Velocity3D as a vector of float [xd, yd, zd].

Public Attributes

float xd
float yd
float zd

Detailed Description

Create and play with a Velocity3D.

A Velocity3D is just defined by xd, yd and zd.

Definition at line 23 of file alvelocity3d.h.


Constructor & Destructor Documentation

Create a Velocity3D initialize with 0.0f.

$ \left[\begin{array}{c} xd \\ yd \\ zd \end{array}\right] = \left[\begin{array}{c} 0.0 \\ 0.0 \\ 0.0 \end{array}\right]$

AL::Math::Velocity3D::Velocity3D ( float  pInit) [explicit]

Create a Velocity3D initialize with the same float.

$ \left[\begin{array}{c} xd \\ yd \\ zd \end{array}\right] = \left[\begin{array}{c} pInit \\ pInit \\ pInit \end{array}\right]$

Parameters:
pInitthe float value for each member
AL::Math::Velocity3D::Velocity3D ( float  pXd,
float  pYd,
float  pZd 
)

Create a Velocity3D initialize with explicit value.

$ \left[\begin{array}{c} xd \\ yd \\ zd \end{array}\right] = \left[\begin{array}{c} pXd \\ pYd \\ pZd \end{array}\right]$

Parameters:
pXdthe float value for xd
pYdthe float value for yd
pZdthe float value for zd
AL::Math::Velocity3D::Velocity3D ( const std::vector< float > &  pFloats)

Create a Velocity3D with an std::vector.

$ \left[\begin{array}{c} xd \\ yd \\ zd \end{array}\right] = \left[\begin{array}{c} pFloats[0] \\ pFloats[1] \\ pFloats[2] \end{array}\right]$

Parameters:
pFloatsAn std::vector<float> of size 3 for respectively: xd, yd, zd

Member Function Documentation

bool AL::Math::Velocity3D::isNear ( const Velocity3D pVel2,
const float &  pEpsilon = 0.0001f 
) const

Check if the actual Velocity3D is Near the one given in argument.

Parameters:
pVel2the second Velocity3D
pEpsilonan optional epsilon distance
Returns:
true if the difference of each float of the two Velocity3D is less than pEpsilon
float AL::Math::Velocity3D::norm ( ) const

Compute the norm of the actual Velocity3D:

$\sqrt{pVel.xd^2 + pVel.yd^2 + pVel.zd^2}$

Returns:
the float norm of the Velocity3D

Normalize the actual Velocity3D:

$ result = \frac{pVel}{norm(pVel)} $

Returns:
the Velocity3D normalized
bool AL::Math::Velocity3D::operator!= ( const Velocity3D pVel2) const

Overloading of operator != for Velocity3D.

Parameters:
pVel2the second Velocity3D
Velocity3D AL::Math::Velocity3D::operator* ( const float  pVal) const

Overloading of operator * for Velocity3D.

Parameters:
pValthe float factor
Velocity3D& AL::Math::Velocity3D::operator*= ( const float  pVal)

Overloading of operator *= for Velocity3D.

Parameters:
pValthe float factor
Velocity3D AL::Math::Velocity3D::operator+ ( const Velocity3D pVel2) const

Overloading of operator + for Velocity3D.

Parameters:
pVel2the second Velocity3D
Velocity3D AL::Math::Velocity3D::operator+ ( ) const

Overloading of operator + for Velocity3D.

Velocity3D& AL::Math::Velocity3D::operator+= ( const Velocity3D pVel2)

Overloading of operator += for Velocity3D.

Parameters:
pVel2the second Velocity3D
Velocity3D AL::Math::Velocity3D::operator- ( const Velocity3D pVel2) const

Overloading of operator - for Velocity3D.

Parameters:
pVel2the second Velocity3D
Velocity3D AL::Math::Velocity3D::operator- ( ) const

Overloading of operator - for Velocity3D.

Velocity3D& AL::Math::Velocity3D::operator-= ( const Velocity3D pVel2)

Overloading of operator -= for Velocity3D.

Parameters:
pVel2the second Velocity3D
Velocity3D AL::Math::Velocity3D::operator/ ( const float  pVal) const

Overloading of operator / for Velocity3D.

Parameters:
pValthe float factor
Velocity3D& AL::Math::Velocity3D::operator/= ( const float  pVal)

Overloading of operator /= for Velocity3D.

Parameters:
pValthe float factor
bool AL::Math::Velocity3D::operator== ( const Velocity3D pVel2) const

Overloading of operator == for Velocity3D.

Parameters:
pVel2the second Velocity3D
std::vector<float> AL::Math::Velocity3D::toVector ( ) const

Return the Velocity3D as a vector of float [xd, yd, zd].


Member Data Documentation

Definition at line 25 of file alvelocity3d.h.

Definition at line 27 of file alvelocity3d.h.

Definition at line 29 of file alvelocity3d.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables