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 |
|---|---|
RootCollisionNode |
|
BSBound |
|
BoundingBox |
BhkShape¶
Oblivion, Fallout 3, and Fallout NV;
Blender |
Nif |
|---|---|
|
|
|
|
|
|
|
|
|
Bounding Box¶
This is used as the bound box.
Create an Object of Mesh type to represent the bound box, a Cube is recommended.
Name the object BSBound or BoundingBox, depending on which version you need to be exported.
Refer to the Collision Settings to add physics to our collision object.
Visualisation
In the Object Tab, under the Viewport Display section update the Display As to BOUNDS.
Check the Bounds tickbox.
Select BOX from the shape dropdown.
Mesh Collision¶
Create a convex hulled mesh-object. See Notes
Rename the polyhedron-mesh, eg. ‘CollisionPolyhedron’ via the Object panel.
Scale the ‘CollisionPoly’ to the size wanted.
Refer to the Collision Settings to add physics to our collision object.
Visualisation
In the Object Tab, under the Viewport Display section update the Display As to BOUNDS.
Check the Bounds tickbox.
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¶
Create a second mesh-object to represent our collision object, a primitive cube(prim-cube) is recommended.
Rename the prim-cube via the Object panel, eg. ‘CollisionBox’
Scale the ‘CollisionBox’ uniformly to the size wanted.
Sphere Collision¶
Create another mesh-object to represent our collision shape, a primitive sphere(prim-sphere) is highly recommended.
Rename the prim-sphere, eg. ‘CollisionSphere’, via the Object panel
Scale the ‘CollisionSphere’ object as needed, ensuring all vertices are enclosed by the sphere
Capsule Collision¶
Create a second mesh-object to represent our collision object, a primitive cylinder(prim-cylinder) is recommended.
Rename the prim-cylinder via the Object panel, eg. ‘CollisionCapsule’.
Scale the collision cube ‘CollisionBox’ to the size wanted.
Notes:
If the length is less than or equal to the radius, then a
bhkSphereShapeis 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¶
Create a convex mesh. See Notes
Rename the hulled-object, eg. ‘CollisionHull’ via the Object panel.
Scale the collision cube ‘CollisionBox’ to the size wanted.
Notes:
It is advisable to use a convex hull generator to create the collision mesh.