style fix and remove unused variable
This commit is contained in:
@@ -49,8 +49,6 @@ static bool g_floatingBase = true;
|
|||||||
static float friction = 1.;
|
static float friction = 1.;
|
||||||
class DeformableMultibody : public CommonMultiBodyBase
|
class DeformableMultibody : public CommonMultiBodyBase
|
||||||
{
|
{
|
||||||
btMultiBody* m_multiBody;
|
|
||||||
btAlignedObjectArray<btMultiBodyJointFeedback*> m_jointFeedbacks;
|
|
||||||
public:
|
public:
|
||||||
DeformableMultibody(struct GUIHelperInterface* helper)
|
DeformableMultibody(struct GUIHelperInterface* helper)
|
||||||
: CommonMultiBodyBase(helper)
|
: CommonMultiBodyBase(helper)
|
||||||
|
|||||||
@@ -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
|
// perform position correction for all constraints
|
||||||
BT_PROFILE("positionCorrection");
|
BT_PROFILE("positionCorrection");
|
||||||
@@ -140,7 +140,7 @@ void btDeformableRigidDynamicsWorld::positionCorrection(btScalar dt)
|
|||||||
{
|
{
|
||||||
c->m_node->m_v = va;
|
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");
|
BT_PROFILE("integrateTransforms");
|
||||||
m_deformableBodySolver->backupVelocity();
|
m_deformableBodySolver->backupVelocity();
|
||||||
positionCorrection(dt);
|
positionCorrection(timeStep);
|
||||||
btMultiBodyDynamicsWorld::integrateTransforms(dt);
|
btMultiBodyDynamicsWorld::integrateTransforms(timeStep);
|
||||||
for (int i = 0; i < m_softBodies.size(); ++i)
|
for (int i = 0; i < m_softBodies.size(); ++i)
|
||||||
{
|
{
|
||||||
btSoftBody* psb = m_softBodies[i];
|
btSoftBody* psb = m_softBodies[i];
|
||||||
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
||||||
{
|
{
|
||||||
btSoftBody::Node& node = psb->m_nodes[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();
|
m_deformableBodySolver->revertVelocity();
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ class btDeformableRigidDynamicsWorld : public btMultiBodyDynamicsWorld
|
|||||||
bool m_drawFaceTree;
|
bool m_drawFaceTree;
|
||||||
bool m_drawClusterTree;
|
bool m_drawClusterTree;
|
||||||
btSoftBodyWorldInfo m_sbi;
|
btSoftBodyWorldInfo m_sbi;
|
||||||
bool m_ownsSolver;
|
|
||||||
btScalar m_internalTime;
|
btScalar m_internalTime;
|
||||||
|
|
||||||
typedef void (*btSolverCallback)(btScalar time, btDeformableRigidDynamicsWorld* world);
|
typedef void (*btSolverCallback)(btScalar time, btDeformableRigidDynamicsWorld* world);
|
||||||
@@ -49,7 +48,7 @@ protected:
|
|||||||
|
|
||||||
virtual void integrateTransforms(btScalar timeStep);
|
virtual void integrateTransforms(btScalar timeStep);
|
||||||
|
|
||||||
void positionCorrection(btScalar dt);
|
void positionCorrection(btScalar timeStep);
|
||||||
|
|
||||||
void solveDeformableBodiesConstraints(btScalar timeStep);
|
void solveDeformableBodiesConstraints(btScalar timeStep);
|
||||||
|
|
||||||
|
|||||||
@@ -998,7 +998,7 @@ struct btSoftColliders
|
|||||||
if (!n.m_battach)
|
if (!n.m_battach)
|
||||||
{
|
{
|
||||||
// check for collision at x_{n+1}^*
|
// 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 ima = n.m_im;
|
||||||
const btScalar imb = m_rigidBody ? m_rigidBody->getInvMass() : 0.f;
|
const btScalar imb = m_rigidBody ? m_rigidBody->getInvMass() : 0.f;
|
||||||
@@ -1006,7 +1006,7 @@ struct btSoftColliders
|
|||||||
if (ms > 0)
|
if (ms > 0)
|
||||||
{
|
{
|
||||||
// resolve contact at x_n
|
// 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;
|
btSoftBody::sCti& cti = c.m_cti;
|
||||||
c.m_node = &n;
|
c.m_node = &n;
|
||||||
const btScalar fc = psb->m_cfg.kDF * m_colObj1Wrap->getCollisionObject()->getFriction();
|
const btScalar fc = psb->m_cfg.kDF * m_colObj1Wrap->getCollisionObject()->getFriction();
|
||||||
|
|||||||
Reference in New Issue
Block a user