# Airframe Collision Meshes When making an aircraft there are a number of different **collision meshes** that will need to be created. Some of these are related to how the camera functions, others are for pre-flight activities and others are simply to register collisions with the terrain or other SimObjects. Most of these are explained in the sections below, however the following links pertain to certain collision meshes that are specific to a particular part of the airframe: - [Wheel Collisions](wheels/#collision-mesh)     ### Drone Collision Mesh The drone collision mesh is a rough collision mesh of the cockpit which prevents the cockpit free camera from moving outside, and - in drone (showcase) mode - it forces the display of the LOD0 of the cockpit as soon as the drone penetrates the mesh. It is also used as a fallback collision mesh for panel interactions in the case where the `PANEL_COLLISION` mesh is not found in the {{< glossterm >}}gltf{{< /glossterm >}}. {{< callout context="caution" title="IMPORTANT!" icon="outline/alert-triangle" >}} This mesh should be exported as part of the **airframe** glTF, for the **exterior** LOD that will be visible in interior view (usually LOD0), and the normals/polygons of this mesh must be oriented toward the **inside**. {{< /callout >}} Note that - because of its inaccuracy - there may be places in the cockpit where some depth issues appear. This is to be expected and is not considered an issue.   In general you would make this mesh in the cockpit scene (using only a few polygons, with a closed geometry, and interior-facing normals), then import it into the airframe scene for use. {{< image-center src="images/3_Models_And_Textures/Aircraft/airframe/collisions/collisions_1_drone_mesh.png" alt="Example Of Drone Collision Mesh" >}}   When creating this mesh, "`DRONE_COLLISION_IN`" must be the name of the *root* node of the collision mesh in the airframe part {{< glossterm >}}gltf{{< /glossterm >}}. Note that if there are multiple seats in the cockpit cabin then you should also block out the seats as part of the collision mesh geometry to prevent the camera from clipping through them.   The material used for the collision mesh should be of the [Invisible](../../../textures/materials/flightsim-materials/#invisible) material type and the [Collision Material](../../../textures/materials/flightsim-materials/#collision-material) flag must be checked: {{< image-center src="images/3_Models_And_Textures/Aircraft/general/general_1_collision_material.png" alt="Collision Material Setup" >}} {{< callout context="note" title="NOTE" icon="outline/bulb" >}} This material can be part of a multi-material and can also be used for other collision meshes. You do not need a unique material per-collision mesh. {{< /callout >}} In the simulation, the mesh is activated by retrieving the node that contains the mesh, and this node is found thanks to its name. Below you can see an example of the `DRONE_COLLISION_IN` mesh as seen from the interior of the Airbus A320 Neo: {{< image-center src="images/3_Models_And_Textures/Aircraft/airframe/collisions/collisions_2_drone_view.png" alt="The DRONE_COLLISION_IN Mesh For The Airbus A320neo" >}}     ### Envelope Collision Mesh The envelope mesh is one which loosely follows the aircraft mesh and will be used to detect any collisions between the aircraft and other physical objects in the simulation. The creation of this mesh starts with creating a single *simple* mesh around all the parts of the aircraft. The image below is the total collision mesh used by the **Xcub** aircraft: {{< image-center src="images/3_Models_And_Textures/Aircraft/airframe/collisions/collisions_3_envelope_total.png" alt="The Simple Envelope Collision Mesh For The XCub" >}}   The material used for the collision mesh should be of the [Invisible](../../../textures/materials/flightsim-materials/#invisible) material type and the [Collision Material](../../../textures/materials/flightsim-materials/#collision-material) flag must be checked: {{< image-center src="images/3_Models_And_Textures/Aircraft/general/general_1_collision_material.png" alt="Collision Material Setup" >}} {{< callout context="note" title="NOTE" icon="outline/bulb" >}} This material can be part of a multi-material and can also be used for other collision meshes. You do not need a unique material per-collision mesh. {{< /callout >}} Once you have the total mesh, it should be generated for **all LODs** to prevent any specific LOD from not registering collisions, since different aircraft parts can be on different LODs when a collision occurs. The model can then be separated into the different parts that the aircraft will be split into to make it compatible with the modular aircraft system (as explained here: [Aircraft Part Distribution](../aircraft-modeling-general-principles/#parts)). The aircraft shown in the image above has the following parts breakdown for the collision mesh: {{< image-center src="images/3_Models_And_Textures/Aircraft/airframe/collisions/collisions_4_envelope_parts.png" alt="The XCub Collision Mesh Broken Down By Part For Export" >}} We recommend that you put the meshes into layers based on part groupings for export, for example: {{< image-center src="images/3_Models_And_Textures/Aircraft/airframe/collisions/collisions_5_envelope_groups.png" alt="Example Of Mesh Groupings To Be Exported With Aircraft Parts" >}}