Save MOPP code from bvtree?

Save MOPP code from bvtree?

I've been searching and looking at some code snippets and the MOPP demo code but I'm still unsure of how to save and load MOPP code from a hkpBvTreeShape. Any ideas?

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

Hi drwbns,

I'm not sure if i understand what you're asking, but you can create a MOPP code from an hkpBvTreeShape using hkpMoppUtility::buildCode( bvTreeShape->getContainer() , input).

Josh S. Havok Developer Support Engineer

I was talking about saving the result of that function, but I found the answer.

May it be something like that:


hkResult saveWorld( hkpWorld* world, const char* path, bool binary )
    hkOstream outfile( path );
    return hkpHavokSnapshot::save(world, outfile.getStreamWriter(), binary);





hkpRigidBody* loadWorld( const char* path, hkResource** allocsOut )
    hkIstream infile( path );
    hkpPhysicsData* physicsData = hkpHavokSnapshot::load(infile.getStreamReader(), allocsOut);
    return physicsData->findRigidBodyByName("myBodyName");



Just confirm if this was what you are looking for. It may be useful for people who are experiencing the same situation!

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya