Description

In ConvertQueryImpactHitImp, MaterialIndex is looked up from InternalFaceIndex, but FTriangleMeshImplicitObject:: MaterialIndices is an array by ExternalFaceIndex, so it returns incorrect material index.

Here is a workaround

uint16 FTriangleMeshImplicitObject::GetMaterialIndex(uint32 HintIndex) const
{
#if 0
    if (MaterialIndices.IsValidIndex(HintIndex))
    {
        return MaterialIndices[HintIndex];
    }
#else
    int32 ExternalFaceIndex = GetExternalFaceIndexFromInternal(HintIndex/*InternalFaceIndex*/);
    if (ExternalFaceIndex > -1 && MaterialIndices.IsValidIndex(ExternalFaceIndex))
    {
        return MaterialIndices[ExternalFaceIndex];
    }
#endif
    // 0 should always be the default material for a shape
    return 0;
} 

 

Steps to Reproduce
  1. Open the attached project on ue5.1
  2. Start PIE
  3. Point the camera at the white brick of the building

Result

The PhysicalMaterial of the white brick is set to Ice, but it returns different PhysicalMaterials depending on its position (see [Link Removed])

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-172946 in the post.

6
Login to Vote

Duplicate
ComponentUE - Simulation - Physics
Affects Versions5.1
Target Fix5.1.1
CreatedDec 15, 2022
ResolvedJan 4, 2023
UpdatedJan 9, 2023