From 71b759e394a4a73f680b3371b82b7981102f6b3c Mon Sep 17 00:00:00 2001 From: Duncan McKay Date: Thu, 29 Aug 2019 11:45:43 -0700 Subject: [PATCH] BugFix: Apply the mesh transform when retrieving the vertexes from its render data Apply the mesh transform when retrieving the vertexes from its render data --- .../Source/NVSceneCapturer/Private/NVSceneCapturerUtils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerUtils.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerUtils.cpp index 18bbe2e870a..649161e0d43 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerUtils.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerUtils.cpp @@ -512,10 +512,10 @@ namespace NVSceneCapturerUtils const UStaticMeshComponent* StaticMeshComp = Cast(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) @@ -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); } } }