disabling a characters collision with dynamic objects.

jchmack

15-11-2007 01:00:18

I need to have body which will be reported by an intersection but will not interfere with a NxOgre::Character. So far i create the body and have these flags set.


CollisionBody->raiseActorFlag(NX_AF_DISABLE_RESPONSE);
CollisionBody->raiseBodyFlag(NX_BF_FROZEN);
CollisionBody->clearBodyFlag(NX_BF_KINEMATIC);
CollisionBody->putToSleep();


if i have these flags set i get the intersection to report my body
but it seems that my character cant move through the body. Shouldn't NX_AF_DISABLE_RESPONSE make it where my character can go though but the body will still be reported by intersections / raycasts?


CollisionBody->raiseActorFlag(NX_AF_DISABLE_COLLISION);
CollisionBody->raiseBodyFlag(NX_BF_KINEMATIC);
CollisionBody->putToSleep();


with this set of flags my character can move through the body but my intersection doesn't hit. Im guessing that NX_AF_DISABLE_COLLISION removes the body from being checked by the intersection.

Thx for any help in advance =)

jchmack

15-11-2007 01:22:31

after searching for a while i found this post:

http://www.ogre3d.org/phpBB2addons/view ... +collision

I have been playing around with mGroupMask and mActiveGroupsMask in CharacterParams but i still can't get the desired effect.

Over all i have 2 questions:
1)I understand that you got actor/shape groups up but is there a way to add a Character to a group and disable collisions with it?

2) Why does the raycaster hit even if NX_AF_DISABLE_COLLISION is raised but not the intersection? Is there a way i can get my intersection to hit a body who's collision is disabled?

jchmack

15-11-2007 14:27:02

ok i made the groups manually but in my opinion this is a pretty bad hack


//when i make a character
NxShape* const* s = mCharacter->getNxController()->getActor()->getShapes();
(*s)->setGroup(5);

//when i make my body
NxShape* const* s = CollisionBody->getNxActor()->getShapes();
(*s)->setGroup(6);

//at startup
mScene->getNxScene()->setGroupCollisionFlag(5,6, false);


it would be very nice to be able to add characters to shape groups as well. or have intersections detect bodies with this state:


CollisionBody->raiseActorFlag(NX_AF_DISABLE_COLLISION);
CollisionBody->raiseBodyFlag(NX_BF_KINEMATIC);
CollisionBody->putToSleep();


also this seems to crash in debug mode... but for now i am happy =).

If anyone has any better recommendation PLEASE post.