Jump to content
  • Advertisement
Sign in to follow this  
Yartch

[Havok] Getting hkpRigidBody from .hkt file

This topic is 2168 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to export a Rigid Body from 3ds max to use in my game. It's just a box, with a Shape and Rigid Body modifier. Here's what the exporter shows.

[attachment=10039:havoklame.jpg]

Then, I'm loading the .hkt file through the hkSerializeUtil class.


hkResource* loadedData = hkSerializeUtil::load("test.hkt");


Here's where the problem seems to be. I'm not sure how to get this data into a hkpRigidBody object.

I've tried this with no success.


hkpRigidBody* contents = loadedData->getContents<hkpRigidBody>();


I also tried loading the data into hkxScene, hkpWorld, but they all just give null pointers.

Halp plz?

Share this post


Link to post
Share on other sites
Advertisement
Hello Yartch,
If you have added a box with a Shape and Rigid Body modifier and used the filters shown in your picture, you should be able to load the .hkt file in your application by using the hkpHavokSnapshot::load function as shown in the "hk'2011_2_0_'r1\Demo\Demos\Physics\Api\Dynamics\World\WorldSnapshot\WorldSnapshot" demo.

Also note that it is also important that you add the Transform Scene filter to your exporter as 3DsMax works in inches and Havok works in meters (you just need to set the Preset parameter to SCALE_INCHES_TO_METERS). This will avoid you some troubles later on.

If it still doesn't work please let me know which version of Havok you are working with and attach the exported .hkt asset and I will take a further look at it.

Cheers,
David Grosman. Edited by havokDavid

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!