76collide(
const OdeGeom &geom1,
const OdeGeom &geom2,
const short int max_contacts) {
77 dContactGeom *contact_list = (dContactGeom *)PANDA_MALLOC_ARRAY(max_contacts *
sizeof(dContactGeom));
78 int num_contacts = dCollide(geom1.
get_id(), geom2.
get_id(), max_contacts, contact_list,
sizeof(dContactGeom));
80 entry->_geom1 = geom1.
get_id();
81 entry->_geom2 = geom2.
get_id();
82 entry->_body1 = dGeomGetBody(geom1.
get_id());
83 entry->_body2 = dGeomGetBody(geom2.
get_id());
84 entry->_num_contacts = num_contacts;
86 for (
int i = 0; i < num_contacts; i++) {
87 entry->_contact_geoms[i] = contact_list[i];
90 PANDA_FREE_ARRAY(contact_list);
dBodyID get_id() const
Returns the underlying dBodyID.
A class used to hold information about a collision that has occurred.
static int are_connected(const OdeBody &body1, const OdeBody &body2)
Returns 1 if the given bodies are connected by a joint, returns 0 otherwise.
static int are_connected_excluding(const OdeBody &body1, const OdeBody &body2, const int joint_type)
Returns 1 if the given bodies are connected by a joint that does not match the given joint_type,...