8 #ifndef META_OCEAN_MATH_BOUNDING_SPHERE_H
9 #define META_OCEAN_MATH_BOUNDING_SPHERE_H
207 inverseRadius_((radius > 0) ? (
Scalar(1) / radius) :
Scalar(0))
221 ocean_assert(transformation.
isValid());
222 ocean_assert(invertedTransformation.
isValid());
227 position0 = transformation * position0;
228 position1 = transformation * position1;
240 if (
intersections(ray, position0, distance0, position1, distance1))
254 ocean_assert(transformation.
isValid());
255 ocean_assert(invertedTransformation.
isValid());
260 position0 = transformation * position0;
263 position1 = transformation * position1;
279 ocean_assert(ray.
direction() * normal <= 0);
290 ocean_assert(transformation.
isValid());
291 ocean_assert(invertedTransformation.
isValid());
296 position = transformation * position;
306 ocean_assert(transformation.
isValid());
307 ocean_assert(invertedTransformation.
isValid());
312 position = transformation * position;
328 ocean_assert(ray.
direction() * normal >= 0);
339 ocean_assert(transformation.
isValid());
340 ocean_assert(invertedTransformation.
isValid());
345 position = transformation * position;
355 ocean_assert(transformation.
isValid());
356 ocean_assert(invertedTransformation.
isValid());
361 position = transformation * position;
This class implements a 3D bounding box.
Definition: BoundingBox.h:23
This class implements a bounding sphere.
Definition: BoundingSphere.h:23
BoundingSphere()
Creates an invalid bounding sphere.
Definition: BoundingSphere.h:198
Scalar inverseRadius_
Inverse of the sphere radius.
Definition: BoundingSphere.h:195
bool positiveBackIntersection(const Line3 &ray, Vector3 &position, Scalar &distance) const
Returns the back intersection point between a given ray and this sphere whenever the distance is posi...
bool positiveFrontIntersection(const Line3 &ray, Vector3 &position, Scalar &distance) const
Returns the front intersection point between a given ray and this sphere whenever the distance is pos...
bool intersections(const Line3 &ray, Vector3 &position0, Scalar &distance0, Vector3 &position1, Scalar &distance1) const
Returns both intersection points between a given ray and this sphere.
VectorT3< T > transposedRotationMatrix(const VectorT3< T > &vector) const
Transforms a 3D vector by application of only the inner transposed rotation matrix (including scale a...
Definition: HomogenousMatrix4.h:1947
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 implements a 3D sphere.
Definition: Sphere3.h:57
VectorT3< Scalar > center_
Sphere center.
Definition: Sphere3.h:179
bool isValid() const
Returns whether this radius of this sphere is not negative and thus the sphere is valid.
Definition: Sphere3.h:281
Scalar radius_
Sphere radius.
Definition: Sphere3.h:182
VectorT3< T > normalizedOrZero() const
Returns the normalized vector.
Definition: Vector3.h:619
LineT3< Scalar > Line3
Definition of the Line3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition: Line3.h:21
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15