remove one softbody array copy
This commit is contained in:
Binary file not shown.
@@ -111,7 +111,7 @@ public:
|
||||
typedef btAlignedObjectArray<btVector3> TVStack;
|
||||
typedef btAlignedObjectArray<btAlignedObjectArray<btVector3> > TVArrayStack;
|
||||
typedef btAlignedObjectArray<btAlignedObjectArray<btScalar> > TArrayStack;
|
||||
btAlignedObjectArray<btSoftBody *> m_softBodies;
|
||||
btAlignedObjectArray<btSoftBody *>& m_softBodies;
|
||||
btDeformableRigidDynamicsWorld* m_world;
|
||||
// const btAlignedObjectArray<btSoftBody::Node*>* m_nodes;
|
||||
const btScalar& m_dt;
|
||||
@@ -119,7 +119,6 @@ public:
|
||||
btCGProjection(btAlignedObjectArray<btSoftBody *>& softBodies, const btScalar& dt)
|
||||
: m_softBodies(softBodies)
|
||||
, m_dt(dt)
|
||||
// , m_nodes(nodes)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -139,11 +138,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void setSoftBodies(btAlignedObjectArray<btSoftBody* > softBodies)
|
||||
{
|
||||
m_softBodies.copyFromArray(softBodies);
|
||||
}
|
||||
|
||||
virtual void setWorld(btDeformableRigidDynamicsWorld* world)
|
||||
{
|
||||
m_world = world;
|
||||
|
||||
@@ -22,13 +22,13 @@ btDeformableBackwardEulerObjective::btDeformableBackwardEulerObjective(btAligned
|
||||
m_preconditioner = new DefaultPreconditioner();
|
||||
}
|
||||
|
||||
void btDeformableBackwardEulerObjective::reinitialize(bool nodeUpdated)
|
||||
void btDeformableBackwardEulerObjective::reinitialize(bool nodeUpdated, btScalar dt)
|
||||
{
|
||||
BT_PROFILE("reinitialize");
|
||||
setDt(dt);
|
||||
if(nodeUpdated)
|
||||
{
|
||||
updateId();
|
||||
projection.setSoftBodies(m_softBodies);
|
||||
}
|
||||
for (int i = 0; i < m_lf.size(); ++i)
|
||||
{
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
// set initial guess for CG solve
|
||||
void initialGuess(TVStack& dv, const TVStack& residual);
|
||||
|
||||
// reset data structure
|
||||
void reinitialize(bool nodeUpdated);
|
||||
// reset data structure and reset dt
|
||||
void reinitialize(bool nodeUpdated, btScalar dt);
|
||||
|
||||
void setDt(btScalar dt);
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ void btDeformableBodySolver::computeStep(TVStack& dv, const TVStack& residual)
|
||||
|
||||
void btDeformableBodySolver::reinitialize(const btAlignedObjectArray<btSoftBody *>& softBodies, btScalar dt)
|
||||
{
|
||||
m_objective->setDt(dt);
|
||||
m_softBodySet.copyFromArray(softBodies);
|
||||
bool nodeUpdated = updateNodes();
|
||||
|
||||
@@ -69,7 +68,7 @@ void btDeformableBodySolver::reinitialize(const btAlignedObjectArray<btSoftBody
|
||||
m_residual[i].setZero();
|
||||
}
|
||||
|
||||
m_objective->reinitialize(nodeUpdated);
|
||||
m_objective->reinitialize(nodeUpdated, dt);
|
||||
}
|
||||
|
||||
void btDeformableBodySolver::setConstraints()
|
||||
|
||||
Reference in New Issue
Block a user