For example, Havok Content Tools allows you to define physic bodies, properties, connections, etc in Maya, 3d Studio Max, etc.
For creating full scenes/levels is this really the correct approach or is there some better way to do things.
Are you using Havok Content Tools to import your meshes as well or are you importing obj counterparts? How are you connecting them together in your engine? What engine are you using?
In complex scenes, you will find that many objects in the scene are repeating. If you export through fbx
for example, it converts all instances into objects. And AFAIK the content tools ignore instances when exporting. If your engine supports mesh instancing (which it should) then this is a big performance loss as now you will be creating several objects (for example a bunch of crates) in your engine as separate mesh objects instead of taking advantage of mesh instancing. This applies to movable and fixed objects.
One approach is to model all the objects separately, which will be your meshes and create the physics hulls for them. Although the Havok Content Tools does a decent job of creating that hull for you, you are better of making your own as this will give you more control (this is assuming your object is complex and not a simple shape such as a box or a sphere). Now you have a relatively higher poly graphics mesh, with a lower poly convex hull (both are meshes at this point). The hull is the one that is made into a rigid body while the mesh is not (inside Maya/Max). In your engine, you simply attach the two using a wrapper so that the hkpRigidBody now moves the graphical counterpart.
I am using the Ogre3D graphics engine for example. I use the same technique as above. I can have several instances of the same mesh and it results in a performance boost.
To visualize the placement of the objects in the scene, I place the actual objects (which are in a separate layer) with dummy locators.The locators are then used to grab the transformations that are applied to the object when I import the object separately and place it in the scene within the engine (the objects on the separate layer are ignored when exporting).
There are of course several way to go about it, this is only one of them.
Box_Mesh
and Box_RB
. Both are meshes in Maya. Box_Mesh is imported separately so that you can instance it. Box_RBs are imported via hkx
and then tied with Box_Mesh
by simply attaching an entity that is a Box_RB
- _Rb
+ _Mesh
.
\$\endgroup\$