Desync between Maya Preview and VDB.

Desync between Maya Preview and VDB.

I am using Maya 2012 to create rigid bodies, which I am then loading into my program. For filters, I have:Transform SceneCreate Rigid BodiesCreate WorldPreview ToolPrune TypesWrite to PlatformI am making sure to use the world created here in my code.

hkResource *loadedData = hkSerializeUtil::load( "testfile.xml" );
hkRootLevelContainer *container = loadedData->getContents();
hkpPhysicsData *physicsData = (hkpPhysicsData*)( container->findObjectByType( 
	hkpPhysicsDataClass.getName() ) );
hkpWorld *world = new hkpWorld( *physicsData->getWorldCinfo() );
hkpAgentRegisterUtil::registerAllAgents( world->getCollisionDispatcher() );
for( int i = 0; i < physicsData->getPhysicsSystems().getSize(); ++i )
{
        world->addPhysicsSystem( physicsData->getPhysicsSystems()[i] );
}

I would prefer to use the default havok world that I run inside my program, but I don't know how to do that. The main issue, however, is that when I run the visual debugger to watch what is going on inside my program, objects end up in a different position when the simulation comes to rest inside the visual debugger compared to when the same simulation I just exported comes to rest inside the Preview Tool.Is this a known issue and the Preview Tool should be avoided? I would first guess that I'm unwittingly doing something wrong, as I am a new user. I can provide more information if needed.

Edit: As a note, I am testing this by using the Basic Physics tutorial, where I remove the trap door and the empty cylinder to let the pieces move around on the ground before coming to a stop.

4 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
havok_David的头像
Best Reply

Hey fiction,

The fact that the simulation of a scene by The Preview Tool and the Visual Debugger do not look exactly alike is  expected as long as they both look physically correct:

The Preview Tool is meant to be compatible with (ie.: smoothly play) any user-defined scenes and doesn't care about its performance and memory usage that much as it is a debug tool.

The Visual Debugger however is used to capture a specific scene that is being simulated within a client's framework. Hence its simulation parameters, that are settable by the client for this specific scene, should be different and preferably more optimized than the ones used in the Preview Tool.

For your second question: "I would prefer to use the default havok world that I run inside my program, but I don't know how to do that.", what do you mean by "default havok world"? In the above code, you are just creating a world with the data stored in the "testfile.xml" that you are loading. It should be the only world that you are running inside your program. Do you have another one? Or do you mean that you would like to create a hkpWorld and later on load the data stored in the testfile.xml in it so that you could possibly load another file within the same hkpWorld later on?

Let me know,

David.

David G. Developer Support Engineer Havok www.havok.com

Thank you very much for your excellent reply! I understand abou the Preview Tool now. I was a bit confused about the world stuff but I think I have it figured out now. I'm guessing I just load the world from its own binary or from one binary and then never use the Create World filter again. Is that correct?

havok_David的头像

Hey fiction,

You would only want to use the CreateWorld filter whenever you want to create a new hkpWorld. Hence, in most cases yes, you would only use the CreateWorld Filter for one of your binary file (ie: the one which will be used to load your hkpWorld) and the others would only contain data that you could add to that world.
Note that the definition of one hkpWorld using the HavokContentTools should only span across one binary file.

Do not hesitate to let me know should you have more questions on this,

Cheers,

David.

David G. Developer Support Engineer Havok www.havok.com

登陆并发表评论。