Ocean
Plane3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_MATH_PLANE_3_H
9 #define META_OCEAN_MATH_PLANE_3_H
10 
11 #include "ocean/math/Math.h"
13 #include "ocean/math/Vector3.h"
14 
15 #include <vector>
16 
17 namespace Ocean
18 {
19 
20 // Forward declaration.
21 template <typename T> class LineT3;
22 
23 // Forward declaration.
24 template <typename T> class PlaneT3;
25 
26 /**
27  * Definition of the Plane3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single or double precision float data type.
28  * @see PlaneT3
29  * @ingroup math
30  */
32 
33 /**
34  * Definition of a 3D plane with double values.
35  * @see PlaneT3
36  * @ingroup math
37  */
39 
40 /**
41  * Definition of a 3D plane with float values.
42  * @see PlaneT3
43  * @ingroup math
44  */
46 
47 /**
48  * Definition of a typename alias for vectors with PlaneT3 objects.
49  * @see PlaneT3
50  * @ingroup math
51  */
52 template <typename T>
53 using PlanesT3 = std::vector<PlaneT3<T>>;
54 
55 /**
56  * Definition of a vector holding Plane3 objects.
57  * @see Plane3
58  * @ingroup math
59  */
60 typedef std::vector<Plane3> Planes3;
61 
62 /**
63  * This class implements a plane in 3D space.
64  * The plane is defined by:<br>
65  * (x - p)n = 0, xn - pn = 0, xn - d = 0,<br>
66  * with Intersection point p, normal n and distance d.<br>
67  * @tparam T Data type used to represent the plane
68  * @see Plane3, PlaneF3, PlaneD3.
69  * @ingroup math
70  */
71 template <typename T>
72 class PlaneT3
73 {
74  public:
75 
76  /**
77  * Definition of the used data type.
78  */
79  typedef T Type;
80 
81  public:
82 
83  /**
84  * Creates an invalid plane.
85  */
86  PlaneT3() = default;
87 
88  /**
89  * Creates a plane by an intersection point and a normal.
90  * @param point Intersection point of the plane
91  * @param normal Unit vector perpendicular to the plane
92  */
93  PlaneT3(const VectorT3<T>& point, const VectorT3<T>& normal);
94 
95  /**
96  * Creates a plane by three points lying in the plane.
97  * To create a valid plane three individual non-collinear points must be provided.<br>
98  * However, due to performance reasons this constructor accepts any kind of 3D object points but may create an invalid plane.<br>
99  * Thus, check whether the plane is valid after creation.
100  * @param point0 First intersection point
101  * @param point1 Second intersection point
102  * @param point2 Third intersection point
103  * @see isValid().
104  */
105  PlaneT3(const VectorT3<T>& point0, const VectorT3<T>& point1, const VectorT3<T>& point2);
106 
107  /**
108  * Creates a plane by the plane's normal and the distance between origin and plane.
109  * @param normal Plane normal, must have length 1
110  * @param distance The signed distance between origin and plane, with range (-infinity, infinity)
111  */
112  PlaneT3(const VectorT3<T>& normal, const T distance);
113 
114  /**
115  * Creates a plane by the plane's normal and the distance between origin and plane.
116  * The plane's normal is provided in yaw and pitch angles from an Euler rotation.<br>
117  * The default normal (with yaw and pitch zero) looks along the negative z-axis.<br>
118  * @param yaw The yaw angle of the plane's normal, in radian
119  * @param pitch The pitch angle of the plane's normal, in radian
120  * @param distance The distance between origin and plane
121  */
122  PlaneT3(const T yaw, const T pitch, const T distance);
123 
124  /**
125  * Creates a plane by a transformation where the z-axis defined the plane's normal and the origin or the transformation defines a point on the plane.
126  * The z-axis will be normalized before it is assigned as normal of the plane.
127  * @param transformation The transformation from which a plane will be defined
128  */
130 
131  /**
132  * Returns whether a point is in the plane.
133  * @param point The point to check
134  * @param epsilon The epsilon value defining the accuracy threshold, with range [0, infinity)
135  * @return True, if so
136  */
137  bool isInPlane(const VectorT3<T>& point, const T epsilon = NumericT<T>::eps()) const;
138 
139  /**
140  * Returns the distance between a given point and this plane.
141  * The distance will be positive for points on the side of the plane that its normal pointing to and negative on the other.
142  * @param point The point for which the distance will be determined
143  * @return Distance between plane and point, with range (-infinity, infinity)
144  */
145  T signedDistance(const VectorT3<T>& point) const;
146 
147  /**
148  * Projects a given point onto the plane.
149  * @param point The point that will be projected
150  * @return The projected point
151  */
153 
154  /**
155  * Reflects a given vector in the plane.
156  * The given vector should point towards the plane.
157  * @param direction The direction vector being reflected
158  * @return The reflected vector
159  */
160  VectorT3<T> reflect(const VectorT3<T>& direction);
161 
162  /**
163  * Returns the normal of the plane
164  * @return Plane normal
165  */
166  inline const VectorT3<T>& normal() const;
167 
168  /**
169  * Returns the distance between plane and origin.
170  * @return Plane distance
171  */
172  inline const T& distance() const;
173 
174  /**
175  * Calculates the yaw and pitch angle of the plane's normal.
176  * The angles are related to an Euler rotation while the default normal (with angles zero) looks along the negative z-axis.<br>
177  * @param yaw Resulting yaw angle, in radian
178  * @param pitch Resulting pitch angle, in radian
179  */
180  inline void decomposeNormal(T& yaw, T& pitch) const;
181 
182  /**
183  * Transforms this plane so that it corresponds to a new coordinate system.
184  * @param iTransformation The inverse of a new coordinate system (defining the transformation from points defined in the coordinate system of this current plane to points defined in the new coordinate system)
185  * @return Resulting new plane for the given (inverted) coordinate system
186  */
187  PlaneT3<T> transform(const HomogenousMatrixT4<T>& iTransformation) const;
188 
189  /**
190  * Determines a transformation having the origin in a given point on the plane, with z-axis corresponding to the normal of the plane and with y-axis corresponding to a given (projected) up-vector.
191  * @param pointOnPlane A 3D point on this 3D plane at which the origin of the transformation will be located
192  * @param upVector An up-vector starting at the given point on the 3D plane, the vector will be projected onto the plane and normalized to define the y-axis of the transformation, can be e.g., the viewing direction of the camera, must not be parallel to the plane's normal
193  * @param matrix The resulting matrix defining the transformation
194  * @return True, if succeeded
195  */
196  bool transformation(const VectorT3<T>& pointOnPlane, const VectorT3<T>& upVector, HomogenousMatrixT4<T>& matrix) const;
197 
198  /**
199  * Sets the normal of this plane
200  * @param normal The normal to be set, must have length 1.
201  */
202  inline void setNormal(const VectorT3<T>& normal);
203 
204  /**
205  * Sets the distance between plane and origin.
206  * @param distance Plane distance to be set
207  */
208  inline void setDistance(const T distance);
209 
210  /**
211  * Returns a point on the plane.
212  * @return Point on plane
213  */
214  inline VectorT3<T> pointOnPlane() const;
215 
216  /**
217  * Calculates the intersection between this plane and a given ray.
218  * @param ray The ray for which the intersection will be calculated, must be valid
219  * @param point Resulting intersection point
220  * @return True, if the ray has an intersection with this plane
221  */
222  bool intersection(const LineT3<T>& ray, VectorT3<T>& point) const;
223 
224  /**
225  * Calculates the intersection between this plane and a second plane.
226  * @param plane The second plane for which the intersection will be calculated, must be valid
227  * @param line Resulting intersection line
228  * @return True, if the second plane has an intersection with this plane (if both planes are not parallel)
229  */
230  bool intersection(const PlaneT3<T>& plane, LineT3<T>& line) const;
231 
232  /**
233  * Returns whether this plane is valid.
234  * A valid plane has a normal with length 1.
235  * @return True, if so
236  */
237  bool isValid() const;
238 
239  /**
240  * Returns whether two plane objects represent the same plane up to a specified epsilon.
241  * Two planes are identical if their normal vector and distance value is identical or inverted.
242  * @param plane The second plane to compare
243  * @param eps The epsilon value to be used, with range [0, infinity)
244  * @return True, if so
245  */
246  inline bool isEqual(const PlaneT3<T>& plane, const T eps = NumericT<T>::eps()) const;
247 
248  /**
249  * Returns whether the plane has a normal with non-zero length.
250  * Beware: A plane with non-zero length normal may be invalid, however.
251  * @return True, if so
252  */
253  explicit inline operator bool() const;
254 
255  /**
256  * Returns an inverted plane of this plane having an inverted normal direction (and adjusted distance).
257  * @return The inverted plane
258  */
259  inline PlaneT3<T> operator-() const;
260 
261  /**
262  * Returns whether two plane objects represent the same plane.
263  * Two planes are identical if their normal vector and distance value is identical or inverted.<br>
264  * @param right Second plane to compare
265  * @return True, if so
266  */
267  inline bool operator==(const PlaneT3<T>& right) const;
268 
269  /**
270  * Returns whether two plane objects do not represent the same plane.
271  * @param right Second plane to compare
272  * @return True, if so
273  */
274  inline bool operator!=(const PlaneT3<T>& right) const;
275 
276  protected:
277 
278  /// Normal of the plane.
280 
281  /// Distance of the plane.
282  T distance_ = T(0);
283 };
284 
285 template <typename T>
286 PlaneT3<T>::PlaneT3(const VectorT3<T>& point, const VectorT3<T>& normal) :
287  normal_(normal),
288  distance_(point * normal_)
289 {
290  ocean_assert(NumericT<T>::isEqual(normal_.length(), T(1.0)));
291 }
292 
293 template <typename T>
294 PlaneT3<T>::PlaneT3(const VectorT3<T>& point0, const VectorT3<T>& point1, const VectorT3<T>& point2)
295 {
296  const VectorT3<T> direction10 = point1 - point0;
297  const VectorT3<T> direction20 = point2 - point0;
298 
299  if (direction10 != direction20 && direction10 != -direction20) // due to floating point precision with ARM and 32bit, checking for different directions before determining the normal
300  {
301  normal_ = direction10.cross(direction20).normalizedOrZero();
302  distance_ = point0 * normal_;
303  }
304 }
305 
306 template <typename T>
307 PlaneT3<T>::PlaneT3(const VectorT3<T>& normal, const T distance) :
308  normal_(normal),
309  distance_(distance)
310 {
311  ocean_assert(isValid());
312 }
313 
314 template <typename T>
315 PlaneT3<T>::PlaneT3(const T yaw, const T pitch, const T distance) :
316  distance_(distance)
317 {
318  const T hypotenuse = NumericT<T>::cos(pitch);
319  normal_ = VectorT3<T>(-NumericT<T>::sin(yaw) * hypotenuse, NumericT<T>::sin(pitch), -NumericT<T>::cos(yaw) * hypotenuse);
320 
321  ocean_assert(isValid());
322 }
323 
324 template <typename T>
326  normal_(transformation.zAxis()),
327  distance_(0)
328 {
329  ocean_assert(transformation.isValid());
330 
331  if (normal_.normalize())
332  {
333  distance_ = transformation.translation() * normal_;
334  }
335 
336  ocean_assert(isValid());
337 }
338 
339 template <typename T>
340 inline const VectorT3<T>& PlaneT3<T>::normal() const
341 {
342  return normal_;
343 }
344 
345 template <typename T>
346 inline const T& PlaneT3<T>::distance() const
347 {
348  return distance_;
349 }
350 
351 template <typename T>
352 inline void PlaneT3<T>::decomposeNormal(T& yaw, T& pitch) const
353 {
354  ocean_assert(isValid());
355 
356  yaw = NumericT<T>::atan2(-normal_.x(), -normal_.z());
357  pitch = NumericT<T>::asin(normal_.y());
358 }
359 
360 template <typename T>
362 {
363  ocean_assert(isValid() && iTransformation.isValid());
364 
365  const VectorT3<T> normal(iTransformation.rotationMatrix(normal_));
366  ocean_assert(NumericT<T>::isEqual(normal.length(), 1));
367 
368  const VectorT3<T> pointOnNewPlane(iTransformation * pointOnPlane());
369  ocean_assert((iTransformation.inverted() * pointOnNewPlane).isEqual(pointOnPlane(), NumericT<T>::weakEps()));
370 
371  const T distance = pointOnNewPlane * normal;
372 
373  const PlaneT3<T> result(normal, distance);
374  ocean_assert(result.isInPlane(normal * distance, NumericT<T>::weakEps()));
375 
376  return result;
377 }
378 
379 template <typename T>
380 bool PlaneT3<T>::transformation(const VectorT3<T>& pointOnPlane, const VectorT3<T>& upVector, HomogenousMatrixT4<T>& matrix) const
381 {
382  ocean_assert(isValid());
383 
384  ocean_assert(NumericT<T>::isEqualEps(signedDistance(pointOnPlane)));
385  ocean_assert(!normal_.isParallel(upVector));
386 
387  if (NumericT<T>::isNotEqualEps(signedDistance(pointOnPlane)))
388  {
389  return false;
390  }
391 
392  VectorT3<T> yAxis = projectOnPlane(pointOnPlane + upVector) - pointOnPlane;
393 
394  if (!yAxis.normalize())
395  {
396  return false;
397  }
398 
399  const VectorT3<T>& zAxis = normal_;
400 
401  ocean_assert(NumericT<T>::isEqualEps(yAxis * zAxis));
402 
403  const VectorT3<T> xAxis(yAxis.cross(zAxis));
404 
405  ocean_assert(NumericT<T>::isEqualEps(xAxis * yAxis));
406  ocean_assert(NumericT<T>::isEqualEps(xAxis * zAxis));
407 
408  matrix = HomogenousMatrixT4<T>(xAxis, yAxis, zAxis, pointOnPlane);
409  return true;
410 }
411 
412 template <typename T>
413 inline void PlaneT3<T>::setNormal(const VectorT3<T>& normal)
414 {
415  ocean_assert(NumericT<T>::isEqual(normal.length(), 1));
416  normal_ = normal;
417 }
418 
419 template <typename T>
420 inline void PlaneT3<T>::setDistance(const T distance)
421 {
422  distance_ = distance;
423 }
424 
425 template <typename T>
427 {
428  ocean_assert(isInPlane(normal_ * distance_, NumericT<T>::weakEps()));
429  return normal_ * distance_;
430 }
431 
432 template <typename T>
433 bool PlaneT3<T>::isInPlane(const VectorT3<T>& point, const T epsilon) const
434 {
435  ocean_assert(isValid());
436 
437  return NumericT<T>::isEqual(point * normal_ - distance_, 0, epsilon);
438 }
439 
440 template <typename T>
442 {
443  ocean_assert(isValid());
444 
445  return point * normal_ - distance_;
446 }
447 
448 template <typename T>
450 {
451  ocean_assert(isValid());
452 
453  const VectorT3<T> result(point - normal_ * signedDistance(point));
454 
455  ocean_assert((std::is_same<T, float>::value) || isInPlane(result, NumericT<T>::weakEps()));
456  ocean_assert((std::is_same<T, float>::value) || (isInPlane(point, NumericT<T>::weakEps()) || NumericT<T>::isWeakEqualEps(normal_ * (pointOnPlane() - result))));
457 
458  return result;
459 }
460 
461 template <typename T>
463 {
464  ocean_assert(isValid());
465 
466  // d' = (-dn)n + ((-dn)n + d)
467  // d' = d - 2 (dn)n
468  return direction - normal_ * (T(2.0) * (direction * normal_));
469 }
470 
471 template <typename T>
472 bool PlaneT3<T>::intersection(const LineT3<T>& ray,VectorT3<T>& point) const
473 {
474  ocean_assert(isValid());
475  ocean_assert(ray.isValid());
476 
477  /**
478  * intersection point: ray.point() + t * ray.direction()
479  * t = (plane.distance() - plane.normal() * ray.point()) / (plane.normal() * ray.direction())
480  */
481 
482  const T denominator(normal_ * ray.direction());
483 
484  // if ray and plane are parallel
485  if (NumericT<T>::isEqualEps(denominator))
486  {
487  return false;
488  }
489 
490  const T factor = (distance_ - normal_ * ray.point()) / denominator;
491  point = ray.point() + ray.direction() * factor;
492 
493  ocean_assert((std::is_same<T, float>::value) || NumericT<T>::isWeakEqualEps((point - pointOnPlane()).normalizedOrZero() * normal_));
494 
495  return true;
496 }
497 
498 template <typename T>
499 bool PlaneT3<T>::intersection(const PlaneT3<T>& plane, LineT3<T>& line) const
500 {
501  ocean_assert(isValid());
502  ocean_assert(plane.isValid());
503 
504  // the direction of the line will be perpendicular to both plane normals
505 
506  const VectorT3<T> lineDirection = normal_.cross(plane.normal());
507 
508  VectorT3<T> normalizedLineDirection = lineDirection;
509  if (!normalizedLineDirection.normalize())
510  {
511  // both planes are parallel
512  return false;
513  }
514 
515  const T dotProduct = lineDirection * lineDirection;
516 
517  if (NumericT<T>::isEqualEps(dotProduct))
518  {
519  return false;
520  }
521 
522  // find the point of the line which needs to be in both planes
523 
524  const VectorT3<T> linePoint = (plane.normal_ * distance_ - normal_ * plane.distance_).cross(lineDirection) / dotProduct;
525 
526  ocean_assert(NumericT<T>::isWeakEqualEps(signedDistance(linePoint)));
527  ocean_assert(NumericT<T>::isWeakEqualEps(plane.signedDistance(linePoint)));
528 
529  ocean_assert(NumericT<T>::isWeakEqualEps(lineDirection * normal_));
530  ocean_assert(NumericT<T>::isWeakEqualEps(lineDirection * plane.normal_));
531 
532  line = LineT3<T>(linePoint, normalizedLineDirection);
533 
534  return true;
535 }
536 
537 template <typename T>
539 {
540  return !normal_.isNull() && NumericT<T>::isEqual(normal_.length(), T(1.0));
541 }
542 
543 template <typename T>
544 inline bool PlaneT3<T>::isEqual(const PlaneT3<T>& right, const T eps) const
545 {
546  ocean_assert(isValid());
547 
548  return (NumericT<T>::isEqual(distance_, right.distance_, eps) && normal_.isEqual(right.normal_, eps))
549  || (NumericT<T>::isEqual(distance_, -right.distance_, eps) && normal_.isEqual(-right.normal_, eps));
550 }
551 
552 template <typename T>
553 inline PlaneT3<T>::operator bool() const
554 {
555  return !normal_.isNull();
556 }
557 
558 template <typename T>
560 {
561  ocean_assert(isValid());
562 
563  const PlaneT3<T> result(-normal_, -distance_);
564 
565  ocean_assert(NumericT<T>::isEqualEps(result.signedDistance(pointOnPlane())));
566 
567  return result;
568 }
569 
570 template <typename T>
571 inline bool PlaneT3<T>::operator==(const PlaneT3<T>& right) const
572 {
573  ocean_assert(isValid());
574 
575  return isEqual(right);
576 }
577 
578 template <typename T>
579 inline bool PlaneT3<T>::operator!=(const PlaneT3<T>& right) const
580 {
581  return !(*this == right);
582 }
583 
584 }
585 
586 #endif // META_OCEAN_MATH_PLANE_3_H
This class implements a 4x4 homogeneous transformation matrix using floating point values with the pr...
Definition: HomogenousMatrix4.h:110
HomogenousMatrixT4< T > inverted() const noexcept
Returns the inverted of this matrix.
Definition: HomogenousMatrix4.h:1575
SquareMatrixT3< T > rotationMatrix() const
Returns the rotation matrix of the transformation.
Definition: HomogenousMatrix4.h:1493
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition: HomogenousMatrix4.h:1806
This class implements an infinite line in 3D space.
Definition: Line3.h:70
bool isValid() const
Returns whether this line has valid parameters.
Definition: Line3.h:303
const VectorT3< T > & direction() const
Returns the direction of the line.
Definition: Line3.h:284
const VectorT3< T > & point() const
Returns a point on the line.
Definition: Line3.h:271
This class provides basic numeric functionalities.
Definition: Numeric.h:57
static T atan2(const T y, const T x)
Returns the arctangent of a given value in radian.
Definition: Numeric.h:1632
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition: Numeric.h:2386
static T cos(const T value)
Returns the cosine of a given value.
Definition: Numeric.h:1584
static T asin(const T value)
Returns the arcsine of a given value.
Definition: Numeric.h:2887
bool intersection(const LineT3< T > &ray, VectorT3< T > &point) const
Calculates the intersection between this plane and a given ray.
Definition: Plane3.h:472
bool operator!=(const PlaneT3< T > &right) const
Returns whether two plane objects do not represent the same plane.
Definition: Plane3.h:579
PlaneT3(const VectorT3< T > &point, const VectorT3< T > &normal)
Creates a plane by an intersection point and a normal.
Definition: Plane3.h:286
PlaneT3()=default
Creates an invalid plane.
PlaneT3(const HomogenousMatrixT4< T > &transformation)
Creates a plane by a transformation where the z-axis defined the plane's normal and the origin or the...
Definition: Plane3.h:325
const VectorT3< T > & normal() const
Returns the normal of the plane.
Definition: Plane3.h:340
bool transformation(const VectorT3< T > &pointOnPlane, const VectorT3< T > &upVector, HomogenousMatrixT4< T > &matrix) const
Determines a transformation having the origin in a given point on the plane, with z-axis correspondin...
Definition: Plane3.h:380
void setNormal(const VectorT3< T > &normal)
Sets the normal of this plane.
Definition: Plane3.h:413
T signedDistance(const VectorT3< T > &point) const
Returns the distance between a given point and this plane.
Definition: Plane3.h:441
VectorT3< T > normal_
Normal of the plane.
Definition: Plane3.h:279
bool isInPlane(const VectorT3< T > &point, const T epsilon=NumericT< T >::eps()) const
Returns whether a point is in the plane.
Definition: Plane3.h:433
bool operator==(const PlaneT3< T > &right) const
Returns whether two plane objects represent the same plane.
Definition: Plane3.h:571
bool intersection(const PlaneT3< T > &plane, LineT3< T > &line) const
Calculates the intersection between this plane and a second plane.
Definition: Plane3.h:499
PlaneT3(const VectorT3< T > &normal, const T distance)
Creates a plane by the plane's normal and the distance between origin and plane.
Definition: Plane3.h:307
PlaneT3(const VectorT3< T > &point0, const VectorT3< T > &point1, const VectorT3< T > &point2)
Creates a plane by three points lying in the plane.
Definition: Plane3.h:294
VectorT3< T > pointOnPlane() const
Returns a point on the plane.
Definition: Plane3.h:426
T Type
Definition of the used data type.
Definition: Plane3.h:79
PlaneT3< T > transform(const HomogenousMatrixT4< T > &iTransformation) const
Transforms this plane so that it corresponds to a new coordinate system.
Definition: Plane3.h:361
T distance_
Distance of the plane.
Definition: Plane3.h:282
VectorT3< T > reflect(const VectorT3< T > &direction)
Reflects a given vector in the plane.
Definition: Plane3.h:462
void setDistance(const T distance)
Sets the distance between plane and origin.
Definition: Plane3.h:420
bool isValid() const
Returns whether this plane is valid.
Definition: Plane3.h:538
VectorT3< T > projectOnPlane(const VectorT3< T > &point) const
Projects a given point onto the plane.
Definition: Plane3.h:449
void decomposeNormal(T &yaw, T &pitch) const
Calculates the yaw and pitch angle of the plane's normal.
Definition: Plane3.h:352
PlaneT3(const T yaw, const T pitch, const T distance)
Creates a plane by the plane's normal and the distance between origin and plane.
Definition: Plane3.h:315
PlaneT3< T > operator-() const
Returns an inverted plane of this plane having an inverted normal direction (and adjusted distance).
Definition: Plane3.h:559
const T & distance() const
Returns the distance between plane and origin.
Definition: Plane3.h:346
bool isEqual(const PlaneT3< T > &plane, const T eps=NumericT< T >::eps()) const
Returns whether two plane objects represent the same plane up to a specified epsilon.
Definition: Plane3.h:544
This class implements a vector with three elements.
Definition: Vector3.h:97
bool normalize()
Normalizes this vector.
Definition: Vector3.h:647
VectorT3< T > cross(const VectorT3< T > &vector) const
Returns the cross product of two vectors.
Definition: Vector3.h:597
T length() const
Returns the length of the vector.
Definition: Vector3.h:664
PlaneT3< double > PlaneD3
Definition of a 3D plane with double values.
Definition: Plane3.h:38
PlaneT3< float > PlaneF3
Definition of a 3D plane with float values.
Definition: Plane3.h:45
std::vector< PlaneT3< T > > PlanesT3
Definition of a typename alias for vectors with PlaneT3 objects.
Definition: Plane3.h:53
PlaneT3< Scalar > Plane3
Definition of the Plane3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single ...
Definition: Plane3.h:24
std::vector< Plane3 > Planes3
Definition of a vector holding Plane3 objects.
Definition: Plane3.h:60
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15