@@ -162,9 +162,9 @@ void SplitImpulse::initPhysics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SPLIT_IMPULSE
|
#ifdef USE_SPLIT_IMPULSE
|
||||||
getDeformableDynamicsWorld()->getSolverInfo().m_erp = 0.03;
|
getDeformableDynamicsWorld()->getSolverInfo().m_deformable_erp = 0.03;
|
||||||
#else
|
#else
|
||||||
getDeformableDynamicsWorld()->getSolverInfo().m_erp = 0.0;
|
getDeformableDynamicsWorld()->getSolverInfo().m_deformable_erp = 0.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// create a piece of cloth
|
// create a piece of cloth
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ struct btContactSolverInfoData
|
|||||||
btScalar m_sor; //successive over-relaxation term
|
btScalar m_sor; //successive over-relaxation term
|
||||||
btScalar m_erp; //error reduction for non-contact constraints
|
btScalar m_erp; //error reduction for non-contact constraints
|
||||||
btScalar m_erp2; //error reduction for contact constraints
|
btScalar m_erp2; //error reduction for contact constraints
|
||||||
|
btScalar m_deformable_erp; //error reduction for deformable constraints
|
||||||
btScalar m_globalCfm; //constraint force mixing for contacts and non-contacts
|
btScalar m_globalCfm; //constraint force mixing for contacts and non-contacts
|
||||||
btScalar m_frictionERP; //error reduction for friction constraints
|
btScalar m_frictionERP; //error reduction for friction constraints
|
||||||
btScalar m_frictionCFM; //constraint force mixing for friction constraints
|
btScalar m_frictionCFM; //constraint force mixing for friction constraints
|
||||||
@@ -81,6 +82,7 @@ struct btContactSolverInfo : public btContactSolverInfoData
|
|||||||
m_numIterations = 10;
|
m_numIterations = 10;
|
||||||
m_erp = btScalar(0.2);
|
m_erp = btScalar(0.2);
|
||||||
m_erp2 = btScalar(0.2);
|
m_erp2 = btScalar(0.2);
|
||||||
|
m_deformable_erp = btScalar(0.);
|
||||||
m_globalCfm = btScalar(0.);
|
m_globalCfm = btScalar(0.);
|
||||||
m_frictionERP = btScalar(0.2); //positional friction 'anchors' are disabled by default
|
m_frictionERP = btScalar(0.2); //positional friction 'anchors' are disabled by default
|
||||||
m_frictionCFM = btScalar(0.);
|
m_frictionCFM = btScalar(0.);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void btDeformableContactProjection::splitImpulseSetup(const btContactSolverInfo&
|
|||||||
btAlignedObjectArray<btDeformableNodeRigidContactConstraint>& constraints = *m_nodeRigidConstraints.getAtIndex(index);
|
btAlignedObjectArray<btDeformableNodeRigidContactConstraint>& constraints = *m_nodeRigidConstraints.getAtIndex(index);
|
||||||
for (int i = 0; i < constraints.size(); ++i)
|
for (int i = 0; i < constraints.size(); ++i)
|
||||||
{
|
{
|
||||||
constraints[i].setPenetrationScale(infoGlobal.m_erp);
|
constraints[i].setPenetrationScale(infoGlobal.m_deformable_erp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ void btDeformableContactProjection::splitImpulseSetup(const btContactSolverInfo&
|
|||||||
for (int index = 0; index < m_allFaceConstraints.size(); ++index)
|
for (int index = 0; index < m_allFaceConstraints.size(); ++index)
|
||||||
{
|
{
|
||||||
btDeformableContactConstraint* constraint = m_allFaceConstraints[index];
|
btDeformableContactConstraint* constraint = m_allFaceConstraints[index];
|
||||||
constraint->setPenetrationScale(infoGlobal.m_erp);
|
constraint->setPenetrationScale(infoGlobal.m_deformable_erp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ void btSoftBody::initDefaults()
|
|||||||
m_cfg.drag = 0;
|
m_cfg.drag = 0;
|
||||||
m_cfg.m_maxStress = 0;
|
m_cfg.m_maxStress = 0;
|
||||||
m_cfg.collisions = fCollision::Default;
|
m_cfg.collisions = fCollision::Default;
|
||||||
m_cfg.collisions |= fCollision::VF_DD;
|
|
||||||
m_pose.m_bvolume = false;
|
m_pose.m_bvolume = false;
|
||||||
m_pose.m_bframe = false;
|
m_pose.m_bframe = false;
|
||||||
m_pose.m_volume = 0;
|
m_pose.m_volume = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user