Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a sphere in 3D space. More...
#include <omSphere3D.h>
Public Member Functions | |
Sphere3D () | |
Create a sphere object that has a radius of 0 and a position centered at the origin. More... | |
Sphere3D (const VectorND< T, 3 > &newPosition, T newRadius) | |
Create a sphere object with the specified center position and radius. More... | |
Sphere3D (const VectorND< T, 3 > &a, const VectorND< T, 3 > &b, const VectorND< T, 3 > &c) | |
Create a sphere object that tightly bounds the specified 3 points in space. More... | |
Sphere3D (const VectorND< T, 3 > *points, Size numPoints) | |
Create a sphere object that encloses all of the points in the specified array. More... | |
Sphere3D (const Sphere3D &sphere1, const Sphere3D &sphere2) | |
Create a sphere object that encloses the two given bounding spheres. More... | |
template<typename U > | |
Sphere3D (const Sphere3D< U > &other) | |
Create a copy of a sphere object with another templated type. More... | |
template<typename U > | |
Sphere3D & | operator= (const Sphere3D< U > &other) |
Assign a sphere object with another templated type to this bounding sphere. More... | |
Bool | intersects (const Sphere3D &sphere) const |
Return whether or not this sphere intersects another. More... | |
void | enlargeFor (const Sphere3D &other) |
Enlarge this bounding sphere so that it encloses both its original volume and another sphere. More... | |
void | enlargeFor (const VectorND< T, 3 > &point) |
Enlarge this bounding sphere so that it encloses both its original volume and the given point. More... | |
Sphere3D | operator| (const Sphere3D &sphere) const |
Compute the union of this bounding sphere with another. More... | |
Public Attributes | |
VectorND< T, 3 > | position |
The position of the center of this Sphere3D. More... | |
T | radius |
The radius of this Sphere3D. More... | |
A class that represents a sphere in 3D space.
|
inline |
Create a sphere object that has a radius of 0 and a position centered at the origin.
|
inline |
|
inline |
Create a sphere object that tightly bounds the specified 3 points in space.
This constructor can be used to easily create a bounding sphere for a triangle.
|
inline |
Create a sphere object that encloses all of the points in the specified array.
This constructor uses an implementation-defined method of generating a bounding sphere for an arbitrary set of points in 3D space. The resulting sphere is not guaranteed to be a minimal bounding sphere but should offer a reasonably-tight fit of the input point set. The constructor uses numPoints sequential points from the array of input points to construct the bounding sphere. If the number of input points is 0 or the point array is NULL, the resulting sphere will be a sphere of 0 radius centered at the origin.
points | - a pointer to an array of input point data. |
numPoints | - the number of sequential points to use from the point array. |
|
inline |
Create a sphere object that encloses the two given bounding spheres.
|
inline |
Create a copy of a sphere object with another templated type.
other | - the bounding sphere object that should be copied. |
|
inline |
Assign a sphere object with another templated type to this bounding sphere.
other | - the bounding sphere object that should be copied. |
|
inline |
Return whether or not this sphere intersects another.
If the spheres intersect, TRUE is returned. Otherwise, FALSE is returned.
sphere | - the sphere to test for intersection with this Sphere3D. |
|
inline |
Enlarge this bounding sphere so that it encloses both its original volume and another sphere.
|
inline |
Enlarge this bounding sphere so that it encloses both its original volume and the given point.
|
inline |
VectorND<T,3> om::math::Sphere3D< T >::position |
The position of the center of this Sphere3D.
T om::math::Sphere3D< T >::radius |
The radius of this Sphere3D.