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

nvmath::Sphere3f Class Reference

Sphere class. More...

#include <Sphere3f.h>

Inheritance diagram for nvmath::Sphere3f:

Inheritance graph
[legend]
Collaboration diagram for nvmath::Sphere3f:

Collaboration graph
[legend]
List of all members.

Public Member Functions

NVSG_API Sphere3f (void)
 Default constructor.
NVSG_API Sphere3f (const Vec3f &center, float radius)
 Constructor by center and radius.
NVSG_API Sphere3foperator= (const Sphere3f &sphere)
 Assignment operator.
NVSG_API bool operator== (const Sphere3f &sphere) const
 Equality operator.
NVSG_API bool operator!= (const Sphere3f &sphere) const
 Inequality operator.
NVSG_API float operator() (const Vec3f &p) const
 Calling operator.
NVSG_API const Vec3fgetCenter (void) const
 Get the center of the sphere.
NVSG_API void setCenter (const Vec3f &center)
 Set the center of the sphere.
NVSG_API float getRadius (void) const
 Get the radius of the sphere.
NVSG_API void setRadius (float radius)
 Set the radius of the sphere.

Related Functions

(Note that these are not member functions.)

Sphere3f boundingSphere (const Vec3f *points, size_t numberOfPoints)
Sphere3f boundingSphere (const Sphere3f &s, const Vec3f &p)
Sphere3f boundingSphere (const Sphere3f &s0, const Sphere3f &s1)

Detailed Description

Sphere class.


Constructor & Destructor Documentation

nvmath::Sphere3f::Sphere3f void   )  [inline]
 

Default constructor.

For performance reasons no initialization is performed.

nvmath::Sphere3f::Sphere3f const Vec3f center,
float  radius
[inline]
 

Constructor by center and radius.

Parameters:
center  center
radius  radius


Member Function Documentation

Sphere3f & nvmath::Sphere3f::operator= const Sphere3f sphere  )  [inline]
 

Assignment operator.

Returns:
reference to the assigned plane
Parameters:
sphere  sphere to assign

bool nvmath::Sphere3f::operator== const Sphere3f sphere  )  const [inline]
 

Equality operator.

Returns:
true if the sphere is equal to pl, otherwise false
Parameters:
sphere  sphere to compare with

bool nvmath::Sphere3f::operator!= const Sphere3f sphere  )  const [inline]
 

Inequality operator.

Returns:
true if the sphere is not equal to pl, otherwise false
Parameters:
sphere  sphere to compare with

float nvmath::Sphere3f::operator() const Vec3f p  )  const [inline]
 

Calling operator.

Calculates the distance of a point to the sphere. When the point is inside the sphere, the distance is negative; when the point is outside, the distance is positive.

Returns:
the signed distance of p to the sphere.
Parameters:
p  point to determine distance from sphere

const Vec3f & nvmath::Sphere3f::getCenter void   )  const [inline]
 

Get the center of the sphere.

Returns:
the center of the sphere.

Reimplemented in nvmath::BoundingSphere.

void nvmath::Sphere3f::setCenter const Vec3f center  )  [inline]
 

Set the center of the sphere.

Parameters:
center  point to set as center

float nvmath::Sphere3f::getRadius void   )  const [inline]
 

Get the radius of the sphere.

Returns:
the radius of the sphere.

Reimplemented in nvmath::BoundingSphere.

void nvmath::Sphere3f::setRadius float  radius  )  [inline]
 

Set the radius of the sphere.

Parameters:
radius  radius to set


Friends And Related Function Documentation

Sphere3f boundingSphere const Vec3f points,
size_t  numberOfPoints
[related]
 

Determine the bounding sphere a number of points

Note:
The determined sphere is not neccessarily the smallest.
Returns:
A reasonable small sphere around the given points
Parameters:
points  points to to include
numberOfPoints  number of points

Sphere3f boundingSphere const Sphere3f s,
const Vec3f p
[related]
 

Determine the bounding sphere around a sphere s and a point p.

Returns:
The bounding sphere around s and p.
Parameters:
s  sphere to include
p  point to include

Sphere3f boundingSphere const Sphere3f s0,
const Sphere3f s1
[related]
 

Determine the bounding sphere around two given spheres.

Returns:
the smallest sphere that includes both given spheres s0 and s1.
Parameters:
s0  first sphere to include
s1  second sphere to include


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:40 2005 for NVSGSDK by NVIDIA