Coin
4.0.3
Coin3D core library
|
The SbSphere class is a representation of a sphere. More...
#include <Inventor/SbSphere.h>
Public Member Functions | |
SbSphere (const SbVec3f ¢er, const float radius) | |
SbSphere (void) | |
void | circumscribe (const SbBox3f &box) |
const SbVec3f & | getCenter (void) const |
float | getRadius (void) const |
SbBool | intersect (const SbLine &l, SbVec3f &enter, SbVec3f &exit) const |
SbBool | intersect (const SbLine &l, SbVec3f &intersection) const |
SbBool | pointInside (const SbVec3f &p) const |
void | print (FILE *file) const |
void | setCenter (const SbVec3f ¢er) |
void | setRadius (const float radius) |
void | setValue (const SbVec3f ¢er, const float radius) |
The SbSphere class is a representation of a sphere.
This class is used within many other classes in Coin. It contains the data necessary to represent a sphere (a 3D point and a radius).
SbSphere::SbSphere | ( | void | ) |
The default constructor does nothing. The center point and the radius will be uninitialized.
Construct an SbSphere instance with the given center point and radius.
Make the sphere exactly contain box, i.e. the sphere center point will be the same as that of the box, and the radius will be the distance from the box center point to any of the corners.
Returns an SbVec3f with the sphere's center point.
float SbSphere::getRadius | ( | void | ) | const |
Returns the sphere's radius.
Find the intersection points of the ray l on the sphere and return these in enter and exit. If the ray just "grazes" the sphere, the enter and exit points have equal values.
If the ray does not intersect the sphere, FALSE is returned, otherwise we will return TRUE.
Finds the intersection enter point for the given line l on the sphere.
If the line does not intersect the sphere, FALSE is returned.
Returns TRUE of the given point p lies within the sphere.
Dump the state of this object to the fp file stream. Only works in debug version of library, method does nothing in an optimized build.
Set the sphere's center point.
Set the sphere's radius.
Set the sphere's center point and radius.