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