diff options
author | Xuchen Han <xuchenhan@xuchenhan-macbookpro.roam.corp.google.com> | 2019-08-08 17:26:19 -0700 |
---|---|---|
committer | Xuchen Han <xuchenhan@xuchenhan-macbookpro.roam.corp.google.com> | 2019-08-08 17:31:59 -0700 |
commit | 817e64a769219621de0debc4979630953dbee60b (patch) | |
tree | c3762d1f021e0a19c44ba9bceee42981ea168280 | |
parent | 436b6c6963d4639599908d4643d4b5f341f86f6c (diff) | |
download | bullet3-817e64a769219621de0debc4979630953dbee60b.tar.gz |
remove one softbody array copy
-rw-r--r-- | examples/ThirdPartyLibs/openvr/bin/osx64/libopenvr_api.a | bin | 1641184 -> 0 bytes | |||
-rw-r--r-- | src/BulletSoftBody/btCGProjection.h | 8 | ||||
-rw-r--r-- | src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp | 4 | ||||
-rw-r--r-- | src/BulletSoftBody/btDeformableBackwardEulerObjective.h | 4 | ||||
-rw-r--r-- | src/BulletSoftBody/btDeformableBodySolver.cpp | 3 |
5 files changed, 6 insertions, 13 deletions
diff --git a/examples/ThirdPartyLibs/openvr/bin/osx64/libopenvr_api.a b/examples/ThirdPartyLibs/openvr/bin/osx64/libopenvr_api.a Binary files differdeleted file mode 100644 index 377e345f2..000000000 --- a/examples/ThirdPartyLibs/openvr/bin/osx64/libopenvr_api.a +++ /dev/null diff --git a/src/BulletSoftBody/btCGProjection.h b/src/BulletSoftBody/btCGProjection.h index 430327ea0..6b5caf581 100644 --- a/src/BulletSoftBody/btCGProjection.h +++ b/src/BulletSoftBody/btCGProjection.h @@ -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; diff --git a/src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp b/src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp index 3e6656c0d..fbc663f35 100644 --- a/src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp +++ b/src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp @@ -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) { diff --git a/src/BulletSoftBody/btDeformableBackwardEulerObjective.h b/src/BulletSoftBody/btDeformableBackwardEulerObjective.h index 30c2d995e..c681300a7 100644 --- a/src/BulletSoftBody/btDeformableBackwardEulerObjective.h +++ b/src/BulletSoftBody/btDeformableBackwardEulerObjective.h @@ -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); diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp index 4dd45edc8..b77ba9da3 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -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() |