#include "contactSetting.h"
#include "collisionStructures.h"
#include "contact.h"
#include "matvec3D.h"
#include "world.h"
#include "body.h"
#include "mytools.h"
#include "FitParabola.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
void | addContacts (Body *body1, Body *body2, ContactReport &contactSet, bool softContactsOn) |
Adds a new pair of contacts between two bodies. | |
void | addVirtualContacts (Body *body1, int f, int l, Body *body2, ContactReport &contactSet, bool softContactsOn) |
Adds a virtual contact on a body pointing at another body. | |
bool | checkContactNormals (Body *b1, Body *b2, ContactData *c) |
double | contactDistance (Body *body1, Body *body2, ContactData &cp) |
void | findSoftNeighborhoods (Body *body1, Body *body2, ContactReport &contactSet) |
void | mergeNeighborhoods (Neighborhood &n1, Neighborhood &n2) |
void | mergeSoftNeighborhoods (Body *body1, Body *body2, ContactReport &contactSet) |
bool | neighborhoodsOverlap (const Neighborhood &n1, const Neighborhood &n2) |
void addContacts | ( | Body * | body1, | |
Body * | body2, | |||
ContactReport & | contactSet, | |||
bool | softContactsOn | |||
) |
Adds a new pair of contacts between two bodies.
Takes pointers to the two bodies in contact, and the set of contacts returned from the collision detection system, and adds a contact to each body for each contact in the set.
Definition at line 189 of file contactSetting.cpp.
void addVirtualContacts | ( | Body * | body1, | |
int | f, | |||
int | l, | |||
Body * | body2, | |||
ContactReport & | contactSet, | |||
bool | softContactsOn | |||
) |
Adds a virtual contact on a body pointing at another body.
Adds a virtual contact on the body body1, which is assumed to be the l-th link on the f-th finger of a robot. Works by first creating a traditional contact, then converting it to a virtual contact.
The whole VirtualContact scheme is in bad need of an overhaul.
Definition at line 268 of file contactSetting.cpp.
bool checkContactNormals | ( | Body * | b1, | |
Body * | b2, | |||
ContactData * | c | |||
) |
Definition at line 51 of file contactSetting.cpp.
double contactDistance | ( | Body * | body1, | |
Body * | body2, | |||
ContactData & | cp | |||
) |
Definition at line 38 of file contactSetting.cpp.
void findSoftNeighborhoods | ( | Body * | body1, | |
Body * | body2, | |||
ContactReport & | contactSet | |||
) |
For elastic bodies, calculates the contact neighborhoods and puts them in the contact set. Not done for rigid contacts.
Definition at line 112 of file contactSetting.cpp.
void mergeNeighborhoods | ( | Neighborhood & | n1, | |
Neighborhood & | n2 | |||
) |
Definition at line 91 of file contactSetting.cpp.
void mergeSoftNeighborhoods | ( | Body * | body1, | |
Body * | body2, | |||
ContactReport & | contactSet | |||
) |
For elastic objects, if we have two contacts close to each other we assume they are actually part of the same contact. This function checks for overlapping neighborhoods and merges them.
Definition at line 143 of file contactSetting.cpp.
bool neighborhoodsOverlap | ( | const Neighborhood & | n1, | |
const Neighborhood & | n2 | |||
) |
Definition at line 80 of file contactSetting.cpp.