combat friction drift in positionCorrect by changing velocity and change it back (effectively only changing position)

This commit is contained in:
Xuchen Han
2019-07-23 12:15:23 -07:00
parent a90cad2a96
commit 243b9fc8c7
15 changed files with 291 additions and 152 deletions

View File

@@ -27,12 +27,14 @@ protected:
TVStack m_dv;
TVStack m_residual;
btAlignedObjectArray<btSoftBody *> m_softBodySet;
btDeformableBackwardEulerObjective* m_objective;
btAlignedObjectArray<btVector3> m_backupVelocity;
btScalar m_dt;
btConjugateGradient<btDeformableBackwardEulerObjective> cg;
public:
btDeformableBackwardEulerObjective* m_objective;
btDeformableBodySolver();
virtual ~btDeformableBodySolver();
@@ -57,7 +59,7 @@ public:
void predictDeformableMotion(btSoftBody* psb, btScalar dt);
void backupVelocity();
void revertVelocity();
void updateVelocity();
bool updateNodes();