This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Physics materials

Physics materials define how a PhysX collider reacts to collisions through properties like friction and restitution (bounce). In O3DE, you create physics materials with the Asset Editor and assign them to PhysX colliders.

Topics

Physics material properties

Physics material interface.

Dynamic Friction The friction coefficient when the PhysX collider is moving. 0.0: No friction.

Static Friction The friction coefficient when the PhysX collider is still. 0.0: No friction.

Restitution The energy that the PhysX collider retains on collision (bounce). 0.0: No bounce. 1.0: Maximum bounce.

Friction combine Define how physics material frictions are combined between PhysX colliders when colliding. Average: The average of the materials in contact. This is the default value. Minimum: The smaller value of the materials in contact. Maximum: The larger of the values of the materials in contact. Multiply: The product of the values of the materials in contact.

Restitution combine Define how physics material restitutions are combined between PhysX colliders when colliding. Average: The average of the materials in contact. This is the default value. Minimum: The smaller value of the materials in contact. Maximum: The larger of the values of the materials in contact. Multiply: The product of the values of the materials in contact.

Density Define the degree of compactness of a material.

Compliant Contact Mode (available with PhysX 5.1 enabled only)

  • Enable When enabled the normal force of the contact is computed using an implicit spring. Restitution properties are not used when Compliant Contact Mode is enabled.

  • Damping Higher damping values produce spongy contacts.

  • Stiffness Higher stiffness values produce stiffer springs that behave more like a rigid contact. The higher the mass of the object, the higher the stiffness needs to be to reduce penetration.

Debug Color The display color of the physics material in debug view.

Note:

When materials collide, the Friction combine and Restitution combine define the value of applied friction and restitution using the following order:

  1. Average
  2. Minimum
  3. Multiply
  4. Maximum

Create a physics material

Physics materials define the physical properties of PhysX colliders.

To create a physics material

  1. Choose Asset Editor from the Tools menu.

  2. In the Asset Editor, choose New, PhysX Material from the File menu.

    Create a physics material in the Asset Editor.

  3. Set the material properties as desired.

  4. Choose Save As from the File menu in the Asset Editor to save the physics material.

Assign a physics material

When using a PhysX Primitive Collider component, one physics material can be assigned for the entire collider.

When using a PhysX Mesh Collider component, physics materials can be assigned to entire collider or on a per-face basis if the PhysX asset is a triangle mesh. When the Physics Materials from Asset property is enabled, the physics materials for this collider are automatically set based on the Physics Materials from the mesh’s PhysX asset (see FBX Settings PhysX tab). To manually set the physics materials in the collider, uncheck the Physics Materials from Asset property and select the physics materials from the Physics Materials property list to assign it.

PhysX Primitive Collider, setting the physics materials.

Assign physics materials per face

Entities that have PhysX triangle mesh assets can have physics materials assigned per face. You define material placement by assigning materials to the faces of the triangle collision mesh in a content creation application. These materials are listed in both FBX Settings PhysX group and PhysX Mesh Collider component, where each material is assigned a physics material.

For more information on creating PhysX mesh assets, see FBX Settings PhysX tab.

In the example below, the PhysX mesh asset was authored with six materials in the content creation application: Yellow, Red, Blue, Teal, Green and Orange. In FBX Settings, under PhysX tab, a physics material can be assigned to each material.

PhysX Asset, per face physics materials.

In PhysX Mesh Collider Component, when Physics Materials from Asset property is disabled, a physics material can be manually assigned to each material. When Physics Materials from Asset property is enabled the physics materials assigned in FBX Settings will be used automatically.

PhysX Mesh Collider, per face physics materials.