Keyframed objects collision detection

Keyframed objects collision detection

Imagen de yinono

What are the needed steps to enable keyframed to keyframed collision reporting?

I set a world group filter using:
.
hkpGroupFilter* filter = new hkpGroupFilter();
hkpGroupFilterSetup::setupGroupFilter(filter);
filter->enableCollisionsBetween(hkpGroupFilterSetup::LAYER_KEYFRAME,
hkpGroupFilterSetup::LAYER_KEYFRAME );
m_world->setCollisionFilter( filter );
filter->removeReference();

and then set the layer information for to boxes using:

hkpRigidBodyCinfo boxInfo;
hkVector4 boxSize ( size[1],size[2], size[3] );
hkpBoxShape* boxShape = new hkpBoxShape(boxSize);
boxInfo.m_shape = boxShape;
boxInfo.m_motionType = hkpMotion::MOTION_KEYFRAMED;
boxInfo.m_qualityType = HK_COLLIDABLE_QUALITY_KEYFRAMED_REPORTING;
boxInfo.m_collisionFilterInfo = hkpGroupFilter::calcFilterInfo( hkpGroupFilterSetup::LAYER_KEYFRAME);
boxInfo.m_position.set(0.0f, 0.0f, 0.0f);
boxInfo.m_restitution = 0.9f;

pObj->m_body = new hkpRigidBody(boxInfo);
boxShape->removeReference();

m_world->addEntity(pObj->m_body);
pObj->m_body->setQualityType(HK_COLLIDABLE_QUALITY_KEYFRAMED_REPORTING);

I see the objects in the moving correctly in the VisualDebugger and passing through each other.
I tried to get collison reporting using both CollisionListener and the asynchronous method but didn't got any results.

What do I do wrong?

Thanks
Yinon

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.
Imagen de yinono

solved.
I forgot the line:

hkpAgentRegisterUtil::registerAllAgents(m_world->getCollisionDispatcher());

Inicie sesión para dejar un comentario.