#include <BoundingSphere.h>
Inheritance diagram for nvmath::BoundingSphere:
Public Member Functions | |
BoundingSphere () | |
Constructor. | |
NVSG_API bool | extend (const Sphere3f &sphere) |
Extend this BoundingSphere by a sphere. | |
NVSG_API const Sphere3f & | getSphere (void) const |
Get the sphere. | |
NVSG_API void | setSphere (const Sphere3f &sphere) |
Set the sphere. | |
NVSG_API const Vec3f & | getCenter (void) const |
Get the center. | |
NVSG_API float | getRadius (void) const |
Get the radius. | |
NVSG_API void | invalidate (void) |
Invalidate the BoundingSphere. | |
NVSG_API bool | isValid (void) const |
Determine if the BoundingSphere is valid. | |
NVSG_API bool | set (const Vec3f *vertices, size_t numVertices) |
Set the BoundingSphere to include a vector of points. | |
NVSG_API void | transform (const Mat44f &m) |
Transform the BoundingSphere by a matrix. | |
NVSG_API void | enlarge (float factor) |
Enlarge the bounding sphere by a factor. |
Because determining the optimal bounding sphere of a set of points is rather cumbersome, this BoundingSphere is an approximation that uses the baricenter of a set of points. On extending a BoundingSphere with another, the sphere that includes both and is tangent to them is used.
|
Constructor.
|
|
Extend this BoundingSphere by a sphere. This BoundingSphere is extended to include the given sphere. If they don't include each other the new sphere is tangent to both of them.
|
|
Get the sphere. It is assumed that this BoundingSphere is valid.
|
|
Set the sphere. Makes the BoundingSphere valid. |
|
Get the center. It is assumed that this BoundingSphere is valid.
Reimplemented from nvmath::Sphere3f. |
|
Get the radius. It is assumed that this BoundingSphere is valid.
Reimplemented from nvmath::Sphere3f. |
|
Invalidate the BoundingSphere. Marks this BoundingSphere as invalid. After this, neither center nor radius can be assumed to be valid. |
|
Determine if the BoundingSphere is valid. A BoundingSphere is valid if it has been set with at least two points.
|
|
Set the BoundingSphere to include a vector of points. A BoundingSphere of the given points is calculated by using the baricenter of the points as the center of the BoundingSphere.
|
|
Transform the BoundingSphere by a matrix. The center of the BoundingSphere is pre-multiplied by the given matrix.
|
|
Enlarge the bounding sphere by a factor.
|