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

@ -48,6 +48,7 @@ class Point2I
void set(S32 in_x, S32 in_y); ///< Set (x,y) position
void setMin(const Point2I&); ///< Store lesser co-ordinates from parameter in this point.
void setMax(const Point2I&); ///< Store greater co-ordinates from parameter in this point.
void zero(); ///< Zero all values
//-------------------------------------- Math mutators
void neg(); ///< Invert sign of point's co-ordinates.
@ -123,6 +124,8 @@ class Point2F
/// @param c Interpolation factor (0.0 .. 1.0).
void interpolate(const Point2F& a, const Point2F& b, const F32 c);
void zero(); ///< Zero all values
operator F32*() { return &x; }
operator const F32*() const { return &x; }
@ -213,6 +216,8 @@ class Point2D
/// @param c Interpolation factor (0.0 .. 1.0).
void interpolate(const Point2D &a, const Point2D &b, const F64 c);
void zero(); ///< Zero all values
operator F64*() { return &x; }
operator const F64*() const { return &x; }
@ -301,6 +306,12 @@ inline void Point2I::setMax(const Point2I& _test)
}
inline void Point2I::zero()
{
x = y = 0;
}
inline void Point2I::neg()
{
x = -x;
@ -483,6 +494,12 @@ inline void Point2F::interpolate(const Point2F& _rFrom, const Point2F& _to, cons
}
inline void Point2F::zero()
{
x = y = 0.0f;
}
inline bool Point2F::isZero() const
{
return (x == 0.0f) && (y == 0.0f);
@ -720,6 +737,12 @@ inline void Point2D::interpolate(const Point2D& _rFrom, const Point2D& _to, cons
}
inline void Point2D::zero()
{
x = y = 0.0;
}
inline bool Point2D::isZero() const
{
return (x == 0.0f) && (y == 0.0f);