37 inline T
x(
void)
const {
return m_x; }
40 inline T
y(
void)
const {
return m_y; }
43 inline T
z(
void)
const {
return m_z; }
47 void setX(T _x) { m_x = _x; }
51 void setY(T _y) { m_y = _y; }
55 void setZ(T _z) { m_z = _z; }
96 m_x = _other.
x(); m_y = _other.
y(); m_z = _other.
z();
101 Point3D<T> ret(m_x + _other.m_x, m_y + _other.m_y, m_z + _other.m_z);
106 Point3D<T> ret(m_x - _other.m_x, m_y - _other.m_y, m_z - _other.m_z);
111 Point3D<T> ret(m_x * _other.m_x, m_y * _other.m_y, m_z * _other.m_z);
119 if (_other.m_x != 0) { x /= _other.m_x; }
120 if (_other.m_y != 0) { y /= _other.m_y; }
121 if (_other.m_z != 0) { z /= _other.m_z; }
127 m_x = m_x + _other.m_x;
128 m_y = m_y + _other.m_y;
129 m_z = m_z + _other.m_z;
134 m_x = m_x - _other.m_x;
135 m_y = m_y - _other.m_y;
136 m_z = m_z - _other.m_z;
141 m_x = m_x * _other.m_x;
142 m_y = m_y * _other.m_y;
143 m_z = m_z * _other.m_z;
148 if (_other.m_x != 0) { m_x /= _other.m_x; }
149 if (_other.m_y != 0) { m_y /= _other.m_y; }
150 if (_other.m_z != 0) { m_z /= _other.m_z; }
155 if (m_x != _other.
x()) {
return false; }
156 if (m_y != _other.
y()) {
return false; }
157 if (m_z != _other.
z()) {
return false; }
Three dimensional point.
Definition Point3D.h:12
Point3D< T > operator-(const Point3D< T > &_other) const
Definition Point3D.h:105
T x(void) const
Returns the current X value.
Definition Point3D.h:37
Point3D< T > & operator-=(const Point3D< T > &_other)
Definition Point3D.h:133
T addX(T _v)
Will add the provided value to the X value and return the new X value.
Definition Point3D.h:163
Point3D< T > operator+(const Point3D< T > &_other) const
Definition Point3D.h:100
Point3D< T > & operator*=(const Point3D< T > &_other)
Definition Point3D.h:140
Point3D< T > operator/(const Point3D< T > &_other) const
Definition Point3D.h:115
Point3D< T > & operator+=(const Point3D< T > &_other)
Definition Point3D.h:126
Point3D< T > operator*(const Point3D< T > &_other) const
Definition Point3D.h:110
bool operator!=(const Point3D< T > &_other)
Definition Point3D.h:161
T addY(T _v)
Will add the provided value to the Y value and return the new Y value.
Definition Point3D.h:165
void setZ(T _z)
Will set the Z value.
Definition Point3D.h:55
T subY(T _v)
Will subtract the provided value from the Y value and return the new Y value.
Definition Point3D.h:171
bool operator==(const Point3D< T > &_other)
Definition Point3D.h:154
T y(void) const
Returns the current Y value.
Definition Point3D.h:40
T subZ(T _v)
Will subtract the provided value from the Z value and return the new Z value.
Definition Point3D.h:173
Point3D< T > & operator/=(const Point3D< T > &_other)
Definition Point3D.h:147
void setY(T _y)
Will set the Y value.
Definition Point3D.h:51
T subX(T _v)
Will subtract the provided value from the X value and return the new X value.
Definition Point3D.h:169
void setX(T _x)
Will set the X value.
Definition Point3D.h:47
T addZ(T _z)
Will add the provided value to the Z value and return the new Z value.
Definition Point3D.h:167
T z(void) const
Returns the current Z value.
Definition Point3D.h:43
Point3D< T > & operator=(const Point3D< T > &_other)
Definition Point3D.h:95