Commit 521aa1cd authored by Nghia Truong's avatar Nghia Truong

BUG: Fix collision data during brute-force CD, changing from triangle-vertex to vertex-triangle

parent e4089bb3
......@@ -80,7 +80,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
m_proximityTolerance,
m_proximityTolerance))
{
m_colData->TVColData.safeAppend({ static_cast<unsigned int>(j), static_cast<unsigned int>(i), 0.0 });
m_colData->VTColData.safeAppend({ static_cast<unsigned int>(i), static_cast<unsigned int>(j), 0.0 });
}
}
}
......@@ -167,7 +167,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
p1[0], p1[1], p1[2],
p2[0], p2[1], p2[2], m_proximityTolerance, m_proximityTolerance))
{
m_colData->TVColData.safeAppend({ static_cast<unsigned int>(j), static_cast<unsigned int>(i), 0.0 });
m_colData->VTColData.safeAppend({ static_cast<unsigned int>(i), static_cast<unsigned int>(j), 0.0 });
}
}
}
......@@ -195,7 +195,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
p1[0], p1[1], p1[2],
p2[0], p2[1], p2[2], m_proximityTolerance, m_proximityTolerance))
{
m_colData->TVColData.safeAppend({ static_cast<unsigned int>(j), static_cast<unsigned int>(i), 0.0 });
m_colData->VTColData.safeAppend({ static_cast<unsigned int>(i), static_cast<unsigned int>(j), 0.0 });
}
}
}
......
......@@ -113,10 +113,10 @@ PBDCollisionHandling::generatePBDConstraints()
m_PBDConstraints.push_back(c);
}
// Generate triangle-vertex pbd constraints
for (size_t i = 0; i < m_colData->TVColData.getSize(); ++i)
// Generate vertex-triangle pbd constraints
for (size_t i = 0; i < m_colData->VTColData.getSize(); ++i)
{
const auto& colData = m_colData->TVColData[i];
const auto& colData = m_colData->VTColData[i];
const auto& triVerts = colGeo2->getTrianglesVertices()[colData.triIdx];
const auto c = std::make_shared<PbdPointTriangleConstraint>();
......@@ -144,6 +144,7 @@ PBDCollisionHandling::generatePBDConstraints()
m_PBDConstraints.push_back(c);
}
//TODO: generating PbdPointTriangleConstraint from the VTColData should be added
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment