mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Negative collision ids create collision reporting data without attaching a collision joint. Useful for event collisions.
This commit is contained in:
parent
114dd9bee9
commit
a06907e583
@ -172,7 +172,9 @@ autoCallback(void *data, dGeomID o1, dGeomID o2)
|
|||||||
contact[i].surface.soft_cfm = collide_params.colparams.soft_cfm;
|
contact[i].surface.soft_cfm = collide_params.colparams.soft_cfm;
|
||||||
}
|
}
|
||||||
|
|
||||||
int numc = dCollide(o1, o2, OdeSpace::MAX_CONTACTS, &contact[0].geom, sizeof(dContact));
|
static int numc = 0;
|
||||||
|
numc = dCollide(o1, o2, OdeSpace::MAX_CONTACTS, &contact[0].geom, sizeof(dContact));
|
||||||
|
|
||||||
if (numc)
|
if (numc)
|
||||||
{
|
{
|
||||||
if (odespace_cat.is_debug() && (autoCallbackCounter%30 == 0)) {
|
if (odespace_cat.is_debug() && (autoCallbackCounter%30 == 0)) {
|
||||||
@ -185,7 +187,10 @@ autoCallback(void *data, dGeomID o1, dGeomID o2)
|
|||||||
for(i=0; i < numc; i++)
|
for(i=0; i < numc; i++)
|
||||||
{
|
{
|
||||||
dJointID c = dJointCreateContact(_collide_world->get_id(), _collide_joint_group, contact + i);
|
dJointID c = dJointCreateContact(_collide_world->get_id(), _collide_joint_group, contact + i);
|
||||||
dJointAttach(c, b1, b2);
|
if ((_collide_space->get_collide_id(o1) >= 0) && (_collide_space->get_collide_id(o2) >= 0))
|
||||||
|
{
|
||||||
|
dJointAttach(c, b1, b2);
|
||||||
|
}
|
||||||
// this creates contact position data for python. It is useful for debugging only 64 points are stored
|
// this creates contact position data for python. It is useful for debugging only 64 points are stored
|
||||||
if(contactCount < 64)
|
if(contactCount < 64)
|
||||||
{
|
{
|
||||||
@ -199,6 +204,7 @@ autoCallback(void *data, dGeomID o1, dGeomID o2)
|
|||||||
}
|
}
|
||||||
_collide_world->set_dampen_on_bodies(b1, b2, collide_params.dampen);
|
_collide_world->set_dampen_on_bodies(b1, b2, collide_params.dampen);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OdeSimpleSpace OdeSpace::
|
OdeSimpleSpace OdeSpace::
|
||||||
|
Loading…
x
Reference in New Issue
Block a user