Support Forum       G3D Web Page     
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: More...
 
 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. More...
 
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. More...
 
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. More...
 
void deserialize (class BinaryInput &b)
 
void getBounds (class AABox &out) const
 
size_t hashCode () const
 
bool intersects (const Sphere &other) const
 
void merge (const Sphere &s)
 Sets this to the smallest sphere that encapsulates both. More...
 
bool operator!= (const Sphere &other) const
 
Sphere operator+ (const Vector3 &v) const
 Translates the sphere. More...
 
Sphere operator- (const Vector3 &v) const
 Translates the sphere. More...
 
bool operator== (const Sphere &other) const
 
Point3 randomInteriorPoint (Random &rnd=Random::common()) const
 
Uniformly distributed on the interior (includes surface) More...
 
Point3 randomSurfacePoint (Random &rnd=Random::common()) const
 
Uniformly distributed on the surface. More...
 
void serialize (class BinaryOutput &b) const
 
Any toAny () const
 
virtual String toString () const
 
float volume () const
 

Static Public Member Functions

static const Sphereinf ()
 Returns the infinite sphere. More...
 

Public Attributes

Point3 center
 
float radius
 

Detailed Description


Sphere.

Constructor & Destructor Documentation

◆ Sphere() [1/5]

G3D::Sphere::Sphere ( )
inline

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

◆ Sphere() [2/5]

G3D::Sphere::Sphere ( float  radius)
inlineexplicit

◆ Sphere() [3/5]

G3D::Sphere::Sphere ( class BinaryInput b)

◆ Sphere() [4/5]

G3D::Sphere::Sphere ( const class Any a)
explicit

Format is one of:

  • Sphere(point, radius)
  • Sphere(radius)

◆ Sphere() [5/5]

G3D::Sphere::Sphere ( const Point3 center,
float  radius 
)
inline

◆ ~Sphere()

virtual G3D::Sphere::~Sphere ( )
inlinevirtual

Member Function Documentation

◆ area()

float G3D::Sphere::area ( ) const

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

◆ contains() [1/2]

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().

◆ contains() [2/2]

bool G3D::Sphere::contains ( const Sphere other) const

◆ culledBy() [1/4]

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

◆ culledBy() [2/4]

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

◆ culledBy() [3/4]

bool G3D::Sphere::culledBy ( const Array< Plane > &  plane,
int32 cullingPlaneIndex,
const uint32  testMask,
uint32 childMask 
) const

See AABox::culledBy.

◆ culledBy() [4/4]

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.

◆ deserialize()

void G3D::Sphere::deserialize ( class BinaryInput b)

◆ getBounds()

void G3D::Sphere::getBounds ( class AABox out) const

◆ hashCode()

size_t G3D::Sphere::hashCode ( ) const
inline

◆ inf()

static const Sphere& G3D::Sphere::inf ( )
static

Returns the infinite sphere.

◆ intersects()

bool G3D::Sphere::intersects ( const Sphere other) const

◆ merge()

void G3D::Sphere::merge ( const Sphere s)

Sets this to the smallest sphere that encapsulates both.

◆ operator!=()

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

◆ operator+()

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

Translates the sphere.

◆ operator-()

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

Translates the sphere.

◆ operator==()

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

◆ randomInteriorPoint()

Point3 G3D::Sphere::randomInteriorPoint ( Random rnd = Random::common()) const


Uniformly distributed on the interior (includes surface)

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

◆ randomSurfacePoint()

Point3 G3D::Sphere::randomSurfacePoint ( Random rnd = Random::common()) const


Uniformly distributed on the surface.

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

◆ serialize()

void G3D::Sphere::serialize ( class BinaryOutput b) const

◆ toAny()

Any G3D::Sphere::toAny ( ) const

◆ toString()

virtual String G3D::Sphere::toString ( ) const
virtual

◆ volume()

float G3D::Sphere::volume ( ) const

Member Data Documentation

◆ center

Point3 G3D::Sphere::center

◆ radius

float G3D::Sphere::radius

documentation generated on Wed Nov 24 2021 08:02:00 using doxygen 1.8.15