add method to remove softbody
This commit is contained in:
@@ -27,7 +27,10 @@ btDeformableBackwardEulerObjective::btDeformableBackwardEulerObjective(btAligned
|
|||||||
void btDeformableBackwardEulerObjective::reinitialize(bool nodeUpdated, btScalar dt)
|
void btDeformableBackwardEulerObjective::reinitialize(bool nodeUpdated, btScalar dt)
|
||||||
{
|
{
|
||||||
BT_PROFILE("reinitialize");
|
BT_PROFILE("reinitialize");
|
||||||
setDt(dt);
|
if (dt > 0)
|
||||||
|
{
|
||||||
|
setDt(dt);
|
||||||
|
}
|
||||||
if(nodeUpdated)
|
if(nodeUpdated)
|
||||||
{
|
{
|
||||||
updateId();
|
updateId();
|
||||||
|
|||||||
@@ -269,3 +269,11 @@ void btDeformableMultiBodyDynamicsWorld::addForce(btSoftBody* psb, btDeformableL
|
|||||||
forces.push_back(force);
|
forces.push_back(force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void btDeformableMultiBodyDynamicsWorld::removeSoftBody(btSoftBody* body)
|
||||||
|
{
|
||||||
|
m_softBodies.remove(body);
|
||||||
|
btCollisionWorld::removeCollisionObject(body);
|
||||||
|
// force a reinitialize so that node indices get updated.
|
||||||
|
m_deformableBodySolver->reinitialize(m_softBodies, btScalar(-1));
|
||||||
|
}
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ public:
|
|||||||
|
|
||||||
void addForce(btSoftBody* psb, btDeformableLagrangianForce* force);
|
void addForce(btSoftBody* psb, btDeformableLagrangianForce* force);
|
||||||
|
|
||||||
|
void removeSoftBody(btSoftBody* body);
|
||||||
|
|
||||||
int getDrawFlags() const { return (m_drawFlags); }
|
int getDrawFlags() const { return (m_drawFlags); }
|
||||||
void setDrawFlags(int f) { m_drawFlags = f; }
|
void setDrawFlags(int f) { m_drawFlags = f; }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user