Important Note: You will need at least version 0.97 Beta2 of the exporter to complete this tutorial. The LOSCollision meshes that we will be creating will not work properly in 0.97 Beta1. You can download 0.97 Beta2 here.
This tutorial covers the process of adding collision and LOSCollision (line of sight collision) meshes to a (static) dts shape. We'll be continuing where we left off in Tutorial 2 - Adding Multiple Levels of Detail, using the same "security fence" model. If you'd like, you can download the completed model from tutorial 2, or use the one that you created. Since I'll be referring back to some of the things that I talked about in tutorials 1 and 2, I'd recommend that you complete tutorials 1 and 2 before attempting this tutorial. I'd also strongly recommend reading through the LOD - Levels of Detail article as well as the Collision Meshes and LOSCollision Meshes articles.

(above: screenshot of the model created in Tutorials 1 and 2 - this model is our starting point for this tutorial)
Step 1 - Preparing the file
First we're going to open up the Tutorial2.blend file that we created in Tutorial 2 and save it under a new name: Tutorial3.blend. Click "File->Save As..." and enter Tutorial3.blend as the new file name.


Note: I've saved my Tutorial3.blend in the same folder as my Tutorial1.blend and Tutorial2.blend files.
Next, we're going to open the exporter user interface and change the output file name. Because the exporter's settings are stored within the .blend file, we've still got the settings from Tutorial2.blend, including the default output file name of Tutorial2.dts. In order to avoid confusion, we're going to reset the output file name to Tutorial3.dts. Open the exporter GUI and navigate to the "General" panel. Click the "Default" button to the right of the "Output path and file name" text box:

After clicking the "Default" button, you should see the output file name change to Tutorial3.dts.

Go ahead and hit the Export button and verify that you've got a new Tutorial3.dts file in the chosen output folder. Close the exporter GUI (esc key) and re-save your .blend file. After changing the exporter's settings, it's a good idea to close the exporter and re-save the .blend file to ensure that the newest exporter settings are saved.
Now that we've got our file prepared, we're ready to begin.
Step 2 - Setting up the Collision detail level in the exporter user interface
The first thing that we're going to do in this tutorial is add a collision detail level to the shape. A collision detail level is a special non-rendering detail level that is used to hold collision meshes. Collision mesh names should start with "Col" and collision meshes must be convex. For an explanation of what makes a mesh convex, please read this article by Matt Fairfax: What is the difference between Concave and Convex? (rustycode.com)
Open up the exporter GUI and navigate to the Shape->Detail Levels panel. You should see the 3 visible detail levels that we set up in Tutorial 2:

Using the pulldown next to the "Add:" button, switch the detail level type to "Collision Detail Level":

Click the "Add" button to add a new collision detail level. You should see a new "Collision-1" detail level appear in the list:

Assign layer 6 to the new detail level by clicking the button for layer 6 in the Collision-1 detail level's "Use Layers" buttons:

Notes:
- The "Min Pixel Size" setting for collision detail levels is locked at "-1". A size value of "-1" indicates that the collision detail level is invisible in Torque.
- A collision detail level can hold any number of collision meshes. It is not necessary to create a collision detail level for each collision mesh.
Step 3 - Creating the Collision meshes
Now we're ready to add our collision meshes to the new detail level (layer 6). First we'll be adding the collision meshes for the "columns". I'm going to ignore the bevels at the top and bottom of the column and just use an ordinary cylinder for each column's collision mesh. Before creating the cylinder(s), let's line up the 3d cursor to one of the existing (visible) columns so that our new cylinder object is created at the correct location. Switch the 3d view to layer 1 and select one of the column meshes by right-clicking it. Press "shift-s" and choose "Cursor to selection" from the "Snap" menu that appears:


With the mouse over the 3d view, press the space bar and choose "Add->Mesh->Cylinder" from the menu that appears:

In the "Add Cylinder" dialog that appears, set the Vertices to 8, the Radius to 0.50, the Depth to 3.0, and make sure that the "Cap Ends" option is turned on:

Click the "OK" button to create the cylinder. The new cylinder should be properly aligned with the visible column mesh:

Note: It's important to keep the polygon count of collision meshes as low as possible. Collision is calculated on the CPU, and using too many polygons in a collision mesh can be a performance killer.
Now we're going to move the new cylinder mesh to layer 6 (Collision-1). With the new cylinder object selected, press the 'm' key and click the button for layer 6 in the layer assignment dialog that appears:

Click "OK" to complete the layer assignment operation.
Switch the 3d view to layer 6 and select the new cylinder object by right clicking it.

With the cylinder selected, press "shift-d" to duplicate the cylinder object. When duplicating an object, blender starts an automatic "move" operation. Hold down on the ctrl key (snap to grid) and move the new cylinder to the opposite position on the other side of the origin:

