Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

sheep::BS Class Reference

#include <bs.h>

List of all members.

Public Member Functions

 BS ()
 BS (const BS &bs)
 BS (const Point3 &center)
 BS (const Point3 &center, Real radius)
void Invalidate ()
void ComputeSquareRadius ()
void Include (const Point3 &point)
void Include (const AABB3 &aabb)
void Include (const BS &bs)
bool Overlaps (const BS &bs) const
bool Contains (const Point3 &point) const

Public Attributes

Point3 m_center
 Center of the bounding sphere.

Real m_radius
 Radius of the bounding sphere.

Real m_radius2
 Square of the radius of the bounding sphere.


Constructor & Destructor Documentation

sheep::BS::BS  )  [inline]
 

Invalidates the bounding sphere. Warning: the bounding sphere center is left undefined.

Definition at line 111 of file bs.h.

sheep::BS::BS const BS bs  )  [inline]
 

Warning: this constructor *does not* copy the value of the m_radius2 member, which is thus left undefined until the ComputeSquareRadius() method is called.

Definition at line 116 of file bs.h.

sheep::BS::BS const Point3 center  )  [inline]
 

Constructs a bounding sphere given its center. The new bounding sphere is invalidated (see the Invalidate() method for more details). The value of the m_radius2 member is left undefined until the ComputeSquareRadius() method is called.

Definition at line 123 of file bs.h.

sheep::BS::BS const Point3 center,
Real  radius
[inline]
 

Constructs a bounding sphere given its center and its radius. The value of the m_radius2 member is left undefined until the ComputeSquareRadius() method is called.

Definition at line 130 of file bs.h.


Member Function Documentation

void sheep::BS::ComputeSquareRadius  )  [inline]
 

Computes the square radius of the bounding sphere and stores it in the m_radius2 member. This is the only one method that does access the m_radius2 member.

Definition at line 140 of file bs.h.

Referenced by toxic::Sphere::Sphere().

bool sheep::BS::Contains const Point3 point  )  const [inline]
 

Definition at line 178 of file bs.h.

void sheep::BS::Include const BS bs  )  [inline]
 

Definition at line 165 of file bs.h.

void sheep::BS::Include const AABB3 aabb  )  [inline]
 

Definition at line 153 of file bs.h.

void sheep::BS::Include const Point3 point  )  [inline]
 

None of the next methods changes the value or use the value of the m_radius2 member.

Definition at line 145 of file bs.h.

Referenced by toxic::Sphere::Sphere().

void sheep::BS::Invalidate  )  [inline]
 

Invalidates the bounding sphere (sets the bounding sphere radius to -1.0). The value of the m_radius2 member is left unchanged.

Definition at line 135 of file bs.h.

bool sheep::BS::Overlaps const BS bs  )  const [inline]
 

Definition at line 173 of file bs.h.


Member Data Documentation

Point3 sheep::BS::m_center
 

Center of the bounding sphere.

Definition at line 38 of file bs.h.

Referenced by toxic::Sphere::ComputeIrradiance().

Real sheep::BS::m_radius
 

Radius of the bounding sphere.

Definition at line 39 of file bs.h.

Real sheep::BS::m_radius2
 

Square of the radius of the bounding sphere.

The value of this member is not computed until the ComputeSquareRadius() method is explicitly called by the user. It is done that way to be both flexible and efficient: if the value is required, it can be computed by calling the ComputeSquareRadius() method. If the value is not required, this member will be left undefined until the ComputeSquareRadius() method is called.

Definition at line 47 of file bs.h.

Referenced by toxic::Sphere::ComputeIrradiance().


The documentation for this class was generated from the following file:
Generated on Tue May 11 01:31:54 2004 for toxic by doxygen 1.3.6