voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | Protected Attributes | List of all members
blub::sphere Class Reference

Public Member Functions

 sphere ()
 
 sphere (const vector3 &center, real radius)
 
real getRadius (void) const
 
void setRadius (real radius)
 
const vector3getCenter (void) const
 
void setCenter (const vector3 &center)
 
bool intersects (const sphere &s) const
 
bool intersects (const axisAlignedBox &box) const
 
bool intersects (const vector3 &v) const
 
void merge (const sphere &oth)
 
bool contains (const vector3 &vec) const
 
real getSquaredRadius () const
 
bool inherts (axisAlignedBox aabb) const
 

Protected Attributes

real mRadius
 
vector3 mCenter
 

Detailed Description

Examples:
customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.

Constructor & Destructor Documentation

blub::sphere::sphere ( )
inline

Standard constructor - creates a unit sphere around the origin.

blub::sphere::sphere ( const vector3 center,
real  radius 
)
inline

Constructor allowing arbitrary spheres.

Parameters
centerThe center point of the sphere.
radiusThe radius of the sphere.

Member Function Documentation

const vector3& blub::sphere::getCenter ( void  ) const
inline

Returns the center point of the sphere.

real blub::sphere::getRadius ( void  ) const
inline

Returns the radius of the sphere.

bool sphere::intersects ( const sphere s) const

Returns whether or not this sphere intersects another sphere.

bool sphere::intersects ( const axisAlignedBox box) const

Returns whether or not this sphere intersects a box.

bool blub::sphere::intersects ( const vector3 v) const
inline

Returns whether or not this sphere intersects a point.

void sphere::merge ( const sphere oth)

Merges another sphere into the current sphere

void blub::sphere::setCenter ( const vector3 center)
inline

Sets the center point of the sphere.

void blub::sphere::setRadius ( real  radius)
inline

Sets the radius of the sphere.


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