pub unsafe extern "C" fn PxShape_getMaterialFromInternalFaceIndex(
    self_: *const PxShape,
    faceIndex: u32
) -> *mut PxBaseMaterial
Expand description

Retrieve material from given triangle index.

The input index is the internal triangle index as used inside the SDK. This is the index returned to users by various SDK functions such as raycasts.

This function is only useful for triangle meshes or heightfields, which have per-triangle materials. For other shapes or SDF triangle meshes, the function returns the single material associated with the shape, regardless of the index.

Material from input triangle

If faceIndex value of 0xFFFFffff is passed as an input for mesh and heightfield shapes, this function will issue a warning and return NULL.

Scene queries set the value of PxQueryHit::faceIndex to 0xFFFFffff whenever it is undefined or does not apply.