Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
G3D::Sphere Class Reference

Sphere. More...

Public Member Functions

 Sphere ()
 
 Sphere (float radius)
 
 Sphere (class BinaryInput &b)
 
 Sphere (const class Any &a)
 Format is one of:
 
 Sphere (const Point3 &center, float radius)
 
virtual ~Sphere ()
 
float area () const
 
bool contains (const Point3 &point) const
 Returns true if point is less than or equal to radius away from the center.
 
bool contains (const Sphere &other) const
 
bool culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const
 
bool culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const
 
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const
 See AABox::culledBy.
 
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const
 Conservative culling test that does not produce a mask for children.
 
void deserialize (class BinaryInput &b)
 
void getBounds (class AABox &out) const
 
bool intersects (const Sphere &other) const
 
void merge (const Sphere &s)
 Sets this to the smallest sphere that encapsulates both.
 
bool operator!= (const Sphere &other) const
 
Sphere operator+ (const Vector3 &v) const
 Translates the sphere.
 
Sphere operator- (const Vector3 &v) const
 Translates the sphere.
 
bool operator== (const Sphere &other) const
 
Point3 randomInteriorPoint () const
 Uniformly distributed on the interior (includes surface)
 
Point3 randomSurfacePoint () const
 Uniformly distributed on the surface.
 
void serialize (class BinaryOutput &b) const
 
Any toAny () const
 
virtual std::string toString () const
 
float volume () const
 

Static Public Member Functions

static const Sphereinf ()
 Returns the infinite sphere.
 

Public Attributes

Point3 center
 
float radius
 

Detailed Description

Sphere.

Constructor & Destructor Documentation

G3D::Sphere::Sphere ( )
inline

Referenced by operator+(), and operator-().

G3D::Sphere::Sphere ( float  radius)
inlineexplicit
G3D::Sphere::Sphere ( class BinaryInput b)
G3D::Sphere::Sphere ( const class Any a)
explicit

Format is one of:

  • Sphere(point, radius)
  • Sphere(radius)
G3D::Sphere::Sphere ( const Point3 center,
float  radius 
)
inline
virtual G3D::Sphere::~Sphere ( )
inlinevirtual

Member Function Documentation

float G3D::Sphere::area ( ) const

Referenced by G3D::SphereShape::area().

bool G3D::Sphere::contains ( const Point3 point) const

Returns true if point is less than or equal to radius away from the center.

Referenced by G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers().

bool G3D::Sphere::contains ( const Sphere other) const
bool G3D::Sphere::culledBy ( const class Plane plane,
int  numPlanes,
int32 cullingPlaneIndex,
const uint32  testMask,
uint32 childMask 
) const
Deprecated:
Use culledBy(Array<Plane>&)
bool G3D::Sphere::culledBy ( const class Plane plane,
int  numPlanes,
int32 cullingPlaneIndex = dummy,
const uint32  testMask = 0xFFFFFFFF 
) const
Deprecated:
Use culledBy(Array<Plane>&)
bool G3D::Sphere::culledBy ( const Array< Plane > &  plane,
int32 cullingPlaneIndex,
const uint32  testMask,
uint32 childMask 
) const
bool G3D::Sphere::culledBy ( const Array< Plane > &  plane,
int32 cullingPlaneIndex = dummy,
const uint32  testMask = 0xFFFFFFFF 
) const

Conservative culling test that does not produce a mask for children.

void G3D::Sphere::deserialize ( class BinaryInput b)
void G3D::Sphere::getBounds ( class AABox out) const
static const Sphere& G3D::Sphere::inf ( )
static

Returns the infinite sphere.

bool G3D::Sphere::intersects ( const Sphere other) const
void G3D::Sphere::merge ( const Sphere s)

Sets this to the smallest sphere that encapsulates both.

bool G3D::Sphere::operator!= ( const Sphere other) const
inline
Sphere G3D::Sphere::operator+ ( const Vector3 v) const
inline

Translates the sphere.

Sphere G3D::Sphere::operator- ( const Vector3 v) const
inline

Translates the sphere.

bool G3D::Sphere::operator== ( const Sphere other) const
inline
Point3 G3D::Sphere::randomInteriorPoint ( ) const

Uniformly distributed on the interior (includes surface)

Referenced by G3D::SphereShape::randomInteriorPoint().

Point3 G3D::Sphere::randomSurfacePoint ( ) const

Uniformly distributed on the surface.

Referenced by G3D::SphereShape::getRandomSurfacePoint().

void G3D::Sphere::serialize ( class BinaryOutput b) const
Any G3D::Sphere::toAny ( ) const
virtual std::string G3D::Sphere::toString ( ) const
virtual
float G3D::Sphere::volume ( ) const

Member Data Documentation

Point3 G3D::Sphere::center
float G3D::Sphere::radius

documentation generated on Sat Jan 12 2013 22:49:57 using doxygen 1.8.2