addPhysicsToMaterial#

Fully qualified name: usdex::core::addPhysicsToMaterial

bool usdex::core::addPhysicsToMaterial(
pxr::UsdShadeMaterial &material,
const float dynamicFriction,
const std::optional<float> staticFriction = std::nullopt,
const std::optional<float> restitution = std::nullopt,
const std::optional<float> density = std::nullopt,
)#

Adds physical material parameters to an existing Material.

Used to apply UsdPhysicsMaterialAPI and related properties to an existing UsdShadeMaterial (e.g. a visual material).

Note

When mixing visual and physical materials, be sure use both usdex::core::bindMaterial and usdex::core::bindPhysicsMaterial on the target geometry, to ensure the material is used in both rendering and simulation contexts.

Parameters:
  • material – The material prim

  • dynamicFriction – The dynamic friction of the material

  • staticFriction – The static friction of the material

  • restitution – The restitution of the material

  • density – The density of the material

Returns:

Whether the physics material was successfully added to the material.