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
UsdPhysicsMaterialAPIand related properties to an existingUsdShadeMaterial(e.g. a visual material).Note
When mixing visual and physical materials, be sure use both
usdex::core::bindMaterialandusdex::core::bindPhysicsMaterialon 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.