CollisionCollide problem

sengoku

28-09-2006 16:38:06

Hi,
I was previously using Newton 1.52 and an older version of OgreNewt (not sure what revision, but it used the fastDelegate callbacks).
I'm using a cone to detect when you're interacting with triggers, so when you push the action button, it checks for intersections with the cone and acts accordingly. This process uses OgreNewt::CollisionCollide to check for the intersections, and has worked flawlessly for a long time.

I've just updated to the latest OgreNewt and 1.53 Newton, and now I'm getting weird results from CollisionCollide(). All works fine, until the cone intersects with the target more than about halfway; this makes CollisionCollide return zero collisions.

Here is my code, its fairly simple (it just iterates through a saved list of bodies, checking each one against the 'cone' detector body):

Caction *Cplayer::getActionInteraction() {

Vector3 retContact;
Vector3 retNormal;
Real retPenetration;

Vector3 colPosition;
Quaternion colOrientation;

Vector3 actionPosition;
Quaternion actionOrientation;

std::vector<CphysicsInteract *> *triggers = Cscene::getInteracts();
std::vector<CphysicsInteract *>::iterator iterator = triggers->begin();

m_actionBody->getPositionOrientation(actionPosition, actionOrientation);

for(; iterator != triggers->end(); iterator++) {

CphysicsInteract *collision = *iterator;
collision->getBody()->getPositionOrientation(colPosition, colOrientation);

int ret =
OgreNewt::CollisionTools::CollisionCollide(Cscene::getPhysicsWorld(),
1,
m_actionBody->getCollision(),
actionOrientation,
actionPosition,
collision->getCollision(),
colOrientation,
colPosition,
&retContact,
&retNormal,
&retPenetration);

if(ret) {
return (Caction *) collision->getBody()->getUserData();
}

}

return NULL;

}



I've verified that the erroneous behaviour comes from the Newton 1.52 -> 1.53 update (I also can't test with older version of OgreNewt, because its incompatible with 1.53 - but diff tells me that OgreNewt hasn't changed much anyhow).

I can verify that the data being passed to the function is correct with debug lines:

This is always detected correctly (just intersecting)


Since the update, this case no longer works (after the cone has gone about halfway through)


Any ideas?

walaber

28-09-2006 17:57:05

would you mind posting this on the Newton forum? it's most certainly something that has changed in Newton, because my implementation of the functions you are using hasn't changed.