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.

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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

Inicie sesión para dejar un comentario.