koirat
30-07-2010 10:37:58
Can you tell me if it's possible to discard contact during UserProcess part of custom contact callback. I know that i can do it while processing AABB, But I have to do it after checking for polygon based collision. Basiacaly what i try to achieve is a no collision for physics but i need to know if collision was possible. I use it for region (onEnter onExit) trigger.
SFCBias
31-07-2010 04:39:51
Well why would you want to wait until after they've collided to discard it?
koirat
31-07-2010 10:55:39
Since than I can have
mesh based collision not AABB + all the data associated with collision like contact points.
Also I do not want to wait until they collide if you know better way please tell me. How can I get ContactJoint on two bodies.
kallaspriit
31-07-2010 14:38:37
You can just delete the contacts. Something like this might work:
void MaterialCallback::contactsProcess(OgreNewt::ContactJoint &contactJoint, Ogre::Real timeStep, int threadIndex)
{
NewtonWorldCriticalSectionLock(world);
{
OgreNewt::Contact contact = contactJoint.getFirstContact();
while(contact)
{
OgreNewt::Contact nextContact = contact.getNext();
contact.remove();
contact = nextContact;
}
}
NewtonWorldCriticalSectionUnlock(world));
}
Not tested but you get the idea
koirat
31-07-2010 23:50:43
Interesting.
I will check this out.