add initial support for soft body / cloth serialization, and updated SerializeDemo to load soft bodies/cloth.

Serializes soft body nodes (vertices), links, faces, tetrahedra, materials, anchors with rigid bodies.
Some todo's are serialization of pose, constraints between soft bodies
This commit is contained in:
erwin.coumans
2010-12-01 05:55:08 +00:00
parent c6524b3fb5
commit 032c6bfe2c
18 changed files with 1257 additions and 461 deletions

View File

@@ -47,7 +47,10 @@ void btDefaultSoftBodySolver::updateSoftBodies( )
for ( int i=0; i < m_softBodySet.size(); i++)
{
btSoftBody* psb=(btSoftBody*)m_softBodySet[i];
psb->integrateMotion();
if (psb->isActive())
{
psb->integrateMotion();
}
}
} // updateSoftBodies
@@ -62,7 +65,10 @@ void btDefaultSoftBodySolver::solveConstraints( float solverdt )
for(int i=0; i < m_softBodySet.size(); ++i)
{
btSoftBody* psb = static_cast<btSoftBody*>(m_softBodySet[i]);
psb->solveConstraints();
if (psb->isActive())
{
psb->solveConstraints();
}
}
} // btDefaultSoftBodySolver::solveConstraints
@@ -122,7 +128,10 @@ void btDefaultSoftBodySolver::predictMotion( float timeStep )
{
btSoftBody* psb = m_softBodySet[i];
psb->predictMotion(timeStep);
if (psb->isActive())
{
psb->predictMotion(timeStep);
}
}
}