nishnu
15-09-2009 22:05:11
Hi all, this is my first post
I have a problem with:
PhysXCallback::onContactNotify, it's from the latest NxOgre version from git repo.
I'll paste the code:
the problem is that when I create an actor directly in PhysX (to be specific I try to use a character controller) and set userData to null I get a null pointer exception in the line that tries to call getContactCallback(). When you look at it - this method does not deal with the case when one of rigidBody's userData is null.
Is it ok to create actors bypassing NxOgre ?
Or am I missing something else ?
Or did I find a bug ?
Sory for my english
I have a problem with:
PhysXCallback::onContactNotify, it's from the latest NxOgre version from git repo.
I'll paste the code:
void PhysXCallback::onContactNotify(NxContactPair &pair, NxU32 events)
{
if (pair.isDeletedActor[0] || pair.isDeletedActor[1])
return;
if (!pair.actors[0]->userData && !pair.actors[1]->userData)
return;
RigidBody* rbody_a = pointer_representive_cast<RigidBody>(pair.actors[0]->userData);
RigidBody* rbody_b = pointer_representive_cast<RigidBody>(pair.actors[1]->userData);
ContactPair contact_pair;
contact_pair.mFirst = rbody_a;
contact_pair.mSecond = rbody_b;
contact_pair.mSumFrictionForce = pair.sumFrictionForce;
contact_pair.mSumNormalForce = pair.sumNormalForce;
if (rbody_a->getContactCallback() != 0)
rbody_a->getContactCallback()->onContact(contact_pair);
if (rbody_b->getContactCallback() != 0)
rbody_b->getContactCallback()->onContact(contact_pair);
}
the problem is that when I create an actor directly in PhysX (to be specific I try to use a character controller) and set userData to null I get a null pointer exception in the line that tries to call getContactCallback(). When you look at it - this method does not deal with the case when one of rigidBody's userData is null.
Is it ok to create actors bypassing NxOgre ?
Or am I missing something else ?
Or did I find a bug ?
Sory for my english