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?

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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 www.havok.com

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);
}

 

 

and

 

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!

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!