zero() method added to all point classes

Only some of the mPointX classes had the zero() method implemented.
This commit adds the method to all point classes.
This commit is contained in:
DavidWyand-GG 2013-04-09 11:38:48 -04:00
parent a8d499f7f1
commit a40db9fa9b
3 changed files with 52 additions and 0 deletions

View file

@ -54,6 +54,7 @@ class Point3I
void set(S32 in_x, S32 in_y, S32 in_z); ///< Set co-ordinates.
void setMin(const Point3I&); ///< Store lesser co-ordinates in this point.
void setMax(const Point3I&); ///< Store greater co-ordinates in this point.
void zero(); ///< Zero all values
//-------------------------------------- Math mutators
void neg(); ///< Invert co-ordinate's signs.
@ -222,6 +223,7 @@ class Point3D
void setMax(const Point3D&);
void interpolate(const Point3D&, const Point3D&, F64);
void zero();
operator F64*() { return (&x); }
operator const F64*() const { return &x; }
@ -320,6 +322,11 @@ inline void Point3I::setMax(const Point3I& _test)
z = (_test.z > z) ? _test.z : z;
}
inline void Point3I::zero()
{
x = y = z = 0;
}
inline void Point3I::neg()
{
x = -x;
@ -810,6 +817,11 @@ inline void Point3D::interpolate(const Point3D& _from, const Point3D& _to, F64 _
m_point3D_interpolate( _from, _to, _factor, *this);
}
inline void Point3D::zero()
{
x = y = z = 0.0;
}
inline bool Point3D::isZero() const
{
return (x == 0.0f) && (y == 0.0f) && (z == 0.0f);