LOSCollision Meshes
LOSCollision meshes, or "line of sight" collision meshes, define convex volumes of space that are used for raycasts and projectile collision in Torque. LOSCollision meshes are stored within a special detail level known as a LOSCollision Detail Level. LOSCollision detail levels are created in Blender by specifying one or more scene layers as LOSCollision detail levels in the detail levels panel of the exporter user interface.
Important: If LOSCollision meshes are not convex, projectile collisions will not work reliably for your shape. Matt Fairfax has written a great explanation of convex vs concave meshes that is available here: What is the difference between Concave and Convex?.
Best practice:
- The name of each LOSCollision mesh should start with "los", otherwise you'll get a console warning when you load your dts shape in Torque. This warning is non-critical and can be safely ignored or disabled by commenting it out in the Torque source code if you prefer.
Important Note:
- If a collision detail level does not have a matching numbered LOSCollision detail level, the meshes in the collision detail level will behave as both collision and LOSCollision meshes in Torque. If you want the line of sight collision to match the regular collision volumes exactly, you don't need to create a LOSCollision detail level; in fact, it would be a waste of time and effort to do so. See Pairing of Collision and LOSCollision detail levels below for more information.
What is a raycast?
Raycasts are used by the Torque Game Engine for a variety of purposes. When Torque does a raycast, it literally "casts a ray", or draws an imaginary line originating from one point and extending off in a certain direction. The engine takes the first polygon that was hit and returns information about it as a result of the raycast operation. A DTS shape's LOSCollision meshes are used for most raycast tests, including testing for projectile hits.
Creating a LOSCollision Detail Level
LOSCollision Detail levels are special detail levels that are used to hold LOSCollision meshes. LOSCollision Detail levels are defined through the use of Blender's scene layers. Closed convex LOSCollision meshes are placed in a given scene layer, and that layer is designated as a LOSCollision detail level via the "Detail Levels" panel of the exporter user interface:

Note:
- Versions of TGE prior to 1.4 supported a maximum of 9 LOSCollision detail levels. Newer versions of TGE and TGEA allow an unlimited number of collision and LOSCollision detail levels.
See: Tutorial: Adding Collision and LOSCollision Meshes for more detailed instructions.
Pairing of collision detail levels and LOSCollision detail levels
LOSCollision and ordinary collision detail levels are paired with each other on a 1-to-1 basis in Torque based on the numbers contained in the collision and LOSCollision detail level names.
Internally, the numbers Torque uses for pairing Collision and LOSCollision detail levels are offset by 9. The numbers are based on the actual positions of the collision and loscollision meshes in the dts files detail levels list, not on the numbers in the detail level names. The exporter automatically generates the correct offset when creating the LOSCollision detail levels in the dts file. The net effect of all this is that collision and LOSCollision meshes with the same numbered detail levels in Blender are associated with each other.
So, what is the function of this pairing? A LOSCollision detail will override its collision detail counterpart when it comes to raycasts. Normally, collision detail levels are used by the engine both for regular collision and line of sight collision. By specifying a LOSCollision detail level to accompany a collision detail level, you are telling Torque to use an alternate set of convex mesh volumes for raycasts. If you want the line of sight collision volumes to match the regular collision volumes exactly, you don't need to create a LOSCollision detail level; in fact, it would be a waste of time and effort to do so.
See Also: