collsion between hkpCharacterRigidBody and hkpCharacterRigidBody

collsion between hkpCharacterRigidBody and hkpCharacterRigidBody

Hi...I created twohkpCharacterRigidBody.hkpCharacterRigidBody have same mass, maxForce value.two hkpCharacterRigidBody is moved by keyboard inpuputWhen hkpCharacterRigidBody move, OtherhkpCharacterRigidBody is pushed byhkpCharacterRigidBody.I would like to don't move otherhkpCharacterRigidBody byhkpCharacterRigidBody.

2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I think you could do that like below:
#define LAYER_CHARACTER_1 1 // first character's layer
#define LAYER_CHARACTER_2 2 // second character's layer

// setup filter
hkpGroupFilter*filter=newhkpGroupFilter();

hkpGroupFilterSetup::setupGroupFilter(filter);
filter->disableCollisionsBetween(LAYER_CHARACTER_1, LAYER_CHARACTER_2);
// disable collision between the first and second character
m_physicWorld->setCollisionFilter(filter);

filter->removeReference();

// first character
{
hkpCharacterRigidBodyCinfoinfo;
info.m_collisionFilterInfo=hkpGroupFilter::calcFilterInfo(LAYER_CHARACTER_1, 0);
// other code
}
// second character
{
hkpCharacterRigidBodyCinfoinfo;
info.m_collisionFilterInfo=hkpGroupFilter::calcFilterInfo(LAYER_CHARACTER_2, 0);
// other code
}
You can get more information about the filter in Havok_Physics_Animation_2011-2-0_Pc_Xs_User_Guide.pdf Section 2.3

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen