The basic principle of Oblivion's Havok system is that each model can have a hierarchy of collision nodes like this:
The behaviour of each will be briefly explained here.
A NiNode in a Oblivion Nif file can have a collision object attached to it. This does what the name suggests, it adds Havok'ed collision data to the node, but there are several ways this collision object can react:
- Normal collision (bhkCollisionObject)
- Shape Phantom Collision (bhkSPCollisionObject), used for trigger zones
- Blend Collision Objects (bhkBlendCollisionObject), used mainly in characters
The collision objects each have a Body assigned to them. There are various body types according to the type of collision object used, for example bhkRigidBody and bhkRigidBodyT are most commonly used, since they belong to the normal bhkCollisionObject (the "T" meaning the transformation settings are applied to the body, translation, rotation etc.). The bodies define the overall attributes of the object, it's Oblivion/Bhk Objects/Mass, friction and restitution, among many others, and also the type of collision model (static like a wall, a weapon), and finally how the object will move.
In short, all physical properties of the collision object are contained in the associated body. Even properties like inertia which are dependent on the object's geometry (later defined in the shape) will be stored with the body, not the shape.
Then, there are Shapes that define the outward appearance of our collision object. Each body only has one shape assigned to it, though there are bhkListShape objects that allow to add multiple sub-shapes to them.
Shape primitives come as
and more complex shapes are supported as well through
- bhkConvexVerticesShape (suggested for custom models),
Shapes contain information about the collision object's material, that includes control of the sound the object emits when hit.
Constraints give more possibilities to create realistic models. Their purpose is to make connection between Bodies, linking them together. There are six types of constraints, each defines a different way of relative movement of the linked Bodies.
See Oblivion Bhk Constraints tutorial for more information.