collsion between hkpCharacterRigidBody and hkpCharacterRigidBody

collsion between hkpCharacterRigidBody and hkpCharacterRigidBody

hisimpson's picture

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

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
rikpan's picture

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

Login to leave a comment.