For a research project I need to derive the hkpMoppBvTreeShape and hkpMoppAgent. I previously managed to derive a hkpSphereShape and hkpSphereBoxAgent successfully, but with the specific case of MOPP shapes I am encountering some difficulties. Specifically, the collisions are correctly handled when my custom MOPP shape collides with another shape, but not the other way around.
The constructor of my custom shape simply calls that of hkpMoppBvTreeShape and same goes for the custom agent with the hkpMoppAgent. I created a static function to create a new custom agent that goes like this :
hkpCollisionAgent* HK_CALL CustomAgent::createCustomAgent(const hkpCdBody& collA, const hkpCdBody& collB, const hkpCollisionInput& env, hkpContactMgr* mgr)
return new CustomAgent(mgr);
I set my custom shape as hkcdShapeType::USER1, and when I create my world, I register my custom agent this way :
f.m_createFunc = CustomAgent::createCustomAgent;
f.m_isPredictive = true;
f.m_isFlipped = true;
m_world->getCollisionDispatcher()->registerCollisionAgent(f, hkcdShapeType::USER1, hkcdShapeType::ALL_SHAPE_TYPES);
m_world->getCollisionDispatcher()->registerCollisionAgent(f, hkcdShapeType::ALL_SHAPE_TYPES, hkcdShapeType::USER1);
What is it that I'm missing ?
Thanks in advance,