le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
geometry_scalar.h
Go to the documentation of this file.
1 
33 #ifndef LE_GEOMETRY_SCALAR_H
34 #define LE_GEOMETRY_SCALAR_H
35 
36 #include "global.h"
37 #include "config.h"
38 
39 #include <math.h>
40 
41 /*****************************************************************************/
46 struct LeVertex
47 {
48  float x, y, z, w;
49 
51  {
52  x = 0.0f;
53  y = 0.0f;
54  z = 0.0f;
55  w = 1.0f;
56  }
57 
58  LeVertex(float px, float py, float pz)
59  {
60  x = px;
61  y = py;
62  z = pz;
63  w = 1.0f;
64  }
65 
66  static LeVertex spherical(float azi, float inc, float dist)
67  {
68  LeVertex r;
69  r.x = cosf(azi) * cosf(inc) * dist;
70  r.y = sinf(inc) * dist;
71  r.z = -sinf(azi) * cosf(inc) * dist;
72  return r;
73  }
74 
76  {
77  LeVertex r;
78  r.x = x + v.x;
79  r.y = y + v.y;
80  r.z = z + v.z;
81  return r;
82  }
83 
85  {
86  x += v.x;
87  y += v.y;
88  z += v.z;
89  return *this;
90  }
91 
93  {
94  LeVertex r;
95  r.x = x - v.x;
96  r.y = y - v.y;
97  r.z = z - v.z;
98  return r;
99  }
100 
102  {
103  LeVertex r;
104  r.x = -x;
105  r.y = -y;
106  r.z = -z;
107  return r;
108  }
109 
111  {
112  x -= v.x;
113  y -= v.y;
114  z -= v.z;
115  return *this;
116  }
117 
119  {
120  LeVertex r;
121  r.x = x * v.x;
122  r.y = y * v.y;
123  r.z = z * v.z;
124  return r;
125  }
126 
128  {
129  LeVertex r;
130  r.x = x / v.x;
131  r.y = y / v.y;
132  r.z = z / v.z;
133  return r;
134  }
135 
136  LeVertex operator * (float v) const
137  {
138  LeVertex r;
139  r.x = x * v;
140  r.y = y * v;
141  r.z = z * v;
142  return r;
143  }
144 
145  LeVertex operator / (float v) const
146  {
147  float iv = 1.0f / v;
148  LeVertex r;
149  r.x = x * iv;
150  r.y = y * iv;
151  r.z = z * iv;
152  return r;
153  }
154 
156  {
157  x *= v.x;
158  y *= v.y;
159  z *= v.z;
160  return *this;
161  }
162 
164  {
165  x /= v.x;
166  y /= v.y;
167  z /= v.z;
168  return *this;
169  }
170 
172  {
173  x *= v;
174  y *= v;
175  z *= v;
176  return *this;
177  }
178 
180  {
181  float iv = 1.0f / v;
182  x *= iv;
183  y *= iv;
184  z *= iv;
185  return *this;
186  }
187 
189  {
190  return x == v.x && y == v.y && z == v.z;
191  }
192 
193  float dot(LeVertex v) const
194  {
195  return x * v.x + y * v.y + z * v.z;
196  }
197 
199  {
200  LeVertex c;
201  c.x = y * v.z - v.y * z;
202  c.y = -x * v.z + v.x * z;
203  c.z = x * v.y - v.x * y;
204  return c;
205  }
206 
207  LeVertex sign() const
208  {
209  LeVertex c;
210  c.x = copysignf(1.0f, x);
211  c.y = copysignf(1.0f, y);
212  c.z = copysignf(1.0f, z);
213  c.w = copysignf(1.0f, w);
214  return c;
215  }
216 
217  LeVertex round() const
218  {
219  LeVertex c;
220  c.x = floorf(x + 0.5f);
221  c.y = floorf(y + 0.5f);
222  c.z = floorf(z + 0.5f);
223  c.w = floorf(w + 0.5f);
224  return c;
225  }
226 
227  LeVertex floor() const
228  {
229  LeVertex c;
230  c.x = floorf(x);
231  c.y = floorf(y);
232  c.z = floorf(z);
233  c.w = floorf(w);
234  return c;
235  }
236 
238  {
239  float d = norm();
240  if (d == 0.0f) {
241  x = y = z = 0.0f;
242  w = 1.0f;
243  }else{
244  d = 1.0f / d;
245  x *= d;
246  y *= d;
247  z *= d;
248  w *= d;
249  }
250  return *this;
251  }
252 
253  float norm() const
254  {
255  return sqrtf(dot(*this));
256  }
257 
258 };
259 
260 /*****************************************************************************/
265 struct LeAxis
266 {
269  float norm;
272  {
273  origin.x = 0.0f;
274  origin.y = 0.0f;
275  origin.z = 0.0f;
276  axis.x = 0.0f;
277  axis.y = 0.0f;
278  axis.z = 1.0f;
279  norm = 1.0f;
280  }
281 
283  {
284  origin.x = v1.x;
285  origin.y = v1.y;
286  origin.z = v1.z;
287  float dx = v2.x - v1.x;
288  float dy = v2.y - v1.y;
289  float dz = v2.z - v1.z;
290  norm = sqrtf(dx * dx + dy * dy + dz * dz);
291  axis.x = dx / norm;
292  axis.y = dy / norm;
293  axis.z = dz / norm;
294  }
295 };
296 
297 /*****************************************************************************/
302 struct LePlane
303 {
307 
309  {
310  xAxis.axis.x = 1.0f;
311  xAxis.axis.y = 0.0f;
312  xAxis.axis.z = 0.0f;
313 
314  yAxis.axis.x = 0.0f;
315  yAxis.axis.y = 1.0f;
316  yAxis.axis.z = 0.0f;
317 
318  zAxis.axis.x = 0.0f;
319  zAxis.axis.y = 0.0f;
320  zAxis.axis.z = 1.0f;
321  }
322 
324  xAxis(LeAxis(v1, v2)), yAxis(LeAxis(v1, v3))
325  {
326 
327  LeVertex tv1, tv2;
328  tv1.x = xAxis.axis.z * yAxis.axis.y;
329  tv1.y = xAxis.axis.x * yAxis.axis.z;
330  tv1.z = xAxis.axis.y * yAxis.axis.x;
331  tv2.x = xAxis.axis.y * yAxis.axis.z;
332  tv2.y = xAxis.axis.z * yAxis.axis.x;
333  tv2.z = xAxis.axis.x * yAxis.axis.y;
334  zAxis = LeAxis(tv1, tv2);
335  zAxis.origin.x = v1.x;
336  zAxis.origin.y = v1.y;
337  zAxis.origin.z = v1.z;
338  }
339 };
340 
341 /*****************************************************************************/
346 struct LeMatrix
347 {
348  float mat[4][4];
349 
351  {
352  identity();
353  }
354 
355  void identity()
356  {
357  mat[0][0] = 1.0f;
358  mat[0][1] = 0.0f;
359  mat[0][2] = 0.0f;
360  mat[0][3] = 0.0f;
361 
362  mat[1][0] = 0.0f;
363  mat[1][1] = 1.0f;
364  mat[1][2] = 0.0f;
365  mat[1][3] = 0.0f;
366 
367  mat[2][0] = 0.0f;
368  mat[2][1] = 0.0f;
369  mat[2][2] = 1.0f;
370  mat[2][3] = 0.0f;
371 
372  mat[3][0] = 0.0f;
373  mat[3][1] = 0.0f;
374  mat[3][2] = 0.0f;
375  mat[3][3] = 1.0f;
376  }
377 
378  void zero()
379  {
380  for (int i = 0; i < 4; i++)
381  for (int j = 0; j < 4; j++)
382  mat[i][j] = 0;
383  }
384 
385  void transpose()
386  {
387  LeMatrix m;
388  for (int i = 0; i < 4; i++)
389  for (int j = 0; j < 4; j++)
390  m.mat[j][i] = mat[i][j];
391  *this = m;
392  }
393 
395  {
396  mat[0][3] += d.x;
397  mat[1][3] += d.y;
398  mat[2][3] += d.z;
399  }
400 
401  void scale(LeVertex s)
402  {
403  LeMatrix m;
404  m.mat[0][0] *= s.x;
405  m.mat[1][1] *= s.y;
406  m.mat[2][2] *= s.z;
407  *this = m * *this;
408  }
409 
410 /*****************************************************************************/
412  {
413  rotateX(a.x);
414  rotateY(a.y);
415  rotateZ(a.z);
416  }
417 
419  {
420  rotateX(a.x);
421  rotateZ(a.z);
422  rotateY(a.y);
423  }
424 
426  {
427  rotateY(a.y);
428  rotateZ(a.z);
429  rotateX(a.x);
430  }
431 
433  {
434  rotateY(a.y);
435  rotateX(a.x);
436  rotateZ(a.z);
437  }
438 
440  {
441  rotateZ(a.z);
442  rotateX(a.x);
443  rotateY(a.y);
444  }
445 
447  {
448  rotateZ(a.z);
449  rotateY(a.y);
450  rotateX(a.x);
451  }
452 
453  void rotateX(float a)
454  {
455  float c = cosf(a);
456  float s = sinf(a);
457 
458  LeMatrix m;
459  m.mat[1][1] = c;
460  m.mat[1][2] = -s;
461  m.mat[2][1] = s;
462  m.mat[2][2] = c;
463 
464  *this = m * *this;
465  }
466 
467  void rotateY(float a)
468  {
469  float c = cosf(a);
470  float s = sinf(a);
471 
472  LeMatrix m;
473  m.mat[0][0] = c;
474  m.mat[0][2] = s;
475  m.mat[2][0] = -s;
476  m.mat[2][2] = c;
477 
478  *this = m * *this;
479  }
480 
481  void rotateZ(float a)
482  {
483  float c = cosf(a);
484  float s = sinf(a);
485 
486  LeMatrix m;
487  m.mat[0][0] = c;
488  m.mat[0][1] = -s;
489  m.mat[1][0] = s;
490  m.mat[1][1] = c;
491 
492  *this = m * *this;
493  }
494 
495  void rotate(LeVertex axis, float angle)
496  {
497  float c = cosf(angle);
498  float s = sinf(angle);
499  float d = 1.0f - c;
500 
501  LeMatrix m;
502  m.mat[0][0] = c + axis.x * axis.x * d;
503  m.mat[1][0] = axis.y * axis.x * d + axis.z * s;
504  m.mat[2][0] = axis.z * axis.x * d - axis.y * s;
505  m.mat[3][0] = 0.0f;
506 
507  m.mat[0][1] = axis.x * axis.y * d - axis.z * s;
508  m.mat[1][1] = c + axis.y * axis.y * d;
509  m.mat[2][1] = axis.z * axis.y * d + axis.x * s;
510  m.mat[3][1] = 0.0f;
511 
512  m.mat[0][2] = axis.x * axis.z * d + axis.y * s;
513  m.mat[1][2] = axis.y * axis.z * d - axis.x * s;
514  m.mat[2][2] = c + axis.z * axis.z * d;
515  m.mat[3][2] = 0.0f;
516 
517  m.mat[0][3] = 0.0f;
518  m.mat[1][3] = 0.0f;
519  m.mat[2][3] = 0.0f;
520  m.mat[3][3] = 1.0f;
521  *this = m * *this;
522  }
523 
524 /*****************************************************************************/
525  void toEulerZYX(LeVertex & angle)
526  {
527  float l = sqrtf(mat[0][0] * mat[0][0] + mat[1][0] * mat[1][0]);
528  if (l > 1e-6) {
529  angle.x = atan2f(mat[2][1], mat[2][2]);
530  angle.y = atan2f(-mat[2][0], l);
531  angle.z = atan2f(mat[1][0], mat[0][0]);
532  }else{
533  angle.x = atan2f(-mat[1][2], mat[1][1]);
534  angle.y = atan2f(-mat[2][0], l);
535  angle.z = 0.0f;
536  }
537  }
538 
539 /*****************************************************************************/
541  {
542  back.normalize();
543  up.normalize();
544  LeVertex right = up.cross(back);
545 
546  LeMatrix m;
547  m.mat[0][0] = right.x;
548  m.mat[1][0] = right.y;
549  m.mat[2][0] = right.z;
550  m.mat[3][0] = 0.0f;
551 
552  m.mat[0][1] = up.x;
553  m.mat[1][1] = up.y;
554  m.mat[2][1] = up.z;
555  m.mat[3][1] = 0.0f;
556 
557  m.mat[0][2] = back.x;
558  m.mat[1][2] = back.y;
559  m.mat[2][2] = back.z;
560  m.mat[3][2] = 0.0f;
561 
562  m.mat[0][3] = 0.0f;
563  m.mat[1][3] = 0.0f;
564  m.mat[2][3] = 0.0f;
565  m.mat[3][3] = 1.0f;
566  *this = m * *this;
567  }
568 
570  {
571  back.normalize();
572  right.normalize();
573  LeVertex up = back.cross(right);
574 
575  LeMatrix m;
576  m.mat[0][0] = right.x;
577  m.mat[1][0] = right.y;
578  m.mat[2][0] = right.z;
579  m.mat[3][0] = 0.0f;
580 
581  m.mat[0][1] = up.x;
582  m.mat[1][1] = up.y;
583  m.mat[2][1] = up.z;
584  m.mat[3][1] = 0.0f;
585 
586  m.mat[0][2] = back.x;
587  m.mat[1][2] = back.y;
588  m.mat[2][2] = back.z;
589  m.mat[3][2] = 0.0f;
590 
591  m.mat[0][3] = 0.0f;
592  m.mat[1][3] = 0.0f;
593  m.mat[2][3] = 0.0f;
594  m.mat[3][3] = 1.0f;
595 
596  *this = m * *this;
597  }
598 
599 /*****************************************************************************/
601  {
602  float d = mat[0][0]*(mat[1][1]*mat[2][2]-mat[2][1]*mat[1][2])
603  - mat[0][1]*(mat[1][0]*mat[2][2]-mat[1][2]*mat[2][0])
604  + mat[0][2]*(mat[1][0]*mat[2][1]-mat[1][1]*mat[2][0]);
605 
606  LeMatrix m;
607  if (d == 0.0f) {m.zero(); return m;}
608  d = 1.0f / d;
609 
610  m.mat[0][0] = (mat[1][1] * mat[2][2] - mat[2][1] * mat[1][2]) * d;
611  m.mat[0][1] = -(mat[0][1] * mat[2][2] - mat[2][1] * mat[0][2]) * d;
612  m.mat[0][2] = (mat[0][1] * mat[1][2] - mat[1][1] * mat[0][2]) * d;
613 
614  m.mat[1][0] = -(mat[1][0] * mat[2][2] - mat[2][0] * mat[1][2]) * d;
615  m.mat[1][1] = (mat[0][0] * mat[2][2] - mat[2][0] * mat[0][2]) * d;
616  m.mat[1][2] = -(mat[0][0] * mat[1][2] - mat[1][0] * mat[0][2]) * d;
617 
618  m.mat[2][0] = (mat[1][0] * mat[2][1] - mat[2][0] * mat[1][1]) * d;
619  m.mat[2][1] = -(mat[0][0] * mat[2][1] - mat[2][0] * mat[0][1]) * d;
620  m.mat[2][2] = (mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1]) * d;
621 
622  return m;
623  }
624 
625 /*****************************************************************************/
627  {
628  float x = v.x * mat[0][0] + v.y * mat[0][1] + v.z * mat[0][2] + mat[0][3];
629  float y = v.x * mat[1][0] + v.y * mat[1][1] + v.z * mat[1][2] + mat[1][3];
630  float z = v.x * mat[2][0] + v.y * mat[2][1] + v.z * mat[2][2] + mat[2][3];
631  return LeVertex(x, y, z);
632  }
633 
635  {
636  LeMatrix r;
637  for (int i = 0; i < 4; i++) {
638  r.mat[i][0] = mat[i][0] + m.mat[i][0];
639  r.mat[i][1] = mat[i][1] + m.mat[i][1];
640  r.mat[i][2] = mat[i][2] + m.mat[i][2];
641  r.mat[i][3] = mat[i][3] + m.mat[i][3];
642  }
643  return r;
644  }
645 
647  {
648  LeMatrix r;
649  for (int i = 0; i < 4; i++) {
650  r.mat[i][0] = mat[i][0] * m.mat[0][0] + mat[i][1] * m.mat[1][0] + mat[i][2] * m.mat[2][0] + mat[i][3] * m.mat[3][0];
651  r.mat[i][1] = mat[i][0] * m.mat[0][1] + mat[i][1] * m.mat[1][1] + mat[i][2] * m.mat[2][1] + mat[i][3] * m.mat[3][1];
652  r.mat[i][2] = mat[i][0] * m.mat[0][2] + mat[i][1] * m.mat[1][2] + mat[i][2] * m.mat[2][2] + mat[i][3] * m.mat[3][2];
653  r.mat[i][3] = mat[i][0] * m.mat[0][3] + mat[i][1] * m.mat[1][3] + mat[i][2] * m.mat[2][3] + mat[i][3] * m.mat[3][3];
654  }
655  return r;
656  }
657 };
658 
659 /*****************************************************************************/
660 namespace LePrimitives {
661  const LeVertex up = LeVertex(0.0f, 1.0f, 0.0f);
662  const LeVertex down = LeVertex(0.0f, -1.0f, 0.0f);
663  const LeVertex front = LeVertex(0.0f, 0.0f, -1.0f);
664  const LeVertex back = LeVertex(0.0f, 0.0f, 1.0f);
665  const LeVertex left = LeVertex(-1.0f, 0.0f, 0.0f);
666  const LeVertex right = LeVertex(1.0f, 0.0f, 0.0f);
667  const LeVertex zero = LeVertex(0.0f, 0.0f, 0.0f);
668 }
669 
670 #endif //LE_GEOMETRY_SCALAR_H
671 
672 
673 /*
674 
675 void rotateBackUp(LeVertex back, LeVertex up, float a)
676 {
677 back.normalize();
678 up.normalize();
679 LeVertex right = up.cross(back);
680 
681 LeMatrix m1;
682 m1.mat[0][0] = right.x;
683 m1.mat[0][1] = right.y;
684 m1.mat[0][2] = right.z;
685 m1.mat[0][3] = right.w;
686 
687 m1.mat[1][0] = up.x;
688 m1.mat[1][1] = up.y;
689 m1.mat[1][2] = up.z;
690 m1.mat[1][3] = up.w;
691 
692 m1.mat[2][0] = back.x;
693 m1.mat[2][1] = back.y;
694 m1.mat[2][2] = back.z;
695 m1.mat[2][3] = back.w;
696 
697 LeMatrix m2;
698 m2.rotateY(a);
699 
700 LeMatrix m3;
701 m3.mat[0][0] = right.x;
702 m3.mat[1][0] = right.y;
703 m3.mat[2][0] = right.z;
704 m3.mat[3][0] = 0.0f;
705 
706 m3.mat[0][1] = up.x;
707 m3.mat[1][1] = up.y;
708 m3.mat[2][1] = up.z;
709 m3.mat[3][1] = 0.0f;
710 
711 m3.mat[0][2] = back.x;
712 m3.mat[1][2] = back.y;
713 m3.mat[2][2] = back.z;
714 m3.mat[3][2] = 0.0f;
715 
716 m3.mat[0][3] = 0.0f;
717 m3.mat[1][3] = 0.0f;
718 m3.mat[2][3] = 0.0f;
719 m3.mat[3][3] = 1.0f;
720 
721 *this = m3 * m2 * m1 * *this;
722 }
723 
724 void rotateBackRight(LeVertex back, LeVertex right, float a)
725 {
726 back.normalize();
727 right.normalize();
728 LeVertex up = back.cross(right);
729 
730 LeMatrix m1;
731 m1.mat[0][0] = right.x;
732 m1.mat[0][1] = right.y;
733 m1.mat[0][2] = right.z;
734 m1.mat[0][3] = right.w;
735 
736 m1.mat[1][0] = up.x;
737 m1.mat[1][1] = up.y;
738 m1.mat[1][2] = up.z;
739 m1.mat[1][3] = up.w;
740 
741 m1.mat[2][0] = back.x;
742 m1.mat[2][1] = back.y;
743 m1.mat[2][2] = back.z;
744 m1.mat[2][3] = back.w;
745 
746 LeMatrix m2;
747 m2.rotateY(a);
748 
749 LeMatrix m3;
750 m3.mat[0][0] = right.x;
751 m3.mat[1][0] = right.y;
752 m3.mat[2][0] = right.z;
753 m3.mat[3][0] = 0.0f;
754 
755 m3.mat[0][1] = up.x;
756 m3.mat[1][1] = up.y;
757 m3.mat[2][1] = up.z;
758 m3.mat[3][1] = 0.0f;
759 
760 m3.mat[0][2] = back.x;
761 m3.mat[1][2] = back.y;
762 m3.mat[2][2] = back.z;
763 m3.mat[3][2] = 1.0f;
764 
765 m3.mat[3][3] = 0.0f;
766 m3.mat[3][3] = 0.0f;
767 m3.mat[3][3] = 0.0f;
768 m3.mat[3][3] = 1.0f;
769 
770 *this = m3 * m2 * m1 * *this;
771 }
772 
773 */
const LeVertex up
Definition: geometry_scalar.h:661
LeVertex floor() const
Definition: geometry_scalar.h:227
LeVertex operator-=(LeVertex v)
Definition: geometry_scalar.h:110
LeVertex(float px, float py, float pz)
Definition: geometry_scalar.h:58
LeVertex operator-() const
Definition: geometry_scalar.h:101
LeAxis xAxis
Definition: geometry_scalar.h:304
void rotateEulerXYZ(LeVertex a)
Definition: geometry_scalar.h:411
LeVertex origin
Definition: geometry_scalar.h:267
void rotateY(float a)
Definition: geometry_scalar.h:467
LeVertex operator+(LeVertex v) const
Definition: geometry_scalar.h:75
void scale(LeVertex s)
Definition: geometry_scalar.h:401
bool operator==(LeVertex v)
Definition: geometry_scalar.h:188
LeMatrix inverse3x3()
Definition: geometry_scalar.h:600
LeVertex()
Definition: geometry_scalar.h:50
LeVertex operator/(LeVertex v) const
Definition: geometry_scalar.h:127
LeAxis()
Definition: geometry_scalar.h:271
LeAxis(LeVertex v1, LeVertex v2)
Definition: geometry_scalar.h:282
LightEngine 3D: General engine configuration file.
float x
Definition: geometry_scalar.h:48
LightEngine 3D: Global helpers and definitions.
Definition: geometry_scalar.h:660
const LeVertex down
Definition: geometry_scalar.h:662
LePlane(LeVertex v1, LeVertex v2, LeVertex v3)
Definition: geometry_scalar.h:323
void alignBackRight(LeVertex back, LeVertex right)
Definition: geometry_scalar.h:569
const LeVertex back
Definition: geometry_scalar.h:664
const LeVertex front
Definition: geometry_scalar.h:663
void rotateEulerZXY(LeVertex a)
Definition: geometry_scalar.h:439
LeVertex cross(LeVertex v) const
Definition: geometry_scalar.h:198
LeAxis yAxis
Definition: geometry_scalar.h:305
float norm() const
Definition: geometry_scalar.h:253
LeAxis zAxis
Definition: geometry_scalar.h:306
void rotateZ(float a)
Definition: geometry_scalar.h:481
float y
Definition: geometry_scalar.h:48
LeMatrix()
Definition: geometry_scalar.h:350
LeVertex normalize()
Definition: geometry_scalar.h:237
void rotateX(float a)
Definition: geometry_scalar.h:453
void rotateEulerYXZ(LeVertex a)
Definition: geometry_scalar.h:432
Represent a vertex in 3D space.
Definition: geometry_scalar.h:46
Represent a 4x4 matrix to handle 3D transforms.
Definition: geometry_scalar.h:346
LeVertex operator*(LeVertex v) const
Definition: geometry_scalar.h:118
LeVertex axis
Definition: geometry_scalar.h:268
float norm
Definition: geometry_scalar.h:269
float z
Definition: geometry_scalar.h:48
void rotate(LeVertex axis, float angle)
Definition: geometry_scalar.h:495
void toEulerZYX(LeVertex &angle)
Definition: geometry_scalar.h:525
LeVertex sign() const
Definition: geometry_scalar.h:207
float w
Definition: geometry_scalar.h:48
void identity()
Definition: geometry_scalar.h:355
void translate(LeVertex d)
Definition: geometry_scalar.h:394
LeVertex operator/=(LeVertex v)
Definition: geometry_scalar.h:163
LeVertex operator*(LeVertex v) const
Definition: geometry_scalar.h:626
Represent an axis in 3D space.
Definition: geometry_scalar.h:265
void rotateEulerZYX(LeVertex a)
Definition: geometry_scalar.h:446
float dot(LeVertex v) const
Definition: geometry_scalar.h:193
LeMatrix operator+(LeMatrix m) const
Definition: geometry_scalar.h:634
void rotateEulerYZX(LeVertex a)
Definition: geometry_scalar.h:425
static LeVertex spherical(float azi, float inc, float dist)
Definition: geometry_scalar.h:66
void rotateEulerXZY(LeVertex a)
Definition: geometry_scalar.h:418
LeVertex operator+=(LeVertex v)
Definition: geometry_scalar.h:84
const LeVertex left
Definition: geometry_scalar.h:665
const LeVertex zero
Definition: geometry_scalar.h:667
LePlane()
Definition: geometry_scalar.h:308
float mat[4][4]
Definition: geometry_scalar.h:348
const LeVertex right
Definition: geometry_scalar.h:666
Represent a plane in 3D space.
Definition: geometry_scalar.h:302
void transpose()
Definition: geometry_scalar.h:385
LeVertex round() const
Definition: geometry_scalar.h:217
void alignBackUp(LeVertex back, LeVertex up)
Definition: geometry_scalar.h:540
LeVertex operator*=(LeVertex v)
Definition: geometry_scalar.h:155
void zero()
Definition: geometry_scalar.h:378