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