Verify that both cylinders are aligned with the visible column meshes by switching the 3d view back and forth between layers 1 and 6, or by viewing both layers at the same time. Multiple layers can be viewed at the same time by holding down on the shift key while clicking the layer buttons in the header of the 3d view.
Next we're going to rename the new collision meshes. Select the left-hand cylinder object and rename it to "ColMesh1". Select the right-hand cylinder object and rename it to "ColMesh2".
Note: The names of these collision meshes don't really matter, but you'll get a console warning in Torque when loading up the dts shape if all of the collision mesh names don't start with "col" (capitalization doesn't matter).
Now we're going to add two more collision meshes to layer 6, one for the "chainlink" portion of the fence, and one for the barbed wire top.
Add a new cube mesh to layer 6 and rename it to "ColMesh3". Scale and position the cube mesh in object mode or in edit mode until it fits between the two cylinders. It doesn't matter if the mesh overlaps the cylinders a little. The new mesh should be the same height as the two cylinders, and roughly 0.2 units "thick". Don't make the mesh too thin, or high speed objects may be able to pass through it. The finished "fence" collision mesh should look something like this:


Now we're ready to create the final collision mesh in our Collision-1 detail level. Create another cube mesh object and rename it to "ColMesh4". Scale, rotate, and move the new mesh into position so that it covers the "wire top" mesh in layer 1. It should look something like this when viewing layers 1 and 6 at the same time in the 3d view (wireframe mode):


The finished collision meshes in layer 6 should look something like this:

Double check to make sure that your collision meshes are all assigned to layer 6 and not to any other layers.
Save your file now.
Go ahead and export the file to dts and load it up in Torque. Place the shape in a mission using the "static shapes" tree of the mission editor creator. Save the mission, drop a new player and try running up against the fence. Try shooting the fence as well. The fence should block both the player and all projectiles.
IMPORTANT: Right now, with collision meshes only, the shape will block both players and projectiles. In the next step, we're going to add some LOSCollision (Line Of Sight Collision) meshes to the shape. Meshes in a LOSCollision detail override the Line Of Sight collision (projectile collision) of the collision meshes in a corresponding collision detail level. Once we add a matching loscollision detail level, the meshes in the collision detail level that we just created will no longer block projectiles. This "pairing" of collision and loscollision detail levels allows us to set up areas of a shape that the player can shoot through but can't walk through, or vice-versa.
Step 4 - Setting up the LOSCollision detail level in the exporter user interface
A LOSCollision detail level overrides the collision meshes in a collision detail level for line of sight (projectile) collision only. Same-numbered Collision and LOSCollision detail levels in the exporter user interface are matched up with each other. For example, "Collision-1" line of sight collision is overridden by "LOSCollision-1", "Collision-2" by "LOSCollision-2", etc. When the exporter matches up collision and loscollision detail levels, it automatically generates the correct offset to ensure that same-numbered collision and loscollision detail levels as seen in the exporter user interface are matched up with each other. The actual number offset and detail level names as viewed in showtool pro will be different, but everything should work as expected in Torque.
Now we're ready to add a LOSCollision detail level to the shape. Open up the exporter user interface and navigate to the "Shape->Detail Levels" panel. Select "Los Col Detail Level" from the "type" pulldown, and then click the "Add" button. You should see a new "LOSCollision-1" detail level appear in the detail levels list:

Assign layer 16 to the new LOSCollision detail level by clicking the layer button for layer 16 in LOSCollision-1's "Use Layers" buttons:

Note: I like to use layers 1-5 for visible detail levels, layers 6-10 for Collision detail levels, and layers 16-20 (directly below layers 6-10) for LOSCollision detail levels. I find that this helps me to keep things organized and remember which layer corresponds to which detail level. You can use whichever layers you'd like for the detail levels in your own models; the exporter doesn't care :-)
Step 5 - Adding the LOSCollision meshes
IMPORTANT: If you export the model at this point and load the dts file in Torque, you'll find that the fence blocks the player, but that all projectiles now pass through every part of the fence, including the concrete pillars. This is because the Line of Sight collision for the meshes in the "Collision-1" detail level has been overridden by our (empty) LOSCollision-1 detail level. We want projectiles to pass through the chainlink and wire portions of the fence, but not the pillars. We can achieve the desired result by adding two cylinder meshes to our LOSCollision-1 detail level.
Next, we're going to copy the cylinder collision meshes in layer 6 (Collision-1) and move the copies to layer 16 (LOSCollision-1). Switch the 3d View to layer 6 and select both of the cylinder collision meshes by first right-clicking on one and then shift-right-clicking on the other. Press "shift-d" to duplicate the meshes, and then right-click to cancel the automatic move operation. Press the 'm' key and choose layer 16 from the layer assignment dialog that appears:

Click "OK" to complete the layer assignment operation. You should now have two new cylinder meshes in layer 16 that are identical to the two cylinder meshes in layer 6:

Rename the two new cylinder meshes to "LosMesh1" and "LosMesh2". These names don't really matter much, but if LOSCollision mesh names don't start with "LOS" you'll get a console warning in Torque when loading the shape.
Save your file now.
Go ahead and export to dts and verify that the player is unable to walk through the fence or the pillars; and that the player can shoot through the chainlink and barbed wire portions of the fence, but can't shoot through the concrete pillars.
This concludes Tutorial 3.
In the next tutorial, Tutorial 4 - Adding an object animation, we will be adding an animated security camera to one of the pillars.