// Copyright Epic Games, Inc. All Rights Reserved. #include "MuR/OpMeshTransformWithMesh.h" #include "OpMeshClipWithMesh.h" #include "MuR/Mesh.h" #include "MuR/MeshPrivate.h" #include "MuR/MutableTrace.h" namespace mu { void MeshTransformWithMesh(Mesh* Result, const Mesh* SourceMesh, const Mesh* BoundingMesh, const FMatrix44f& Transform, bool& bOutSuccess) { MUTABLE_CPUPROFILER_SCOPE(MeshClipWithMesh); bOutSuccess = true; const uint32 VCount = SourceMesh->GetVertexBuffers().GetElementCount(); if (!VCount) { bOutSuccess = false; return; // OutSuccess false indicates the SourceMesh can be reused in this case. } Result->CopyFrom(*SourceMesh); // Classify which vertices in the SourceMesh are completely bounded by the BoundingMesh geometry. // If no BoundingMesh is provided, this defaults to act exactly like mu::MeshTransform TBitArray<> VertexInBoundaryMesh; if (BoundingMesh) { MeshClipMeshClassifyVertices(VertexInBoundaryMesh, SourceMesh, BoundingMesh); } const FMatrix44f TransformInvT = Transform.Inverse().GetTransposed(); const FMeshBufferSet& MBSPriv = Result->GetVertexBuffers(); for ( int32 b=0; bGetVertexBuffers(), sem, semIndex ); switch ( sem ) { case MBS_POSITION: for ( uint32_t v=0; v