Collision Object

Last Built: Apr 24, 2021

Collision Object

The following section deals with creating an object which will physically represent our collision object.

Collision Object Mapping

  • The following section describes the most appropriate primitive object to represent the desired collision object type.

  • The suggested shapes are the same objects generated through import by the addon.

  • Upon export, a collision object is created from data pulled from the Collision object.

  • Start by choosing a shape adequate to your model and follow the steps below the appropriate section.

NiCollision

  • Morrowind:

The following type use the collision bound type and the name to decide what to map to:

Blender

Object Name

Mesh Collision

RootCollisionNode

Bounding Box

BSBound

Bounding Box

BoundingBox

BhkShape

  • Oblivion, Fallout 3, and Fallout NV;

Blender

Nif

Box Collision

bhkBoxShape

Sphere Collision

bhkSphereShape

Capsule Collision

bhkCapsuleShape

Convex Hull Collision

bhkConvexVerticesShape

Mesh Collision

bhkMoppBvTreeShape

Bounding Box

This is used as the bound box.

  1. Create an Object of Mesh type to represent the bound box, a Cube is recommended.

  2. Name the object BSBound or BoundingBox, depending on which version you need to be exported.

  3. Refer to the Collision Settings to add physics to our collision object.

Visualisation

  1. In the Object Tab, under the Viewport Display section update the Display As to BOUNDS.

  2. Check the Bounds tickbox.

  3. Select BOX from the shape dropdown.

Mesh Collision

  1. Create your mesh-object.

  2. Create a convex hulled mesh-object. See Notes

  3. Rename the polyhedron-mesh, eg. ‘CollisionPolyhedron’ via the Object panel.

  4. Scale the ‘CollisionPoly’ to the size wanted.

  5. Refer to the Collision Settings to add physics to our collision object.

Visualisation

  1. In the Object Tab, under the Viewport Display section update the Display As to BOUNDS.

  2. Check the Bounds tickbox.

  3. Select BOX from the shape dropdown.

Notes:

  • Often a duplicate object can be used, simplified by decimating, then triangulated(Ctrl + T).

  • A Convex Hulled Object can also be used.

Havok Collision

This is used by the havok system for collision detection.

Warning

  • For Cylinder Export, we need to fix them to show how the user would create the objects. We are using a Meta Capsule

  • Some of the collision types lack viewport rendering, see the workaround for visualisations below.

Notes

  • Collision Bounds are represented by a dashed line, unlike Bounds which are by solid lines.

Box Collision

  1. Create your mesh-object.

  2. Create a second mesh-object to represent our collision object, a primitive cube(prim-cube) is recommended.

  3. Rename the prim-cube via the Object panel, eg. ‘CollisionBox’

  4. Scale the ‘CollisionBox’ uniformly to the size wanted.

  5. Add physics to our ‘CollisionBox’.

Sphere Collision

  1. Create your mesh-object.

  2. Create another mesh-object to represent our collision shape, a primitive sphere(prim-sphere) is highly recommended.

  3. Rename the prim-sphere, eg. ‘CollisionSphere’, via the Object panel

  4. Scale the ‘CollisionSphere’ object as needed, ensuring all vertices are enclosed by the sphere

  5. Add physics to our ‘CollisionSphere’.

Capsule Collision

  1. Create your mesh-object.

  2. Create a second mesh-object to represent our collision object, a primitive cylinder(prim-cylinder) is recommended.

  3. Rename the prim-cylinder via the Object panel, eg. ‘CollisionCapsule’.

  4. Scale the collision cube ‘CollisionBox’ to the size wanted.

  5. Add physics to our ‘CollisionCapsule’.

Notes:

  • If the length is less than or equal to the radius, then a bhkSphereShape is generated instead.

  • Currently Capsule bounds lack viewport preview, awaiting Bullet Physic integration

  • The following is a workaround; Prone to user error, Ensure to reset setting after visualising!.

    • In the Object Tab, under the Display section. Enable Bounds

    • Set the Type to Cylinder.

  • This shape best represents the capsule, but visually missing the end caps which are hemispheres.

Convex Hull Collision

  1. Create your mesh-object.

  2. Create a convex mesh. See Notes

  3. Rename the hulled-object, eg. ‘CollisionHull’ via the Object panel.

  4. Scale the collision cube ‘CollisionBox’ to the size wanted.

  5. Add physics to our collision cube ‘CollisionBox’.

Notes:

  • It is advisable to use a convex hull generator to create the collision mesh.