#include <ContactGeometry.h>
It is used with GeneralContactSubsystem for doing collision detection and contact modeling.
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. | |
bool | isOwnerHandle () const |
bool | isEmptyHandle () const |
ContactGeometry & | operator= (const ContactGeometry &src) |
bool | hasImpl () const |
const ContactGeometryImpl & | getImpl () const |
ContactGeometryImpl & | updImpl () |
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 | |
ContactGeometryImpl * | impl |
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 |
ContactGeometry | ( | ) | [inline] |
ContactGeometry | ( | const ContactGeometry & | src | ) |
ContactGeometry | ( | ContactGeometryImpl * | impl | ) | [explicit] |
virtual ~ContactGeometry | ( | ) | [virtual] |
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.
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 |
Reimplemented in ContactGeometry::TriangleMesh.
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.
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. |
Reimplemented in ContactGeometry::TriangleMesh.
bool isOwnerHandle | ( | ) | const |
bool isEmptyHandle | ( | ) | const |
ContactGeometry& operator= | ( | const ContactGeometry & | src | ) |
bool hasImpl | ( | ) | const [inline] |
const ContactGeometryImpl& getImpl | ( | ) | const [inline] |
Reimplemented in ContactGeometry::Sphere, and ContactGeometry::TriangleMesh.
ContactGeometryImpl& updImpl | ( | ) | [inline] |
Reimplemented in ContactGeometry::Sphere, and ContactGeometry::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().
ContactGeometryImpl* impl [protected] |