17#ifndef __albaVect3d_H__
18#define __albaVect3d_H__
81 inline double GetX(){
return m_X;};
84 inline double GetY(){
return m_Y;};
87 inline double GetZ(){
return m_Z;};
90 inline void SetX(
double x){m_X=x;};
93 inline void SetY(
double y){m_Y=y;};
96 inline void SetZ(
double z){m_Z=z;};
99 inline double*
GetVect(){
return (
double*)
this;};
102 inline void GetVect(
double *vect) { vect[0] = m_X; vect[1] = m_Y; vect[2] = m_Z; };
158 double m_X, m_Y, m_Z;
void SetY(double y)
the Value of the Y-element
albaVect3d operator+(albaVect3d &vect)
Operator: Return the sum of the vectors.
albaVect3d operator-(albaVect3d &vect)
Operator: Return the difference of the vectors.
albaVect3d & operator+=(albaVect3d &vect)
Operator: Sets the values to the sum between the vectors.
albaVect3d Cross(albaVect3d &vector)
Return the cross product between the vectors.
void GetVect(double *vect)
Return a pointer to the vector of double.
double GetX()
Return the Value of the X-element.
static albaVect3d Slerp(albaVect3d start, albaVect3d end, double percent)
Do a spherical linear interpolation of two vectors.
void Normalize(void)
Normalize the components of the vector.
albaVect3d operator-(double *vect)
Operator: Return the difference of the vectors.
void Setzero(void)
Sets the vector to zero.
albaVect3d & operator-=(double *vect)
Operator: Sets the values to the difference between the vectors.
albaVect3d(double x, double y, double z)
Constructor, sets the vector values.
albaVect3d & operator+=(double *vect)
Operator: Sets the values to the sum between the vectors.
int operator==(double *vect)
Operator: Return true if the vectors are equals.
albaVect3d Normal(void)
Return the normal of the vector (the original vector is not modified()
albaVect3d & operator/=(double val)
Operator: Sets the values to the division with the scalar.
double GetY()
Return the Value of the Y-element.
void SetValues(double x, double y, double z)
Sets the vector values.
albaVect3d Abs(void)
Return a vector whit the abs of each element.
double Magnitude(void)
Returns the magnitude of the vector.
double & operator[](int pos)
Operator: Gets the vect values with *double style ie: vect[0]==vect.GetX()
double AngleBetweenVectors(albaVect3d &vect, bool getMinAngle=true)
Returns the angle between two vectors.
int operator==(albaVect3d &vect)
Operator: Return true if the vectors are equals.
double GetZ()
Return the Value of the Z-element.
albaVect3d operator+(double *vect)
Operator: Return the sum of the vectors.
void SetZ(double z)
the Value of the Z-element
double Distance(albaVect3d &vector)
Return the distance between the vectors.
double Distance2(albaVect3d &vector)
Return the distance2 (quadratic distance) between the vectors.
albaVect3d & operator-=(albaVect3d &vect)
Operator: Sets the values to the difference between the vectors.
double Dot(albaVect3d &vector)
Return the dot product between the vectors.
double * GetVect()
Return a pointer to the vector of double.
void SetValues(double *values)
Sets the vector values.
albaVect3d & operator*=(double val)
Operator: Sets the values to the product with the scalar.
albaVect3d()
Default constructor, init to zero.
albaVect3d operator*(double num)
Operator: Return the scalar multiply.
albaVect3d(double *values)
Constructor, sets the vector values.
albaVect3d operator/(double num)
Operator: Return the scalar division.
void SetX(double x)
the Value of the X-element