Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SbSphere Class Reference

Class for representing a sphere. More...

#include <Inventor/SbSphere.h>

Public Member Functions

 SbSphere ()
 Default constructor.
 
 SbSphere (const SbVec3f &c, float r)
 Constructor that takes a center and a radius.
 
void setValue (const SbVec3f &c, float r)
 Change the center and radius.
 
void setCenter (const SbVec3f &c)
 Set the center.
 
void setRadius (float r)
 Set the radius.
 
const SbVec3fgetCenter () const
 Return the center.
 
float getRadius () const
 Return the radius.
 
void circumscribe (const SbBox3f &box)
 Return a sphere containing a given box.
 
SbBool intersect (const SbLine &l, SbVec3f &intersection) const
 Intersect line and sphere, returning TRUE if there is an intersection.
 
SbBool intersect (const SbLine &l, SbVec3f &enter, SbVec3f &exit) const
 Intersect line and sphere, returning TRUE if there is an intersection.
 

Detailed Description

Class for representing a sphere.

Represents a sphere in 3D. This is a lightweight datatype that is used for arguments or return values in the Open Inventor toolkit. See SoSphere for a database sphere (used for rendering, picking, etc.).

SEE ALSO

SbVec3f, SbLine, SoSphere

Definition at line 57 of file SbSphere.h.

Constructor & Destructor Documentation

◆ SbSphere() [1/2]

SbSphere::SbSphere ( )
inline

Default constructor.

The sphere is not initialized.

Definition at line 63 of file SbSphere.h.

◆ SbSphere() [2/2]

SbSphere::SbSphere ( const SbVec3f c,
float  r 
)

Constructor that takes a center and a radius.

Member Function Documentation

◆ circumscribe()

void SbSphere::circumscribe ( const SbBox3f box)

Return a sphere containing a given box.

◆ getCenter()

const SbVec3f & SbSphere::getCenter ( ) const
inline

Return the center.

Definition at line 87 of file SbSphere.h.

◆ getRadius()

float SbSphere::getRadius ( ) const
inline

Return the radius.

Definition at line 91 of file SbSphere.h.

◆ intersect() [1/2]

SbBool SbSphere::intersect ( const SbLine l,
SbVec3f enter,
SbVec3f exit 
) const

Intersect line and sphere, returning TRUE if there is an intersection.

The line is treated as a ray.

◆ intersect() [2/2]

SbBool SbSphere::intersect ( const SbLine l,
SbVec3f intersection 
) const

Intersect line and sphere, returning TRUE if there is an intersection.

The line is treated as a ray.

◆ setCenter()

void SbSphere::setCenter ( const SbVec3f c)

Set the center.

◆ setRadius()

void SbSphere::setRadius ( float  r)

Set the radius.

◆ setValue()

void SbSphere::setValue ( const SbVec3f c,
float  r 
)

Change the center and radius.


The documentation for this class was generated from the following file: