IcePoint.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICEPOINT_H__
13 #define __ICEPOINT_H__
14 
15  // Forward declarations
16  class HPoint;
17  class Plane;
18  class Matrix3x3;
19  class Matrix4x4;
20 
21  #define CROSS2D(a, b) (a.x*b.y - b.x*a.y)
22 
23  const float EPSILON2 = 1.0e-20f;
24 
26  {
27  public:
28 
32 // inline_ Point(float val) : x(val), y(val), z(val) {}
33 // Removed since it introduced the nasty "Point T = *Matrix4x4.GetTrans();" bug.......
35  inline_ Point(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
37  inline_ Point(const float f[3]) : x(f[_X]), y(f[_Y]), z(f[_Z]) {}
39  inline_ Point(const Point& p) : x(p.x), y(p.y), z(p.z) {}
42 
44  inline_ Point& Zero() { x = y = z = 0.0f; return *this; }
45 
47  inline_ Point& SetPlusInfinity() { x = y = z = MAX_FLOAT; return *this; }
49  inline_ Point& SetMinusInfinity() { x = y = z = MIN_FLOAT; return *this; }
50 
52  Point& PositiveUnitRandomVector();
54  Point& UnitRandomVector();
55 
57  inline_ Point& Set(float _x, float _y, float _z) { x = _x; y = _y; z = _z; return *this; }
59  inline_ Point& Set(const float f[3]) { x = f[_X]; y = f[_Y]; z = f[_Z]; return *this; }
61  inline_ Point& Set(const Point& src) { x = src.x; y = src.y; z = src.z; return *this; }
62 
64  inline_ Point& Add(const Point& p) { x += p.x; y += p.y; z += p.z; return *this; }
66  inline_ Point& Add(float _x, float _y, float _z) { x += _x; y += _y; z += _z; return *this; }
68  inline_ Point& Add(const float f[3]) { x += f[_X]; y += f[_Y]; z += f[_Z]; return *this; }
70  inline_ Point& Add(const Point& p, const Point& q) { x = p.x+q.x; y = p.y+q.y; z = p.z+q.z; return *this; }
71 
73  inline_ Point& Sub(const Point& p) { x -= p.x; y -= p.y; z -= p.z; return *this; }
75  inline_ Point& Sub(float _x, float _y, float _z) { x -= _x; y -= _y; z -= _z; return *this; }
77  inline_ Point& Sub(const float f[3]) { x -= f[_X]; y -= f[_Y]; z -= f[_Z]; return *this; }
79  inline_ Point& Sub(const Point& p, const Point& q) { x = p.x-q.x; y = p.y-q.y; z = p.z-q.z; return *this; }
80 
82  inline_ Point& Neg() { x = -x; y = -y; z = -z; return *this; }
84  inline_ Point& Neg(const Point& a) { x = -a.x; y = -a.y; z = -a.z; return *this; }
85 
87  inline_ Point& Mult(float s) { x *= s; y *= s; z *= s; return *this; }
88 
90  inline_ Point& Mult(const Point& a, float scalar)
91  {
92  x = a.x * scalar;
93  y = a.y * scalar;
94  z = a.z * scalar;
95  return *this;
96  }
97 
99  inline_ Point& Mac(const Point& a, const Point& b, float scalar)
100  {
101  x = a.x + b.x * scalar;
102  y = a.y + b.y * scalar;
103  z = a.z + b.z * scalar;
104  return *this;
105  }
106 
108  inline_ Point& Mac(const Point& a, float scalar)
109  {
110  x += a.x * scalar;
111  y += a.y * scalar;
112  z += a.z * scalar;
113  return *this;
114  }
115 
117  inline_ Point& Msc(const Point& a, const Point& b, float scalar)
118  {
119  x = a.x - b.x * scalar;
120  y = a.y - b.y * scalar;
121  z = a.z - b.z * scalar;
122  return *this;
123  }
124 
126  inline_ Point& Msc(const Point& a, float scalar)
127  {
128  x -= a.x * scalar;
129  y -= a.y * scalar;
130  z -= a.z * scalar;
131  return *this;
132  }
133 
135  inline_ Point& Mac2(const Point& a, const Point& b, float scalarb, const Point& c, float scalarc)
136  {
137  x = a.x + b.x * scalarb + c.x * scalarc;
138  y = a.y + b.y * scalarb + c.y * scalarc;
139  z = a.z + b.z * scalarb + c.z * scalarc;
140  return *this;
141  }
142 
144  inline_ Point& Msc2(const Point& a, const Point& b, float scalarb, const Point& c, float scalarc)
145  {
146  x = a.x - b.x * scalarb - c.x * scalarc;
147  y = a.y - b.y * scalarb - c.y * scalarc;
148  z = a.z - b.z * scalarb - c.z * scalarc;
149  return *this;
150  }
151 
153  inline_ Point& Mult(const Matrix3x3& mat, const Point& a);
154 
156  inline_ Point& Mult2(const Matrix3x3& mat1, const Point& a1, const Matrix3x3& mat2, const Point& a2);
157 
159  inline_ Point& Mac(const Matrix3x3& mat, const Point& a);
160 
162  inline_ Point& TransMult(const Matrix3x3& mat, const Point& a);
163 
165  inline_ Point& Lerp(const Point& a, const Point& b, float t)
166  {
167  x = a.x + t * (b.x - a.x);
168  y = a.y + t * (b.y - a.y);
169  z = a.z + t * (b.z - a.z);
170  return *this;
171  }
172 
178  inline_ Point& Herp(const Point& p0, const Point& p1, const Point& p2, const Point& p3, float t)
179  {
180  float t2 = t * t;
181  float t3 = t2 * t;
182  float kp0 = (2.0f * t2 - t3 - t) * 0.5f;
183  float kp1 = (3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f;
184  float kp2 = (4.0f * t2 - 3.0f * t3 + t) * 0.5f;
185  float kp3 = (t3 - t2) * 0.5f;
186  x = p0.x * kp0 + p1.x * kp1 + p2.x * kp2 + p3.x * kp3;
187  y = p0.y * kp0 + p1.y * kp1 + p2.y * kp2 + p3.y * kp3;
188  z = p0.z * kp0 + p1.z * kp1 + p2.z * kp2 + p3.z * kp3;
189  return *this;
190  }
191 
193  inline_ Point& Transform(const Point& r, const Matrix3x3& rotpos, const Point& linpos);
194 
196  inline_ Point& InvTransform(const Point& r, const Matrix3x3& rotpos, const Point& linpos);
197 
199  inline_ float Min() const { return MIN(x, MIN(y, z)); }
201  inline_ float Max() const { return MAX(x, MAX(y, z)); }
203  inline_ Point& Min(const Point& p) { x = MIN(x, p.x); y = MIN(y, p.y); z = MIN(z, p.z); return *this; }
205  inline_ Point& Max(const Point& p) { x = MAX(x, p.x); y = MAX(y, p.y); z = MAX(z, p.z); return *this; }
206 
208  inline_ Point& Clamp(float min, float max)
209  {
210  if(x<min) x=min; if(x>max) x=max;
211  if(y<min) y=min; if(y>max) y=max;
212  if(z<min) z=min; if(z>max) z=max;
213  return *this;
214  }
215 
217  inline_ float SquareMagnitude() const { return x*x + y*y + z*z; }
219  inline_ float Magnitude() const { return sqrtf(x*x + y*y + z*z); }
221  inline_ float Volume() const { return x * y * z; }
222 
224  inline_ bool ApproxZero() const { return SquareMagnitude() < EPSILON2; }
225 
228  {
229  if(IR(x) || IR(y) || IR(z)) return FALSE;
230  return TRUE;
231  }
232 
235  {
236  if(!IsValidFloat(x)) return FALSE;
237  if(!IsValidFloat(y)) return FALSE;
238  if(!IsValidFloat(z)) return FALSE;
239  return TRUE;
240  }
241 
243  void Tweak(udword coord_mask, udword tweak_mask)
244  {
245  if(coord_mask&1) { udword Dummy = IR(x); Dummy^=tweak_mask; x = FR(Dummy); }
246  if(coord_mask&2) { udword Dummy = IR(y); Dummy^=tweak_mask; y = FR(Dummy); }
247  if(coord_mask&4) { udword Dummy = IR(z); Dummy^=tweak_mask; z = FR(Dummy); }
248  }
249 
250  #define TWEAKMASK 0x3fffff
251  #define TWEAKNOTMASK ~TWEAKMASK
252  inline_ void TweakBigger()
254  {
255  udword Dummy = (IR(x)&TWEAKNOTMASK); if(!IS_NEGATIVE_FLOAT(x)) Dummy+=TWEAKMASK+1; x = FR(Dummy);
256  Dummy = (IR(y)&TWEAKNOTMASK); if(!IS_NEGATIVE_FLOAT(y)) Dummy+=TWEAKMASK+1; y = FR(Dummy);
257  Dummy = (IR(z)&TWEAKNOTMASK); if(!IS_NEGATIVE_FLOAT(z)) Dummy+=TWEAKMASK+1; z = FR(Dummy);
258  }
259 
262  {
263  udword Dummy = (IR(x)&TWEAKNOTMASK); if(IS_NEGATIVE_FLOAT(x)) Dummy+=TWEAKMASK+1; x = FR(Dummy);
264  Dummy = (IR(y)&TWEAKNOTMASK); if(IS_NEGATIVE_FLOAT(y)) Dummy+=TWEAKMASK+1; y = FR(Dummy);
265  Dummy = (IR(z)&TWEAKNOTMASK); if(IS_NEGATIVE_FLOAT(z)) Dummy+=TWEAKMASK+1; z = FR(Dummy);
266  }
267 
270  {
271  float M = x*x + y*y + z*z;
272  if(M)
273  {
274  M = 1.0f / sqrtf(M);
275  x *= M;
276  y *= M;
277  z *= M;
278  }
279  return *this;
280  }
281 
284  {
285  float NewLength = length / Magnitude();
286  x *= NewLength;
287  y *= NewLength;
288  z *= NewLength;
289  return *this;
290  }
291 
293  inline_ Point& ClampLength(float limit_length)
294  {
295  if(limit_length>=0.0f) // Magnitude must be positive
296  {
297  float CurrentSquareLength = SquareMagnitude();
298 
299  if(CurrentSquareLength > limit_length * limit_length)
300  {
301  float Coeff = limit_length / sqrtf(CurrentSquareLength);
302  x *= Coeff;
303  y *= Coeff;
304  z *= Coeff;
305  }
306  }
307  return *this;
308  }
309 
311  inline_ float Distance(const Point& b) const
312  {
313  return sqrtf((x - b.x)*(x - b.x) + (y - b.y)*(y - b.y) + (z - b.z)*(z - b.z));
314  }
315 
317  inline_ float SquareDistance(const Point& b) const
318  {
319  return ((x - b.x)*(x - b.x) + (y - b.y)*(y - b.y) + (z - b.z)*(z - b.z));
320  }
321 
323  inline_ float Dot(const Point& p) const { return p.x * x + p.y * y + p.z * z; }
324 
326  inline_ Point& Cross(const Point& a, const Point& b)
327  {
328  x = a.y * b.z - a.z * b.y;
329  y = a.z * b.x - a.x * b.z;
330  z = a.x * b.y - a.y * b.x;
331  return *this;
332  }
333 
336  {
337  return (IR(x)>>31) | ((IR(y)&SIGN_BITMASK)>>30) | ((IR(z)&SIGN_BITMASK)>>29);
338  }
339 
342  {
343  //const float* Vals = &x;
344  PointComponent m = _X;
345  //if(Vals[_Y] > Vals[m]) m = _Y;
346  //if(Vals[_Z] > Vals[m]) m = _Z;
347  y > x ? (z > y ? m = _Z : m = _Y) : (z > x ? m = _Z : m = _X);
348  return m;
349  }
350 
353  {
354  const float* Vals = &x;
355  PointComponent m = _X;
356  if(AIR(Vals[_Y]) > AIR(Vals[m])) m = _Y;
357  if(AIR(Vals[_Z]) > AIR(Vals[m])) m = _Z;
358  return m;
359  }
360 
363  {
364  //const float* Vals = &x;
365  PointComponent m = _X;
366  //if(Vals[_Y] < Vals[m]) m = _Y;
367  //if(Vals[_Z] < Vals[m]) m = _Z;
368  y < x ? (z < y ? m = _Z : m = _Y) : (z < x ? m = _Z : m = _X);
369  return m;
370  }
371 
373  Point& Refract(const Point& eye, const Point& n, float refractindex, Point& refracted);
374 
376  Point& ProjectToPlane(const Plane& p);
377 
379  void ProjectToScreen(float halfrenderwidth, float halfrenderheight, const Matrix4x4& mat, HPoint& projected) const;
380 
382  Point& Unfold(Plane& p, Point& a, Point& b);
383 
386  {
387  const udword* h = (const udword*)(this);
388  udword f = (h[0]+h[1]*11-(h[2]*17)) & 0x7fffffff; // avoid problems with +-0
389  return (f>>22)^(f>>12)^(f);
390  }
391 
393  void SetNotUsed();
395  BOOL IsNotUsed() const;
396 
397  // Arithmetic operators
398 
400  inline_ Point operator-() const { return Point(-x, -y, -z); }
401 
403  inline_ Point operator+(const Point& p) const { return Point(x + p.x, y + p.y, z + p.z); }
405  inline_ Point operator-(const Point& p) const { return Point(x - p.x, y - p.y, z - p.z); }
406 
408  inline_ Point operator*(const Point& p) const { return Point(x * p.x, y * p.y, z * p.z); }
410  inline_ Point operator*(float s) const { return Point(x * s, y * s, z * s ); }
412  inline_ friend Point operator*(float s, const Point& p) { return Point(s * p.x, s * p.y, s * p.z); }
413 
415  inline_ Point operator/(const Point& p) const { return Point(x / p.x, y / p.y, z / p.z); }
417  inline_ Point operator/(float s) const { s = 1.0f / s; return Point(x * s, y * s, z * s); }
419  inline_ friend Point operator/(float s, const Point& p) { return Point(s / p.x, s / p.y, s / p.z); }
420 
422  inline_ float operator|(const Point& p) const { return x*p.x + y*p.y + z*p.z; }
424  inline_ Point operator^(const Point& p) const
425  {
426  return Point(
427  y * p.z - z * p.y,
428  z * p.x - x * p.z,
429  x * p.y - y * p.x );
430  }
431 
433  inline_ Point& operator+=(const Point& p) { x += p.x; y += p.y; z += p.z; return *this; }
435  inline_ Point& operator+=(float s) { x += s; y += s; z += s; return *this; }
436 
438  inline_ Point& operator-=(const Point& p) { x -= p.x; y -= p.y; z -= p.z; return *this; }
440  inline_ Point& operator-=(float s) { x -= s; y -= s; z -= s; return *this; }
441 
443  inline_ Point& operator*=(const Point& p) { x *= p.x; y *= p.y; z *= p.z; return *this; }
445  inline_ Point& operator*=(float s) { x *= s; y *= s; z *= s; return *this; }
446 
448  inline_ Point& operator/=(const Point& p) { x /= p.x; y /= p.y; z /= p.z; return *this; }
450  inline_ Point& operator/=(float s) { s = 1.0f/s; x *= s; y *= s; z *= s; return *this; }
451 
452  // Logical operators
453 
455  inline_ bool operator==(const Point& p) const { return ( (IR(x)==IR(p.x))&&(IR(y)==IR(p.y))&&(IR(z)==IR(p.z))); }
457  inline_ bool operator!=(const Point& p) const { return ( (IR(x)!=IR(p.x))||(IR(y)!=IR(p.y))||(IR(z)!=IR(p.z))); }
458 
459  // Arithmetic operators
460 
462  inline_ Point operator*(const Matrix3x3& mat) const
463  {
464  class ShadowMatrix3x3{ public: float m[3][3]; }; // To allow inlining
465  const ShadowMatrix3x3* Mat = (const ShadowMatrix3x3*)&mat;
466 
467  return Point(
468  x * Mat->m[0][0] + y * Mat->m[1][0] + z * Mat->m[2][0],
469  x * Mat->m[0][1] + y * Mat->m[1][1] + z * Mat->m[2][1],
470  x * Mat->m[0][2] + y * Mat->m[1][2] + z * Mat->m[2][2] );
471  }
472 
474  inline_ Point operator*(const Matrix4x4& mat) const
475  {
476  class ShadowMatrix4x4{ public: float m[4][4]; }; // To allow inlining
477  const ShadowMatrix4x4* Mat = (const ShadowMatrix4x4*)&mat;
478 
479  return Point(
480  x * Mat->m[0][0] + y * Mat->m[1][0] + z * Mat->m[2][0] + Mat->m[3][0],
481  x * Mat->m[0][1] + y * Mat->m[1][1] + z * Mat->m[2][1] + Mat->m[3][1],
482  x * Mat->m[0][2] + y * Mat->m[1][2] + z * Mat->m[2][2] + Mat->m[3][2]);
483  }
484 
487  {
488  class ShadowMatrix3x3{ public: float m[3][3]; }; // To allow inlining
489  const ShadowMatrix3x3* Mat = (const ShadowMatrix3x3*)&mat;
490 
491  float xp = x * Mat->m[0][0] + y * Mat->m[1][0] + z * Mat->m[2][0];
492  float yp = x * Mat->m[0][1] + y * Mat->m[1][1] + z * Mat->m[2][1];
493  float zp = x * Mat->m[0][2] + y * Mat->m[1][2] + z * Mat->m[2][2];
494 
495  x = xp; y = yp; z = zp;
496 
497  return *this;
498  }
499 
502  {
503  class ShadowMatrix4x4{ public: float m[4][4]; }; // To allow inlining
504  const ShadowMatrix4x4* Mat = (const ShadowMatrix4x4*)&mat;
505 
506  float xp = x * Mat->m[0][0] + y * Mat->m[1][0] + z * Mat->m[2][0] + Mat->m[3][0];
507  float yp = x * Mat->m[0][1] + y * Mat->m[1][1] + z * Mat->m[2][1] + Mat->m[3][1];
508  float zp = x * Mat->m[0][2] + y * Mat->m[1][2] + z * Mat->m[2][2] + Mat->m[3][2];
509 
510  x = xp; y = yp; z = zp;
511 
512  return *this;
513  }
514 
515  // Cast operators
516 
518  operator HPoint() const;
519 
520  inline_ operator const float*() const { return &x; }
521  inline_ operator float*() { return &x; }
522 
523  public:
524  float x, y, z;
525  };
526 
529 
530 #endif //__ICEPOINT_H__
inline_ Point operator*(const Point &p) const
Operator for Point Mul = Point * Point.
Definition: IcePoint.h:408
PointComponent
Definition: IceAxes.h:15
#define IR(x)
Integer representation of a floating-point value.
Definition: IceFPU.h:18
inline_ Point & SetMinusInfinity()
Definition: IcePoint.h:49
inline_ Point & operator*=(const Matrix3x3 &mat)
Operator for Point *= Matrix3x3.
Definition: IcePoint.h:486
int c
Definition: autoplay.py:16
Definition: IceAxes.h:19
#define MAX(a, b)
Returns the max value between a and b.
Definition: IceTypes.h:147
#define TWEAKMASK
Definition: OPC_IceHook.h:251
inline_ bool operator!=(const Point &p) const
Operator for "if(Point!=Point)".
Definition: IcePoint.h:457
inline_ float SquareMagnitude() const
Computes square magnitude.
Definition: IcePoint.h:217
inline_ Point operator+(const Point &p) const
Operator for Point Plus = Point + Point.
Definition: IcePoint.h:403
inline_ Point & Herp(const Point &p0, const Point &p1, const Point &p2, const Point &p3, float t)
Definition: IcePoint.h:178
inline_ Point & Add(const float f[3])
Adds a vector.
Definition: IcePoint.h:68
inline_ Point & Mac(const Point &a, float scalar)
this = this + a * scalar
Definition: IcePoint.h:108
FUNCTION ICEMATHS_API void Normalize2(Point &a)
inline_ Point & Set(const float f[3])
Assignment from array.
Definition: IcePoint.h:59
#define FALSE
Definition: OPC_IceHook.h:9
inline_ Point & Sub(const Point &p)
Subtracts a vector.
Definition: IcePoint.h:73
#define IS_NEGATIVE_FLOAT(x)
Definition: IceFPU.h:32
* x
Definition: IceUtils.h:98
inline_ Point & ClampLength(float limit_length)
Clamps vector length.
Definition: IcePoint.h:293
inline_ float Volume() const
Computes volume.
Definition: IcePoint.h:221
#define TWEAKNOTMASK
Definition: OPC_IceHook.h:252
#define FR(x)
Floating-point representation of an integer value.
Definition: IceFPU.h:27
inline_ Point & operator*=(float s)
Operator for Point *= float.
Definition: IcePoint.h:445
inline_ Point & Mac2(const Point &a, const Point &b, float scalarb, const Point &c, float scalarc)
this = a + b * scalarb + c * scalarc
Definition: IcePoint.h:135
static int min(int a, int b)
#define FUNCTION
#define MIN(a, b)
Returns the min value between a and b.
Definition: IceTypes.h:146
#define TRUE
Definition: OPC_IceHook.h:13
#define SIGN_BITMASK
Definition: IceFPU.h:15
#define inline_
inline_ BOOL IsZero() const
Tests for exact zero vector.
Definition: IcePoint.h:227
inline_ Point & Lerp(const Point &a, const Point &b, float t)
Linear interpolate between two vectors: this = a + t * (b - a)
Definition: IcePoint.h:165
inline_ float SquareDistance(const Point &b) const
Computes square distance to another point.
Definition: IcePoint.h:317
float z
Definition: IcePoint.h:524
inline_ float Distance(const Point &b) const
Computes distance to another point.
Definition: IcePoint.h:311
inline_ Point(const float f[3])
Constructor from array.
Definition: IcePoint.h:37
png_bytep png_bytep png_size_t length
Definition: png.h:1541
Definition: IcePoint.h:25
#define ICEMATHS_API
Definition: OPC_IceHook.h:51
Definition: IceAxes.h:18
Definition: IcePlane.h:17
long b
Definition: jpegint.h:371
inline_ Point operator/(const Point &p) const
Operator for Point Div = Point / Point.
Definition: IcePoint.h:415
inline_ ~Point()
Destructor.
Definition: IcePoint.h:41
inline_ Point operator-() const
Unary operator for Point Negate = - Point.
Definition: IcePoint.h:400
inline_ udword GetHashValue() const
Hash function from Ville Miettinen.
Definition: IcePoint.h:385
int BOOL
Another boolean type.
Definition: IceTypes.h:102
inline_ friend Point operator/(float s, const Point &p)
Operator for Point Scale = float / Point.
Definition: IcePoint.h:419
float x
Definition: IcePoint.h:524
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
inline_ Point & Set(const Point &src)
Assignment from another point.
Definition: IcePoint.h:61
inline_ Point & Sub(const float f[3])
Subtracts a vector.
Definition: IcePoint.h:77
inline_ Point & Add(const Point &p)
Adds a vector.
Definition: IcePoint.h:64
inline_ Point & operator*=(const Point &p)
Operator for Point *= Point.
Definition: IcePoint.h:443
inline_ Point & SetPlusInfinity()
Definition: IcePoint.h:47
inline_ Point & operator*=(const Matrix4x4 &mat)
Operator for Point *= Matrix4x4.
Definition: IcePoint.h:501
inline_ udword VectorCode() const
Vector code ( bitmask = sign(z) | sign(y) | sign(x) )
Definition: IcePoint.h:335
inline_ Point & operator+=(float s)
Operator for Point += float.
Definition: IcePoint.h:435
inline_ float Magnitude() const
Computes magnitude.
Definition: IcePoint.h:219
inline_ Point operator^(const Point &p) const
Operator for Point VecProd = Point ^ Point.
Definition: IcePoint.h:424
inline_ Point & operator-=(const Point &p)
Operator for Point -= Point.
Definition: IcePoint.h:438
inline_ Point & Mac(const Point &a, const Point &b, float scalar)
this = a + b * scalar
Definition: IcePoint.h:99
inline_ Point & Neg()
this = -this
Definition: IcePoint.h:82
inline_ BOOL IsValid() const
Checks point validity.
Definition: IcePoint.h:234
inline_ Point operator*(float s) const
Operator for Point Scale = Point * float.
Definition: IcePoint.h:410
#define MAX_FLOAT
max possible float value
Definition: IceTypes.h:130
string a
inline_ Point & Mult(float s)
Multiplies by a scalar.
Definition: IcePoint.h:87
inline_ Point & Msc(const Point &a, const Point &b, float scalar)
this = a - b * scalar
Definition: IcePoint.h:117
inline_ Point & Mult(const Point &a, float scalar)
this = a * scalar
Definition: IcePoint.h:90
inline_ PointComponent LargestAxis() const
Returns largest axis.
Definition: IcePoint.h:341
inline_ bool IsValidFloat(float value)
Definition: IceFPU.h:131
inline_ Point & Set(float _x, float _y, float _z)
Assignment from values.
Definition: IcePoint.h:57
inline_ bool operator==(const Point &p) const
Operator for "if(Point==Point)".
Definition: IcePoint.h:455
inline_ Point & Add(float _x, float _y, float _z)
Adds a vector.
Definition: IcePoint.h:66
inline_ float Max() const
Returns MAX(x, y, z);.
Definition: IcePoint.h:201
inline_ Point & SetLength(float length)
Sets vector length.
Definition: IcePoint.h:283
void Tweak(udword coord_mask, udword tweak_mask)
Slighty moves the point.
Definition: IcePoint.h:243
inline_ Point & Add(const Point &p, const Point &q)
Adds vectors.
Definition: IcePoint.h:70
inline_ Point(const Point &p)
Copy constructor.
Definition: IcePoint.h:39
inline_ Point(float _x, float _y, float _z)
Constructor from a single float.
Definition: IcePoint.h:35
inline_ float Dot(const Point &p) const
Dot product dp = this|a.
Definition: IcePoint.h:323
inline_ PointComponent SmallestAxis() const
Returns smallest axis.
Definition: IcePoint.h:362
inline_ Point & Zero()
Clears the vector.
Definition: IcePoint.h:44
const float EPSILON2
Definition: IcePoint.h:23
float y
Definition: IcePoint.h:524
inline_ float Min() const
Returns MIN(x, y, z);.
Definition: IcePoint.h:199
inline_ Point operator-(const Point &p) const
Operator for Point Minus = Point - Point.
Definition: IcePoint.h:405
inline_ Point & Sub(float _x, float _y, float _z)
Subtracts a vector.
Definition: IcePoint.h:75
inline_ PointComponent ClosestAxis() const
Returns closest axis.
Definition: IcePoint.h:352
FUNCTION ICEMATHS_API void Normalize1(Point &a)
Definition: IceAxes.h:17
inline_ Point & Max(const Point &p)
Sets each element to be componentwise maximum.
Definition: IcePoint.h:205
inline_ Point & Clamp(float min, float max)
Clamps each element.
Definition: IcePoint.h:208
inline_ Point & Min(const Point &p)
Sets each element to be componentwise minimum.
Definition: IcePoint.h:203
inline_ float operator|(const Point &p) const
Operator for float DotProd = Point | Point.
Definition: IcePoint.h:422
inline_ Point & operator-=(float s)
Operator for Point -= float.
Definition: IcePoint.h:440
#define AIR(x)
Absolute integer representation of a floating-point value.
Definition: IceFPU.h:24
inline_ Point & Neg(const Point &a)
this = -a
Definition: IcePoint.h:84
inline_ Point & operator/=(float s)
Operator for Point /= float.
Definition: IcePoint.h:450
inline_ Point operator/(float s) const
Operator for Point Scale = Point / float.
Definition: IcePoint.h:417
inline_ Point()
Empty constructor.
Definition: IcePoint.h:30
inline_ Point & Sub(const Point &p, const Point &q)
Subtracts vectors.
Definition: IcePoint.h:79
inline_ Point & operator+=(const Point &p)
Operator for Point += Point.
Definition: IcePoint.h:433
inline_ Point & Cross(const Point &a, const Point &b)
Cross product this = a x b.
Definition: IcePoint.h:326
inline_ bool ApproxZero() const
Checks the point is near zero.
Definition: IcePoint.h:224
inline_ Point operator*(const Matrix3x3 &mat) const
Operator for Point Mul = Point * Matrix3x3.
Definition: IcePoint.h:462
* y
Definition: IceUtils.h:97
inline_ Point & Msc2(const Point &a, const Point &b, float scalarb, const Point &c, float scalarc)
this = a - b * scalarb - c * scalarc
Definition: IcePoint.h:144
#define MIN_FLOAT
min possible loat value
Definition: IceTypes.h:131
static int max(int a, int b)
inline_ friend Point operator*(float s, const Point &p)
Operator for Point Scale = float * Point.
Definition: IcePoint.h:412
inline_ Point & operator/=(const Point &p)
Operator for Point /= Point.
Definition: IcePoint.h:448
inline_ Point operator*(const Matrix4x4 &mat) const
Operator for Point Mul = Point * Matrix4x4.
Definition: IcePoint.h:474
inline_ void TweakSmaller()
Slighty moves the point in.
Definition: IcePoint.h:261
inline_ Point & Normalize()
Normalizes the vector.
Definition: IcePoint.h:269
inline_ Point & Msc(const Point &a, float scalar)
this = this - a * scalar
Definition: IcePoint.h:126


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:03