13. Materials

Materials define the way Rigid Bodies interact when in contact. This is a type of material separate from the rendering materials that are an integral part of Unreal Engine. Materials are Assets, which means that they are created and edited in the Content Browser. You can find them in the AGX part of the right-click menu.

The AGX part of the Content Browser right-click menu.

The AGX part of the Content Browser’s right-click menu.

There are two main types of materials: Shape Material and Contact Material. The Shape Material is applied to a Shape Component to assign properties such as density, Young’s Modulus, and roughness to it.

Details Panel for a Shape Material.

Details Panel for a Shape Material

Shape Materials are assigned to Shapes in the AGX Shape section of the Shape’s Details Panel.

Assigning a Shape Material to a Shape.

Shape Materials are assigned to a Shape in the Shape’s Details Panel.

Contact Materials define contact related properties such as friction coefficient and restitution, but also simulation engine related settings such as the type of solver to use, contact reduction parameters, and the friction model. A Contact Material is created for a pair of Shape materials so that when two Shapes having these materials come into contact then this particular Contact Material is used.

Details Panel for a Contact Material

Details panel for a Contact Material.

Just as with other types of assets, simply creating a Contact Material asset does not instantiate it within the level. We must add it to a Component that exists within the level and the type of Component to use for this is the Contact Material Registrar. It has a Contact Materials property that is a list of Contact Materials to which we add the Contact Materials. These are automatically added to the simulation at play.