Disable 'm_robotSim.setNumSimulationSubSteps' because it is not needed at the moment
Fix issue in contact/friction between btMultibody and btRigidBody (external force/torque of btRigidBody was not taken into account during contact/friction setup) Allow 0.1 mm slop in contact, to avoid loosing contact. Todo: allow contacts with positive distance in multibody solver.
This commit is contained in:
@@ -152,7 +152,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
m_robotSim.setGravity(b3MakeVector3(0,0,-10));
|
m_robotSim.setGravity(b3MakeVector3(0,0,-10));
|
||||||
m_robotSim.setNumSimulationSubSteps(4);
|
//m_robotSim.setNumSimulationSubSteps(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ PhysicsServerCommandProcessor::PhysicsServerCommandProcessor()
|
|||||||
m_data = new PhysicsServerCommandProcessorInternalData();
|
m_data = new PhysicsServerCommandProcessorInternalData();
|
||||||
|
|
||||||
createEmptyDynamicsWorld();
|
createEmptyDynamicsWorld();
|
||||||
|
m_data->m_dynamicsWorld->getSolverInfo().m_linearSlop = 0.0001;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -408,7 +408,9 @@ void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint(btMultiBodySol
|
|||||||
{
|
{
|
||||||
if (rb0)
|
if (rb0)
|
||||||
{
|
{
|
||||||
rel_vel += rb0->getVelocityInLocalPoint(rel_pos1).dot(solverConstraint.m_contactNormal1);
|
rel_vel += (rb0->getVelocityInLocalPoint(rel_pos1) +
|
||||||
|
(rb0->getTotalTorque()*rb0->getInvInertiaTensorWorld()*infoGlobal.m_timeStep).cross(rel_pos1)+
|
||||||
|
rb0->getTotalForce()*rb0->getInvMass()*infoGlobal.m_timeStep).dot(solverConstraint.m_contactNormal1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (multiBodyB)
|
if (multiBodyB)
|
||||||
@@ -422,7 +424,9 @@ void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint(btMultiBodySol
|
|||||||
{
|
{
|
||||||
if (rb1)
|
if (rb1)
|
||||||
{
|
{
|
||||||
rel_vel += rb1->getVelocityInLocalPoint(rel_pos2).dot(solverConstraint.m_contactNormal2);
|
rel_vel += (rb1->getVelocityInLocalPoint(rel_pos2)+
|
||||||
|
(rb1->getTotalTorque()*rb1->getInvInertiaTensorWorld()*infoGlobal.m_timeStep).cross(rel_pos2) +
|
||||||
|
rb1->getTotalForce()*rb1->getInvMass()*infoGlobal.m_timeStep).dot(solverConstraint.m_contactNormal2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user