Cloth will override all the vertices of the mesh and do CPU skinning on the non-simulated vertices when the optimization 'remove static particles' is enabled

This commit is contained in:
Aaron Ruiz Mora
2021-04-27 10:00:27 +01:00
committed by GitHub
parent cfc09ccfb7
commit c415fcc0b4
6 changed files with 179 additions and 126 deletions
@@ -12,6 +12,8 @@
#include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h>
#include <NvCloth/ITangentSpaceHelper.h>
#include <Utils/MeshAssetHelper.h>
namespace NvCloth
@@ -224,6 +226,13 @@ namespace NvCloth
meshClothInfo.m_indices.insert(meshClothInfo.m_indices.end(), sourceIndices.begin(), sourceIndices.end());
}
// Calculate tangent space for the mesh.
[[maybe_unused]] bool tangentSpaceCalculated =
AZ::Interface<ITangentSpaceHelper>::Get()->CalculateTangentSpace(
meshClothInfo.m_particles, meshClothInfo.m_indices, meshClothInfo.m_uvs,
meshClothInfo.m_tangents, meshClothInfo.m_bitangents, meshClothInfo.m_normals);
AZ_Assert(tangentSpaceCalculated, "Failed to calculate tangent space.");
return true;
}
} // namespace NvCloth