Skip to content

Commit

Permalink
BugFix: Apply the mesh transform when retrieving the vertexes from it…
Browse files Browse the repository at this point in the history
…s render data

Apply the mesh transform when retrieving the vertexes from its render data
  • Loading branch information
Sserpenthraxus-nv committed Aug 29, 2019
1 parent 3446c7c commit 71b759e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ namespace NVSceneCapturerUtils
const UStaticMeshComponent* StaticMeshComp = Cast<UStaticMeshComponent>(MeshComp);
if (StaticMeshComp)
{
const FTransform& MeshTransform = StaticMeshComp->GetComponentTransform();
const UStaticMesh* CheckMesh = StaticMeshComp->GetStaticMesh();
if (CheckMesh && CheckMesh->BodySetup)
{
const FTransform& MeshTransform = StaticMeshComp->GetComponentTransform();
const FKAggregateGeom& MeshGeom = CheckMesh->BodySetup->AggGeom;

for (const FKConvexElem& ConvexElem : MeshGeom.ConvexElems)
Expand All @@ -535,7 +535,8 @@ namespace NVSceneCapturerUtils

for (uint32 i = 0; i < VertexesCount; i++)
{
OutVertexes.Add(MeshVertexBuffer.VertexPosition(i));
const FVector& VertexWorldLocation = MeshTransform.TransformPosition(MeshVertexBuffer.VertexPosition(i));
OutVertexes.Add(VertexWorldLocation);
}
}
}
Expand Down

0 comments on commit 71b759e

Please sign in to comment.