Havok terrain creation

Havok terrain creation

Hi,

I am making an application using Havok Physics and rendering graphics with OpenGL. I transfer files from 3dsmax by exporting them to obj and copying vertexes to havok and making a convex shape from it and then importing the obj file with loader and rendering the object to the same place where the havox convex shape is so it looks good and the physical object is in the correct place as the visual object. 

I wanted to make ground terrain this method but the convex shape does not allow me to make any bumps. I want to be able to create more comlex shaped ground to ride a vehicle on it.

I am wondering how to make a havok shape from vertexes that is not convex and then import visual object from 3dmax exactly on it?

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hey Krissboss.

If you want to export a non-convex shape, you have to select the "Mesh" shape in the hkShape " shape type property of your object in Max.

Val - Havok Software Engineer - Physics

No I am using just the Havok Physics libraries in my C++ Application so I dont know how to do it that way. I just export obj file, open it with notepad and Copy all the vertexes it has to my code in application. But when I wanted to declare it as new mesh shape not new convex shape it wasn't working. I am not sure how to declare a new mesh shape in havok code. Could you explain it to me?

In that case, you want touse the BV-compressed mesh shape, so to create the shape programatically you need to

  • create an hkGeometry containing all your vertices and the triangle indexes
  • create a hkpDefaultBvCompressedMeshShapeCinfo, passing a pointer to your geometry as argument to the constructor
  • create a hkpBvCompressedMeshShape passing the Cinfo in the constructor.

You can look up the Bv Compressed Mesh Shape demo in the SDK demo set to see this construction process in action (in this demo, the vertices are actually generated by a height function).

Hope that helps,

Val - Havok Software Engineer - Physics

Leave a Comment

Please sign in to add a comment. Not a member? Join today