# [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.

## 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]

 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 on other sites
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

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 13
• 9
• 12
• 9
• ### Forum Statistics

• Total Topics
631438
• Total Posts
3000072
×

## Important Information

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

Sign me up!