#include <Contact.h>
It characterizes the contact by the center location and radius of the contact patch, the normal vector, and the penetration depth.
Public Member Functions | |
PointContact (int body1, int body2, Vec3 &location, Vec3 &normal, Real radius, Real depth) | |
Create a PointContact object. | |
Vec3 | getLocation () const |
The location where the two bodies touch, specified in the ground frame. | |
Vec3 | getNormal () const |
Get the surface normal at the contact location. | |
Real | getRadius () const |
Get the radius of the contact patch. | |
Real | getDepth () const |
Get the penetration depth. | |
Static Public Member Functions | |
static bool | isInstance (const Contact &contact) |
Determine whether a Contact object is a PointContact. |
PointContact | ( | int | body1, | |
int | body2, | |||
Vec3 & | location, | |||
Vec3 & | normal, | |||
Real | radius, | |||
Real | depth | |||
) |
Create a PointContact object.
body1 | the index of the first body involved in the contact, specified by its index within its contact set | |
body2 | the index of the second body involved in the contact, specified by its index within its contact set | |
location | the location where the two bodies touch, specified in the ground frame | |
normal | the surface normal at the contact location. This is specified in the ground frame, and points outward from body1 | |
radius | the radius of the contact patch | |
depth | the penetration depth |
Vec3 getLocation | ( | ) | const |
The location where the two bodies touch, specified in the ground frame.
More precisely, the contact region is represented as a circular patch centered at this point and perpendicular to the normal vector.
Vec3 getNormal | ( | ) | const |
Get the surface normal at the contact location.
This is specified in the ground frame, and points outward from the first body.
Real getRadius | ( | ) | const |
Get the radius of the contact patch.
Real getDepth | ( | ) | const |
Get the penetration depth.
This is defined as the minimum distance you would need to translate one body along the normal vector to make them no longer overlap.
static bool isInstance | ( | const Contact & | contact | ) | [static] |
Determine whether a Contact object is a PointContact.