mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-21 05:10:53 +00:00
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:
parent
a8d499f7f1
commit
a40db9fa9b
3 changed files with 52 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue