From 6d31c73216e8267f0a08ac54d4340b7c8e0c99b2 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Thu, 15 Aug 2019 11:05:24 -0700 Subject: [PATCH] style fix and remove unused variable --- examples/DeformableDemo/DeformableMultibody.cpp | 2 -- .../btDeformableRigidDynamicsWorld.cpp | 12 ++++++------ src/BulletSoftBody/btDeformableRigidDynamicsWorld.h | 3 +-- src/BulletSoftBody/btSoftBodyInternals.h | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/DeformableDemo/DeformableMultibody.cpp b/examples/DeformableDemo/DeformableMultibody.cpp index e947a5585..d32cd67a7 100644 --- a/examples/DeformableDemo/DeformableMultibody.cpp +++ b/examples/DeformableDemo/DeformableMultibody.cpp @@ -49,8 +49,6 @@ static bool g_floatingBase = true; static float friction = 1.; class DeformableMultibody : public CommonMultiBodyBase { - btMultiBody* m_multiBody; - btAlignedObjectArray m_jointFeedbacks; public: DeformableMultibody(struct GUIHelperInterface* helper) : CommonMultiBodyBase(helper) diff --git a/src/BulletSoftBody/btDeformableRigidDynamicsWorld.cpp b/src/BulletSoftBody/btDeformableRigidDynamicsWorld.cpp index 3b3b62edc..80c77ada1 100644 --- a/src/BulletSoftBody/btDeformableRigidDynamicsWorld.cpp +++ b/src/BulletSoftBody/btDeformableRigidDynamicsWorld.cpp @@ -64,7 +64,7 @@ void btDeformableRigidDynamicsWorld::internalSingleStepSimulation(btScalar timeS // /////////////////////////////// } -void btDeformableRigidDynamicsWorld::positionCorrection(btScalar dt) +void btDeformableRigidDynamicsWorld::positionCorrection(btScalar timeStep) { // perform position correction for all constraints BT_PROFILE("positionCorrection"); @@ -140,7 +140,7 @@ void btDeformableRigidDynamicsWorld::positionCorrection(btScalar dt) { c->m_node->m_v = va; } - c->m_node->m_v -= dp * cti.m_normal / dt; + c->m_node->m_v -= dp * cti.m_normal / timeStep; } } } @@ -149,19 +149,19 @@ void btDeformableRigidDynamicsWorld::positionCorrection(btScalar dt) } -void btDeformableRigidDynamicsWorld::integrateTransforms(btScalar dt) +void btDeformableRigidDynamicsWorld::integrateTransforms(btScalar timeStep) { BT_PROFILE("integrateTransforms"); m_deformableBodySolver->backupVelocity(); - positionCorrection(dt); - btMultiBodyDynamicsWorld::integrateTransforms(dt); + positionCorrection(timeStep); + btMultiBodyDynamicsWorld::integrateTransforms(timeStep); for (int i = 0; i < m_softBodies.size(); ++i) { btSoftBody* psb = m_softBodies[i]; for (int j = 0; j < psb->m_nodes.size(); ++j) { btSoftBody::Node& node = psb->m_nodes[j]; - node.m_x = node.m_q + dt * node.m_v; + node.m_x = node.m_q + timeStep * node.m_v; } } m_deformableBodySolver->revertVelocity(); diff --git a/src/BulletSoftBody/btDeformableRigidDynamicsWorld.h b/src/BulletSoftBody/btDeformableRigidDynamicsWorld.h index de5eb7ef4..6efbb204b 100644 --- a/src/BulletSoftBody/btDeformableRigidDynamicsWorld.h +++ b/src/BulletSoftBody/btDeformableRigidDynamicsWorld.h @@ -38,7 +38,6 @@ class btDeformableRigidDynamicsWorld : public btMultiBodyDynamicsWorld bool m_drawFaceTree; bool m_drawClusterTree; btSoftBodyWorldInfo m_sbi; - bool m_ownsSolver; btScalar m_internalTime; typedef void (*btSolverCallback)(btScalar time, btDeformableRigidDynamicsWorld* world); @@ -49,7 +48,7 @@ protected: virtual void integrateTransforms(btScalar timeStep); - void positionCorrection(btScalar dt); + void positionCorrection(btScalar timeStep); void solveDeformableBodiesConstraints(btScalar timeStep); diff --git a/src/BulletSoftBody/btSoftBodyInternals.h b/src/BulletSoftBody/btSoftBodyInternals.h index 80545ebad..a39394e0b 100644 --- a/src/BulletSoftBody/btSoftBodyInternals.h +++ b/src/BulletSoftBody/btSoftBodyInternals.h @@ -998,7 +998,7 @@ struct btSoftColliders if (!n.m_battach) { // check for collision at x_{n+1}^* - if (psb->checkDeformableContact(m_colObj1Wrap, n.m_x, m, c.m_cti, /*predicted = */ true)) + if (psb->checkDeformableContact(m_colObj1Wrap, n.m_x, m, c.m_cti, /*predict = */ true)) { const btScalar ima = n.m_im; const btScalar imb = m_rigidBody ? m_rigidBody->getInvMass() : 0.f; @@ -1006,7 +1006,7 @@ struct btSoftColliders if (ms > 0) { // resolve contact at x_n - psb->checkDeformableContact(m_colObj1Wrap, n.m_q, m, c.m_cti, /*predicted = */ false); + psb->checkDeformableContact(m_colObj1Wrap, n.m_q, m, c.m_cti, /*predict = */ false); btSoftBody::sCti& cti = c.m_cti; c.m_node = &n; const btScalar fc = psb->m_cfg.kDF * m_colObj1Wrap->getCollisionObject()->getFriction();