ContactGeometry Class Reference

A ContactGeometry object describes the physical shape of a body. More...

#include <ContactGeometry.h>

Inheritance diagram for ContactGeometry:
HalfSpace Sphere TriangleMesh

List of all members.

Classes

class  HalfSpace
 This ContactGeometry subclass represents an object that occupies the entire half-space x>0. More...
class  HalfSpaceImpl
class  Sphere
 This ContactGeometry subclass represents a sphere centered at the origin. More...
class  SphereImpl
class  TriangleMesh
 This ContactGeometry subclass represents an arbitrary shape described by a mesh of triangular faces. More...
class  TriangleMeshImpl

Public Member Functions

 ContactGeometry ()
 ContactGeometry (const ContactGeometry &src)
 ContactGeometry (ContactGeometryImpl *impl)
virtual ~ContactGeometry ()
Vec3 findNearestPoint (const Vec3 &position, bool &inside, UnitVec3 &normal) const
 Given a point, find the nearest point on the surface of this object.
bool intersectsRay (const Vec3 &origin, const UnitVec3 &direction, Real &distance, UnitVec3 &normal) const
 Determine whether this object intersects a ray, and if so, find the intersection point.
void getBoundingSphere (Vec3 &center, Real &radius) const
 Get a bounding sphere which completely encloses this object.
bool isOwnerHandle () const
bool isEmptyHandle () const
ContactGeometryoperator= (const ContactGeometry &src)
bool hasImpl () const
const ContactGeometryImplgetImpl () const
ContactGeometryImplupdImpl ()
const std::string & getType () const
 Get a string which uniquely identifies the type of geometry this object represents.
int getTypeIndex () const
 Get an integer which uniquely identifies the type of geometry this object represents.

Protected Attributes

ContactGeometryImplimpl

Detailed Description

A ContactGeometry object describes the physical shape of a body.

It is used with GeneralContactSubsystem for doing collision detection and contact modeling.


Constructor & Destructor Documentation

ContactGeometry (  )  [inline]
ContactGeometry ( const ContactGeometry src  ) 
ContactGeometry ( ContactGeometryImpl impl  )  [explicit]
virtual ~ContactGeometry (  )  [virtual]

Member Function Documentation

Vec3 findNearestPoint ( const Vec3 position,
bool &  inside,
UnitVec3 normal 
) const

Given a point, find the nearest point on the surface of this object.

If multiple points on the surface are equally close to the specified point, this may return any of them.

Parameters:
position the point in question
inside on exit, this is set to true if the specified point is inside this object, false otherwise
normal on exit, this contains the surface normal at the returned point
Returns:
the point on the surface of the object which is closest to the specified point

Reimplemented in TriangleMesh.

void getBoundingSphere ( Vec3 center,
Real &  radius 
) const

Get a bounding sphere which completely encloses this object.

Parameters:
center on exit, this contains the location of the center of the bounding sphere
radius on exit, this contains the radius of the bounding sphere
const ContactGeometryImpl& getImpl (  )  const [inline]

Reimplemented in Sphere, and TriangleMesh.

const std::string& getType (  )  const

Get a string which uniquely identifies the type of geometry this object represents.

Typically each subclass of ContactGeometry defines its own value.

int getTypeIndex (  )  const

Get an integer which uniquely identifies the type of geometry this object represents.

A unique index is generated automatically for each unique type value as returned by getType().

bool hasImpl (  )  const [inline]
bool intersectsRay ( const Vec3 origin,
const UnitVec3 direction,
Real &  distance,
UnitVec3 normal 
) const

Determine whether this object intersects a ray, and if so, find the intersection point.

Parameters:
origin the position at which the ray begins
direction the ray direction
distance if an intersection is found, the distance from the ray origin to the intersection point is stored in this. Otherwise, it is left unchanged.
normal if an intersection is found, the surface normal of the intersection point is stored in this. Otherwise, it is left unchanged.
Returns:
true if an intersection is found, false otherwise

Reimplemented in TriangleMesh.

bool isEmptyHandle (  )  const
bool isOwnerHandle (  )  const
ContactGeometry& operator= ( const ContactGeometry src  ) 
ContactGeometryImpl& updImpl (  )  [inline]

Reimplemented in Sphere, and TriangleMesh.


Member Data Documentation

ContactGeometryImpl* impl [protected]

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

Generated on Wed Dec 30 11:05:14 2009 for SimTKcore by  doxygen 1.6.1