Difference between revisions of "NifSkope: Adding Collision Model"

added a new step - Pack Havok Strips
imported>Entim
(updated links)
imported>Entim
(added a new step - Pack Havok Strips)
Line 1: Line 1:
The purpose of this article is to give a step by step guide to the [[Finessing Physics#Better Collision Modelling|Better Collision Modelling]] method described in [[Finessing Physics]] tutorial. The goal of the process is to create a simple model properly interacting with its environment.
The purpose of this article is to give a step by step guide to the [[Finessing Physics#Better Collision Modelling|Better Collision Modelling]] method described in [[Finessing Physics]] tutorial. The goal of the process is to create a simple model properly interacting with its environment. This method gives the most resource demanding type of collision model, but the easiest to create.
 


==Getting Started==
==Getting Started==
Line 114: Line 113:
|[[Image:CollTut11.gif|100px|right|thumb]]
|[[Image:CollTut11.gif|100px|right|thumb]]
|-
|-
|valign="top"|<font size=2>'''9.''' </font>The meshes may not line up at all at this point. Select '''5 bhkRigidBodyT''' block in the '''Block List''' window, and double-click on the '''Value''' of the '''Translation''' in the '''Block Details''' window. Play with x, y, and z until the collision geometry lines up with the mesh.
|valign="top"|<font size=2>'''9.''' </font>Here comes the step which makes it worth to use this type of collision. Right-click on the '''bhkNiTriStripsShape''' block, and choose '''Havok -> Pack Strips'''. The bhkNiTriStripsShape block will be converted to a bhkPackedNiTriStripsShape. The NiTriStripsData becomes hkPackedNiTriStripsData.
|[[Image:CollTut20.gif|100px|right|thumb]]
|-
|-
|valign="top"|<font size=2>'''10.''' </font>The collision data blocks must be in a specific order, which the NiTriStripsData doesn't fit in yet. Choose '''Reorder Havok Blocks''' from the '''Spells''' -> '''Sanitize''' menu. To reorder the blocks manually, right-click on the '''1 NiTriStripsData''' block, and choose '''Block -> Move Down'''. Notice the reference number has changed to '''2'''. Repeat the '''Move Down''', so the number becomes '''3'''. See [[Finessing_Physics#Simple_Collision_Modelling|Finessing Physics]] tutorial's explanation of the correct block order.
|valign="top"|<font size=2>'''10.''' </font>The meshes may not line up at all at this point. Select '''5 bhkRigidBodyT''' block in the '''Block List''' window, and double-click on the '''Value''' of the '''Translation''' in the '''Block Details''' window. Play with x, y, and z until the collision geometry lines up with the mesh.
|-
|valign="top"|<font size=2>'''11.''' </font>The collision data blocks must be in a specific order, which the hkPackedNiTriStripsData doesn't fit in yet. Choose '''Reorder Havok Blocks''' from the '''Spells''' -> '''Sanitize''' menu. To reorder the blocks manually, right-click on the '''1 NiTriStripsData''' block, and choose '''Block -> Move Down'''. Notice the reference number has changed to '''2'''. Repeat the '''Move Down''', so the number becomes '''3'''. See [[Finessing_Physics#Simple_Collision_Modelling|Finessing Physics]] tutorial's explanation of the correct block order.
|[[Image:CollTut15.gif|100px|right|thumb]]
|[[Image:CollTut15.gif|100px|right|thumb]]
|-
|-
|valign="top"|<font size=2>'''11.''' </font>Save the NIF.
|valign="top"|<font size=2>'''12.''' </font>Save the NIF.
|}
|}






===Fixing up===
NIFs created by this method appearanly always act like stone, no matter what their Material property is set to.
You have to insert a bhkListShape to solve this problem.
*Right-click in the Block List window, and choose '''Block''' -> '''Insert''' -> '''BHK''' -> '''bhkListShape'''.
*Set the '''bhkRigidBodyT''' block's '''Shape''' property to the reference number of the new bhkLishShape in the '''Block Details''' window. The bhkListShape is now linked to the bhkRigidBodyT block.
*Set the '''bhkListShape''' block's '''Num Sub Shapes''' property to 1. Update the '''Sub Shapes''' array, just as you did when linked the high-poly model's NiTriShape to the NiNode.
*Expand the '''Sub Shapes''' array, and enter the reference number of the bhkNiTriStripsShape.
*Reorder the havok blocks.
  Example of the result NIF is [http://www4.rapidupload.com/d.php?file=dl&filepath=27622 here].
  Example of the result NIF is [http://www4.rapidupload.com/d.php?file=dl&filepath=27622 here].


Line 145: Line 137:


[[Image:CollTut13.gif|100px|right|thumb]]
[[Image:CollTut13.gif|100px|right|thumb]]
*Select '''4 bhkNiTriStripsShape''' block. Double-click on the '''Value''' of the '''Material''' property (currently '''HAV_MAT_STONE'''). You get a drop-down list of available materials. This list with some explanation is available as tooltip (hold your mouse over the '''Type''' field of the Material property). Choose the material from the dropdown list, or enter the appropriate number which can be found [http://www.niftools.org/doc/nif/HavokMaterial.html here] as well. This setting controls the hit sound, step sound, arrow penetrability, and particle effect of the surface.
Select the '''bhkPackedNiTriStripsShape''' block. Expand the Sub Shapes array in the '''Block Details''' window. Double-click on the '''Value''' of the '''Material''' property (currently '''HAV_MAT_STONE'''). You get a drop-down list of available materials. This list with some explanation is available as tooltip (hold your mouse over the '''Type''' field of the Material property). Choose the material from the dropdown list, or enter the appropriate number which can be found [http://www.niftools.org/doc/nif/HavokMaterial.html here] as well. This setting controls the hit sound, step sound, arrow penetrability, and particle effect of the surface.
*If you inserted a '''bhkListShape''' block, click on it, and notice that it also has a '''Material''' property. You can tweak the arrow penetration, particle effect, and sound by the material settings of the bhkListShape and the bhkNiTriStripsShape blocks. Arrows will only penetrate if both block's material is penetrable.
 
Note: The hit sound, and particle effect of melee weapon hit is controlled by the bhkListShape's material. Hit sound, and particle effect of arrow hit is controlled by the material of the bhkNiTriStripsShape.


===Collision properties===
===Collision properties===
Line 155: Line 146:


Most important properties:
Most important properties:
*The '''layer''' settings control the mesh color in '''CS''', whether it behaves like a harvestable object like plants (no collision, but the activator icon shows up), and arrow penetrability. The list of layers with some explanation is also available as tooltip.
*The '''layer''' settings control the collision model's color in the '''CS''', and other properties as well, for example the NONCOLLIDABLE layer will make the collision body to behave like a harvestable object (no collision, but the activator icon shows up). The list of layers with some explanation is also available as tooltip.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile. See [[Finessing_Physics#The_Main_Blocks|Finessing Physics]] tutorial's bhkRigidBody explanation.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile. See [[Finessing_Physics#The_Main_Blocks|Finessing Physics]] tutorial's bhkRigidBody explanation.


Anonymous user