Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::BSphere Struct Reference

Bounding sphere data structure in three dimensions. More...

#include <mitsuba/core/bsphere.h>

Public Member Functions

 BSphere ()
 Construct a bounding sphere at the origin having radius zero. More...
 
 BSphere (Stream *stream)
 Unserialize a bounding sphere from a binary data stream. More...
 
 BSphere (const Point &center, Float radius)
 Create a bounding sphere from a given center point and radius. More...
 
 BSphere (const BSphere &boundingSphere)
 Copy constructor. More...
 
bool isEmpty () const
 Return whether this bounding sphere has a radius of zero or less. More...
 
void expandBy (const Point p)
 Expand the bounding sphere radius to contain another point. More...
 
bool contains (const Point p) const
 Check whether the specified point is inside or on the sphere. More...
 
bool operator== (const BSphere &boundingSphere) const
 Equality test. More...
 
bool operator!= (const BSphere &boundingSphere) const
 Inequality test. More...
 
bool rayIntersect (const Ray &ray, Float &nearHit, Float &farHit) const
 Calculate the intersection points with the given ray. More...
 
void serialize (Stream *stream) const
 Serialize this bounding sphere to a binary data stream. More...
 
std::string toString () const
 Return a string representation of the bounding sphere. More...
 

Public Attributes

Point center
 
Float radius
 

Detailed Description

Bounding sphere data structure in three dimensions.

Constructor & Destructor Documentation

mitsuba::BSphere::BSphere ( )
inline

Construct a bounding sphere at the origin having radius zero.

mitsuba::BSphere::BSphere ( Stream stream)
inline

Unserialize a bounding sphere from a binary data stream.

mitsuba::BSphere::BSphere ( const Point center,
Float  radius 
)
inline

Create a bounding sphere from a given center point and radius.

mitsuba::BSphere::BSphere ( const BSphere boundingSphere)
inline

Copy constructor.

Member Function Documentation

bool mitsuba::BSphere::contains ( const Point  p) const
inline

Check whether the specified point is inside or on the sphere.

void mitsuba::BSphere::expandBy ( const Point  p)
inline

Expand the bounding sphere radius to contain another point.

bool mitsuba::BSphere::isEmpty ( ) const
inline

Return whether this bounding sphere has a radius of zero or less.

bool mitsuba::BSphere::operator!= ( const BSphere boundingSphere) const
inline

Inequality test.

bool mitsuba::BSphere::operator== ( const BSphere boundingSphere) const
inline

Equality test.

bool mitsuba::BSphere::rayIntersect ( const Ray ray,
Float nearHit,
Float farHit 
) const
inline

Calculate the intersection points with the given ray.

Returns
true if the ray intersects the bounding sphere
Remarks
In the Python bindings, this function returns the nearT and farT values as a tuple (or None, when no intersection was found)
void mitsuba::BSphere::serialize ( Stream stream) const
inline

Serialize this bounding sphere to a binary data stream.

std::string mitsuba::BSphere::toString ( ) const
inline

Return a string representation of the bounding sphere.

Member Data Documentation

Point mitsuba::BSphere::center
Float mitsuba::BSphere::radius

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