VirtualPhysics the realtime dynamics simulation library

vpCapsule Class Reference

Capsule primitive geometry. More...

#include <vpGeom.h>

Inheritance diagram for vpCapsule:

vpGeom

List of all members.

Public Member Functions

 vpCapsule ()
 vpCapsule (scalar radius, scalar height)
void SetSize (scalar r, scalar h)
scalar GetRadius (void) const
scalar GetHeight (void) const
virtual void GetShape (char *type, scalar *data) const
virtual Inertia GetInertia (scalar) const
virtual scalar GetBoundingSphereRadius (void) const
virtual Vec3 GetAABB (void) const


Detailed Description

vpCapsule is a class to model a cyliner capped with hemispheres.
capsule.gif
Examples:

pendulum.cpp.


Constructor & Destructor Documentation

vpCapsule::vpCapsule (  ) 

default radius and height of the capsule is SCALAR_1_2 and 1.5, respectively.

vpCapsule::vpCapsule ( scalar  radius,
scalar  height 
)

construct a box of the given size.


Member Function Documentation

VP_INLINE void vpCapsule::SetSize ( scalar  r,
scalar  h 
)

set a size of the capsule.

Parameters:
r radius of the capsule
h height of the capsule

VP_INLINE scalar vpCapsule::GetRadius ( void   )  const

get a radius of the capsule.

VP_INLINE scalar vpCapsule::GetHeight ( void   )  const

get a height of the capsule.

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

get a shape information. return type = 'C', data[0] = radius, data[1] = height

Implements vpGeom.

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

get an inertia of the geometry.

Implements vpGeom.

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

get a radius of a bounding sphere.

Implements vpGeom.

VP_INLINE Vec3 vpCapsule::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