8#ifndef META_OCEAN_MATH_BOUNDING_SPHERE_H
9#define META_OCEAN_MATH_BOUNDING_SPHERE_H
220 ocean_assert(transformation.
isValid());
221 ocean_assert(invertedTransformation.
isValid());
226 position0 = transformation * position0;
227 position1 = transformation * position1;
239 if (
intersections(ray, position0, distance0, position1, distance1))
253 ocean_assert(transformation.
isValid());
254 ocean_assert(invertedTransformation.
isValid());
259 position0 = transformation * position0;
262 position1 = transformation * position1;
278 ocean_assert(ray.
direction() * normal <= 0);
289 ocean_assert(transformation.
isValid());
290 ocean_assert(invertedTransformation.
isValid());
295 position = transformation * position;
305 ocean_assert(transformation.
isValid());
306 ocean_assert(invertedTransformation.
isValid());
311 position = transformation * position;
327 ocean_assert(ray.
direction() * normal >= 0);
338 ocean_assert(transformation.
isValid());
339 ocean_assert(invertedTransformation.
isValid());
344 position = transformation * position;
354 ocean_assert(transformation.
isValid());
355 ocean_assert(invertedTransformation.
isValid());
360 position = transformation * position;
This class implements a 3D bounding box.
Definition BoundingBox.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:1939
SquareMatrixT3< T > rotationMatrix() const
Returns the rotation matrix of the transformation.
Definition HomogenousMatrix4.h:1487
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition HomogenousMatrix4.h:1800
bool isValid() const
Returns whether this line has valid parameters.
Definition Line3.h:312
const VectorT3< T > & direction() const
Returns the direction of the line.
Definition Line3.h:293
const VectorT3< T > & point() const
Returns a point on the line.
Definition Line3.h:280
VectorT3< Scalar > center_
Definition Sphere3.h:179
const Scalar & radius() const
Scalar radius_
Definition Sphere3.h:182
const VectorT3< Scalar > & center() const
VectorT3< T > normalizedOrZero() const
Returns the normalized vector.
Definition Vector3.h:623
SphereT3< Scalar > Sphere3
Definition of the Sphere3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single...
Definition Sphere3.h:28
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition Vector3.h:29
LineT3< Scalar > Line3
Definition of the Line3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Line3.h:27
float Scalar
Definition of a scalar type.
Definition Math.h:129
The namespace covering the entire Ocean framework.
Definition Accessor.h:15