import .hkx files and broadphase size

import .hkx files and broadphase size

I'm trying to import .hkx files created in Maya using Havok Content tools. I'm using the hkpWorldCinfo that I read from the file to initialize the world. I encounter a problem where the file may contain rigid bodies outside the broadphase size or even rigid bodies that are bigger than the broadphase size. Those rigid bodies are removed automatically from my simulation.
Is it possible to export .hkx files from Maya in such way that the broadphase size will contain all rigid bodies? Or maybe there is a way to iterate through all rigid bodies in a file and calculate the needed size for the broadphase?
As I see it, a soultion that sets this parameter at export time and doesn't compute it on loading is much preferable (at least by me).


2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi Yinon,

One work-around would be to cycle through all the rigid bodies in all your physics systems in your physics data when loading the world, then change the world's broadphase before creating it. The only problem would be getting the exact size of the broadphase, but if you add a large enough margin it should mean you don't have to do too many calculations to find the exact right size of the broadphase required to fit all your bodies.

However, there's a lot to be said for careful planning and designing your simulation so that the broadphase isn't too large in the end.

hkpPhysicsData::getPhysicsSystems(), hkpPhysicsSystem::getRigidBodies() are the functions which will let you get at all the bodies. The Physics->Api->Dynamics->World->Worldsnapshot demo shows how to get the physics data loaded up from an .hkx. Let me know if you have any trouble implementing this.


Accedere per lasciare un commento.