Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -387,9 +387,14 @@ namespace NvCloth
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth);
|
||||
|
||||
if (!m_cloth)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate normals of the cloth particles (simplified mesh).
|
||||
AZStd::vector<AZ::Vector3> normals;
|
||||
bool normalsCalculated =
|
||||
[[maybe_unused]] bool normalsCalculated =
|
||||
AZ::Interface<ITangentSpaceHelper>::Get()->CalculateNormals(particles, m_cloth->GetInitialIndices(), normals);
|
||||
AZ_Assert(normalsCalculated, "Cloth component mesh failed to calculate normals.");
|
||||
|
||||
@@ -416,7 +421,7 @@ namespace NvCloth
|
||||
}
|
||||
|
||||
// Calculate tangents and bitangents for the full mesh.
|
||||
bool tangentsAndBitangentsCalculated =
|
||||
[[maybe_unused]] bool tangentsAndBitangentsCalculated =
|
||||
AZ::Interface<ITangentSpaceHelper>::Get()->CalculateTangentsAndBitagents(
|
||||
renderData.m_particles, m_meshClothInfo.m_indices,
|
||||
m_meshClothInfo.m_uvs, renderData.m_normals,
|
||||
@@ -444,9 +449,9 @@ namespace NvCloth
|
||||
const auto& renderBitangents = renderData.m_bitangents;
|
||||
|
||||
AZ::Data::Asset<AZ::RPI::ModelAsset> modelAsset;
|
||||
AZ::Render::MeshComponentRequestBus::EventResult(modelAsset, m_entityId,
|
||||
&AZ::Render::MeshComponentRequestBus::Events::GetModelAsset);
|
||||
if (!modelAsset.GetId().IsValid())
|
||||
AZ::Render::MeshComponentRequestBus::EventResult(
|
||||
modelAsset, m_entityId, &AZ::Render::MeshComponentRequestBus::Events::GetModelAsset);
|
||||
if (!modelAsset.IsReady())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace NvCloth
|
||||
|
||||
void UpdateConfiguration(AZ::EntityId entityId, const ClothConfiguration& config);
|
||||
|
||||
void CopyRenderDataToModel();
|
||||
|
||||
protected:
|
||||
// Functions used to setup and tear down cloth component mesh
|
||||
void Setup(AZ::EntityId entityId, const ClothConfiguration& config);
|
||||
@@ -85,7 +87,6 @@ namespace NvCloth
|
||||
void UpdateSimulationSkinning();
|
||||
void UpdateSimulationConstraints();
|
||||
void UpdateRenderData(const AZStd::vector<SimParticleFormat>& particles);
|
||||
void CopyRenderDataToModel();
|
||||
|
||||
bool CreateCloth();
|
||||
void ApplyConfigurationToCloth();
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace NvCloth
|
||||
|
||||
if (!m_separationConstraints.empty())
|
||||
{
|
||||
bool normalsCalculated = AZ::Interface<ITangentSpaceHelper>::Get()->CalculateNormals(simParticles, simIndices, m_normals);
|
||||
[[maybe_unused]] bool normalsCalculated = AZ::Interface<ITangentSpaceHelper>::Get()->CalculateNormals(simParticles, simIndices, m_normals);
|
||||
AZ_Assert(normalsCalculated, "Cloth constraints failed to calculate normals.");
|
||||
|
||||
CalculateSeparationConstraints();
|
||||
|
||||
Reference in New Issue
Block a user