12 #ifndef __ICEHPOINT_H__ 13 #define __ICEHPOINT_H__ 34 inline_ HPoint&
Set(
float _x,
float _y,
float _z,
float _w ) {
x = _x;
y = _y; z = _z;
w = _w;
return *
this; }
41 inline_ HPoint&
Add(
float _x,
float _y,
float _z,
float _w ) {
x += _x;
y += _y; z += _z;
w += _w;
return *
this; }
46 inline_ HPoint&
Sub(
float _x,
float _y,
float _z,
float _w ) {
x -= _x;
y -= _y; z -= _z;
w -= _w;
return *
this; }
159 #endif // __ICEHPOINT_H__ inline_ HPoint(const Point &p, float _w=0.0f)
Constructor from a Point.
inline_ float Magnitude() const
Computes magnitude.
#define MAX(a, b)
Returns the max value between a and b.
inline_ HPoint operator*(float s) const
Operator for HPoint Scale = HPoint * float;.
inline_ HPoint & operator+=(float s)
Operator for HPoint += float;.
float Min() const
Returns MIN(x, y, z, w);.
inline_ friend HPoint operator/(float s, const HPoint &p)
Operator for HPoint Scale = float / HPoint;.
HPoint & Min(const HPoint &p)
Sets each element to be componentwise minimum.
inline_ HPoint()
Empty constructor.
inline_ float Magnitude() const
Computes magnitude.
inline_ HPoint & operator/=(const HPoint &p)
Operator for HPoint /= HPoint;.
#define MIN(a, b)
Returns the min value between a and b.
inline_ HPoint & operator*=(const HPoint &p)
Operator for HPoint *= HPoint;.
inline_ HPoint operator*(const HPoint &p) const
Operator for HPoint Mul = HPoint * HPoint;.
inline_ bool operator!=(const HPoint &p) const
Operator for "if(HPoint!=HPoint)".
inline_ float SquareMagnitude() const
Computes square magnitude.
inline_ HPoint & Sub(float _x, float _y, float _z, float _w)
Subtract a vector.
inline_ HPoint & Mul(float s)
Multiplies by a scalar.
inline_ Point & operator*=(const Point &p)
Operator for Point *= Point.
inline_ Point operator*(const Point &p) const
Operator for Point Mul = Point * Point.
inline_ HPoint & Sub(const float f[4])
Subtract a vector.
inline_ HPoint operator+(const HPoint &p) const
Operator for HPoint Plus = HPoint + HPoint;.
inline_ HPoint & Set(float _x, float _y, float _z, float _w)
Assignment from values.
inline_ HPoint operator/(const HPoint &p) const
Operator for HPoint Div = HPoint / HPoint;.
inline_ HPoint operator-(const HPoint &p) const
Operator for HPoint Minus = HPoint - HPoint;.
HPoint & Max(const HPoint &p)
Sets each element to be componentwise maximum.
inline_ HPoint & Set(const HPoint &src)
Assignment from another h-point.
inline_ HPoint & Set(const float f[4])
Assignment from array.
inline_ HPoint & Add(const float f[4])
Add a vector.
inline_ ~HPoint()
Destructor.
inline_ HPoint & operator/=(float s)
Operator for HPoint /= float;.
inline_ HPoint(const float f[4])
Constructor from array.
inline_ HPoint & operator*=(float s)
Operator for HPoint *= float;.
inline_ HPoint & operator-=(const HPoint &p)
Operator for HPoint -= HPoint;.
float w
Cast a HPoint to a Point. w is discarded.
inline_ HPoint operator-() const
Operator for HPoint Negate = - HPoint;.
inline_ float operator|(const HPoint &p) const
Operator for float DotProd = HPoint | HPoint;.
inline_ HPoint & Zero()
Clear the point.
inline_ HPoint & Add(float _x, float _y, float _z, float _w)
Add a vector.
inline_ HPoint & operator+=(const HPoint &p)
Operator for HPoint += HPoint;.
float Max() const
Returns MAX(x, y, z, w);.
inline_ Point()
Empty constructor.
inline_ bool operator==(const HPoint &p) const
Operator for "if(HPoint==HPoint)".
inline_ HPoint(float _x, float _y, float _z, float _w=0.0f)
Constructor from floats.
inline_ HPoint & operator-=(float s)
Operator for HPoint -= float;.
inline_ friend HPoint operator*(float s, const HPoint &p)
Operator for HPoint Scale = float * HPoint;.
inline_ HPoint & Normalize()
Normalize the vector.
inline_ HPoint operator/(float s) const
Operator for HPoint Scale = HPoint / float;.