Concave Meshes and Holes

Concave Meshes and Holes

Richard Keene's picture

We want to use low poly meshes for objects collision in The Dead Linger using Havok.

For example a rock is 500 polys, but we have a 20 poly model for collision.  It may not be Convex.

Also we want things like wooden chairs where there are the legs, seat, and the two vertical back pieces, and a cross piece for the upper back. One should be able to shoot between the pieces or 'hole' in the mesh.

Does Havok supporty concave meshes as a single mesh?  

All I see is Convex mesh objects.  Is it necessary to split the meshes out so they are all convex?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
fiction's picture

I am not sure which 3d modeler you are using, but if I understand your question correctly, you may want to take a look at page 778 of the manual ( maya tutorial: more on rigid bodies). There is a good description there of how to create and export concave objects by using multiple convex rigid bodies.

Havok - Josh S.'s picture

The simple answer is that Havok requires all shapes that it uses for collision to be convex. In practice, this means that any concave geometry that you want to represent needs to be approximated by a similar convex shape, broken into smaller convex pieces, or both. The more pieces you break a piece of concave geometry into, the more accurately it can represent the original, but the less efficient the physics will be. When deciding how to represent a particular piece of concave geometry, it's important to think about the importance of geometric accuracy versus performance for that object.

Here's a sampling of convex representation options in order from most to least efficient:

Simple Shape: The most efficient way to represent an object in havok physics is by approximating it using one of the pre-defined simple shapes (eg. hkpBoxShape, hkpCylinderShape, etc). This is recommended for objects that already resemble one of these shapes (eg. crates, barrels, books) and and objects of little importance (eg. debris).

Convex Hull: The convex hull of a shape is technically defined as the smallest convex shape that contains the original shape. Conceptually, you can think of the shape you would get by giftwrapping the original shape. If a shape is convex, its convex hull is just the original shape. This works well for objects that are mostly convex but don't conform to one of the simple shapes (eg. rock, surfboard). Havok provides a tool for generating convex hulls in /Common/Internal/GeometryProcessing/ConvexHull/hkgpConvexHull.h. Check out Demos/Common/Test/Feature/ConvexHull for sample code.

Convex Decomposition: A typical way to represent high-fidelity concave geometry is to break it into convex components. This is essentially what OP described for his chair geometry. This can be done by hand in the modeler, of course, but Havok also provides an automatic tool for convex decomposition. Check out the Havok manual under Common Havok Components -> Geometry Processing -> Convex Decomposition for info on how to use it.

Mesh Shapes: The most expensive version of a convex decomposition breaks each triangle from an original shape into its own convex hkpTriangleShape. Due to its cost, this is generally only recommended for static geometry like landscapes.

For more information and implementation details for these, please look at the Havok Physics help under Creating a Simulation.

Josh S. Havok Developer Support Engineer www.havok.com

Login to leave a comment.