VirtualPhysics the realtime dynamics simulation library

vpSphere Class Reference

Sphere primitive geometry. More...

#include <vpGeom.h>

Inheritance diagram for vpSphere:

vpGeom

List of all members.

Public Member Functions

 vpSphere ()
 vpSphere (scalar radius)
void SetRadius (scalar radius)
scalar GetRadius (void) const
virtual void GetShape (char *type, scalar *data) const
virtual Inertia GetInertia (scalar density) const
virtual scalar GetBoundingSphereRadius (void) const
virtual Vec3 GetAABB (void) const


Detailed Description

vpSphere is a class to model a sphere.
sphere.gif
Examples:

pendulum.cpp.


Constructor & Destructor Documentation

vpSphere::vpSphere (  ) 

default radius of the sphere is SCALAR_1_2.

vpSphere::vpSphere ( scalar  radius  ) 

construct a sphere of the given radius.


Member Function Documentation

VP_INLINE void vpSphere::SetRadius ( scalar  radius  ) 

set a radius of the sphere.

VP_INLINE scalar vpSphere::GetRadius ( void   )  const

get a radius of the sphere.

VP_INLINE void vpSphere::GetShape ( char *  type,
scalar *  data 
) const [virtual]

get a shape information. return type = 'S', data[0] = radius

Implements vpGeom.

virtual Inertia vpSphere::GetInertia ( scalar   )  const [virtual]

get an inertia of the geometry.

Implements vpGeom.

VP_INLINE scalar vpSphere::GetBoundingSphereRadius ( void   )  const [virtual]

get a radius of a bounding sphere.

Implements vpGeom.

VP_INLINE Vec3 vpSphere::GetAABB ( void   )  const [virtual]

get an axis aligned bounding box which size is (-re[0], re[0]) X (-re[1], re[1]) X (-re[2], re[2]).

Implements vpGeom.


Generated on Wed Jun 11 23:11:49 2008 for VirtualPhysics by  doxygen 1.5.5