Editing Arcane University:Mesh Collisions

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{Trail|Implementation|Nif Implementation}}
+
{{Trail|3D Art|NIF Data Format}}
 
'''Collision''' is an attribute of [[Arcane University:NIF Data Format|NIF files]] which makes objects solid in the Creation Engine. When an object has collision, it cannot be walked through, fall through the ground or walls, and also determines what parts of the object are interactable. It can also be used to create non-collidable "phantom collision," to detect when an object enters the collision bounds and then call an event. This article will cover the different types of collision shapes and their uses, as well as the physics settings that affect how the object moves in the world. It is by no means exhaustive—these are just the most commonly used features of collision in Skyrim.
 
'''Collision''' is an attribute of [[Arcane University:NIF Data Format|NIF files]] which makes objects solid in the Creation Engine. When an object has collision, it cannot be walked through, fall through the ground or walls, and also determines what parts of the object are interactable. It can also be used to create non-collidable "phantom collision," to detect when an object enters the collision bounds and then call an event. This article will cover the different types of collision shapes and their uses, as well as the physics settings that affect how the object moves in the world. It is by no means exhaustive—these are just the most commonly used features of collision in Skyrim.
  
{{note|Many problems are avoidable by copying the collision from a similar vanilla nif. This will save you the hassle of setting all the values by hand. Just make sure to use NifSkope's "Reorder Blocks" spell afterwards, otherwise the nif will crash the game/CK.}}
+
'''NOTE:''' Many problems are avoidable by copying the collision from a similar vanilla nif. This will save you the hassle of setting all the values by hand. Just make sure to use NifSkope's "Reorder Blocks" spell afterwards, otherwise the nif will crash the game/CK.
  
 
==Common Shape Types==
 
==Common Shape Types==
 
[[File:WRjaildoor.png|350px|thumb|right|The Whiterun jail door uses a box primitive.]]
 
[[File:WRjaildoor.png|350px|thumb|right|The Whiterun jail door uses a box primitive.]]
There are three main types of collision meshes: '''Primitives''', '''Convex Shapes''', and '''Compressed Mesh Shapes'''. Primitives are the simplest, and compressed mesh shapes are the most complex. The CPU usage required to simulate physics, therefore, is lowest for primitives, slightly higher for convex shapes, and much higher for compressed mesh shapes. For this reason, primitives and convex shapes are preferred, and are the only viable option for moving objects (weapons, clutter that you can pick up, etc.). Compressed mesh shapes are reserved for static objects only (architecture, furniture, etc.).
+
There are three main types of collision meshes: '''Primitives''', '''Convex Shapes''', and '''Compressed MOPP Shapes'''. Primitives are the simplest, and MOPP shapes are the most complex. The CPU usage required to simulate physics, therefore, is lowest for primitives, slightly higher for convex shapes, and much higher for MOPP shapes. For this reason, primitives and convex shapes are preferred, and are the only viable option for moving objects (weapons, clutter that you can pick up, etc.). MOPP shapes are reserved for static objects only (architecture, furniture, etc.).
  
 
===Primitives===
 
===Primitives===
Line 14: Line 14:
 
Convex shapes are the easiest to create, and are extremely common for clutter items and simple furniture. Simply right-click the mesh in NifSkope, and select ''Havok > Create Convex Shape''. Adjust the roundoff error value if you need more or fewer vertices. The collision radius is an invisible shell around the collision shape, and may need to be adjusted later after testing. Smaller values result in a thinner shell. Generally, if the object is very small, it will likely need a smaller radius.
 
Convex shapes are the easiest to create, and are extremely common for clutter items and simple furniture. Simply right-click the mesh in NifSkope, and select ''Havok > Create Convex Shape''. Adjust the roundoff error value if you need more or fewer vertices. The collision radius is an invisible shell around the collision shape, and may need to be adjusted later after testing. Smaller values result in a thinner shell. Generally, if the object is very small, it will likely need a smaller radius.
  
Convex shapes necessarily can not have concave areas, or "indents." For an object that needs this, use either a compressed mesh shape (if it's a static) or a [[#List Shapes|list shape]], if it is dynamic.
+
Convex shapes necessarily can not have concave areas, or "indents." For an object that needs this, use either a MOPP shape (if it's a static) or a [[#List Shapes|list shape]], if it is dynamic.
  
===Compressed Mesh Shapes===
+
===MOPP Shapes===
Compressed mesh shapes are created in [[AU:Software#3D|3D software]] such as Blender, 3ds Max, or Maya. They are typically much simpler (i.e. fewer vertices) than the visible mesh. This can be done either by decimating a copy of the visible mesh, or removing edge loops manually for a higher quality collision mesh. Compressed meshes can also contain multiple collision materials. They can be exported to nif format using either [[Arcane University:CK-CMD for Skyrim#Including Collision Mesh|ck-cmd]] or [[Arcane University:Niftools/Chunkmerge for Skyrim|ChunkMerge]].
+
MOPP shapes are created in [[AU:Software#3D|3D software]] such as Blender, 3ds Max, or Maya. They are typically much simpler (i.e. fewer vertices) than the visible mesh. This can be done either by decimating a copy of the visible mesh, or removing edge loops manually for a higher quality collision mesh. MOPP meshes can also contain multiple collision materials. They can be exported to nif format using either [[Arcane University:CK-CMD for Skyrim#Including Collision Mesh|ck-cmd]] (single material only) or [[Arcane University:Niftools/Chunkmerge for Skyrim|ChunkMerge]].
  
 
==Special Cases==
 
==Special Cases==
 
[[File:Woodenbowl_collision.png|400px|thumb|right|The wooden bowl from vanilla Skyrim, showing a list shape collision.]]
 
[[File:Woodenbowl_collision.png|400px|thumb|right|The wooden bowl from vanilla Skyrim, showing a list shape collision.]]
 
===List Shapes===
 
===List Shapes===
List shapes are collections of convex shapes or primitives. They are often used for bowls, that need to have dynamic collision, but cannot use convex shapes, as well as many weapons. These are most easily made in NifSkope by copying a bhkCollisionObject from a similar nif and adjusting it to fit, or making the list shape by hand in NifSkope. Lists of convex shapes can also be made using [[AU:Nifskope for Skyrim#Forks|Spectral's NifSkope fork]].
+
List shapes are collections of convex shapes or primitives. They are often used for bowls, that need to have dynamic collision, but cannot use convex shapes, as well as many weapons. These are most easily made in NifSkope by copying a bhkCollisionObject from a similar nif and adjusting it to fit, or making the list shape by hand in NifSkope.
 
+
List shapes can use different collision materials, as long as the material is specified on the shape itself. Materials on the transform shapes or the list shape are ignored.
+
  
 
===Constraints===
 
===Constraints===
Line 53: Line 51:
 
*'''Translation/Rotation:''' Translates and rotates the collision mesh. Only enabled in bhkRigidBodyT blocks.
 
*'''Translation/Rotation:''' Translates and rotates the collision mesh. Only enabled in bhkRigidBodyT blocks.
 
*'''<span id="inertia tensors"></span>Inertia Tensors:''' Determines the force necessary to rotate an object around each axis. Ideally would be calculated based on the mass and dimensions of the object, but can be copied from a similar vanilla object, or tweaked until it looks right in game. m11 corresponds to the X-axis, m22 to the y-axis, and m33 to the z-axis. Higher values make the object turn more slowly around that axis. Importantly, if a clutter object lacks inertia tensors, it will slide or float away when Havoked, carrying other nearby clutter with it. Conversely, if a static object has inertia tensors, it will move around when Havok simmed in CK, when it should not.
 
*'''<span id="inertia tensors"></span>Inertia Tensors:''' Determines the force necessary to rotate an object around each axis. Ideally would be calculated based on the mass and dimensions of the object, but can be copied from a similar vanilla object, or tweaked until it looks right in game. m11 corresponds to the X-axis, m22 to the y-axis, and m33 to the z-axis. Higher values make the object turn more slowly around that axis. Importantly, if a clutter object lacks inertia tensors, it will slide or float away when Havoked, carrying other nearby clutter with it. Conversely, if a static object has inertia tensors, it will move around when Havok simmed in CK, when it should not.
*'''Center:''' The center of mass. May not be where the object is held when picked up, since that is determined by the origin point of the nif. If the center of mass is not <tt>0,0,0</tt> in the rigid body, the object will turn over when picked up. If the center of mass is below z=0, the object will right itself when picked up. If the center of mass is above z=0, it will flip upside down.
+
*'''Center:''' The center of mass. May not be where the object is held when picked up, since that is determined by the origin point of the nif.
 
*'''Mass:''' Mass in kg.  
 
*'''Mass:''' Mass in kg.  
 
*'''Linear Damping:''' How much the object's linear velocity is slowed over time. Typically 0.1.
 
*'''Linear Damping:''' How much the object's linear velocity is slowed over time. Typically 0.1.
Line 66: Line 64:
  
 
===Collision Material===
 
===Collision Material===
Collision material is set in each shape. It determines the sound and visual effect when the player strikes it with a weapon, as well as whether arrows stick in it or bounce off, whether it bleeds, and what sound it makes when walked on. Stair materials are used to keep the player from getting stuck when walking up stairs. Compressed meshes can have multiple materials per shape.
+
Collision material is set in each shape. It determines the sound and visual effect when the player strikes it with a weapon, as well as whether arrows stick in it or bounce off, whether it bleeds, and what sound it makes when walked on. Stair materials are used to keep the player from getting stuck when walking up stairs. MOPP meshes can have multiple materials per shape.
  
 
==Troubleshooting==
 
==Troubleshooting==
Line 76: Line 74:
 
==Further Reading==
 
==Further Reading==
 
*[https://cgl.ethz.ch/Downloads/Seminar_Arbeiten/2002_03/Havok_Overview.pdf Havok Game Dynamics SDK - Product Overview]
 
*[https://cgl.ethz.ch/Downloads/Seminar_Arbeiten/2002_03/Havok_Overview.pdf Havok Game Dynamics SDK - Product Overview]
* [https://youtube.com/watch?v=Ammbvh0PbKM 'Types of Collision' Arcane University Lecture on collisions by teacher Candoran]
+
 
 
[[Category:Arcane University-3D Art]] [[Category:Arcane University-Method]] [[Category:Arcane University-Implementation]]
 
[[Category:Arcane University-3D Art]] [[Category:Arcane University-Method]] [[Category:Arcane University-Implementation]]

Please note that all contributions to Beyond Skyrim are considered to be released under the Creative Commons Attribution-ShareAlike (see Beyond Skyrim Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Templates used on this page: