Add the option for the btSimulationIslandManager to avoid splitting islands (for constraint solving)
Move the convertContact inside constraint solver to its own method
This commit is contained in:
@@ -1238,7 +1238,7 @@ void processSolverTask(void* userPtr, void* lsMemory)
|
||||
vel = vel1 - vel2;
|
||||
rel_vel = cp.m_normalWorldOnB.dot(vel);
|
||||
|
||||
constraint.m_penetration = cp.getDistance();///btScalar(infoGlobal.m_numIterations);
|
||||
btScalar penetration = cp.getDistance();///btScalar(infoGlobal.m_numIterations);
|
||||
constraint.m_friction = cp.m_combinedFriction;
|
||||
float rest = - rel_vel * cp.m_combinedRestitution;
|
||||
if (rest <= btScalar(0.))
|
||||
@@ -1251,7 +1251,7 @@ void processSolverTask(void* userPtr, void* lsMemory)
|
||||
btScalar erp = taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_erp;
|
||||
btScalar timeStep = taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_timeStep;
|
||||
|
||||
constraint.m_restitution = rest;
|
||||
btScalar restitution = rest;
|
||||
constraint.m_appliedImpulse = cp.m_appliedImpulse*taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_warmstartingFactor;
|
||||
if (constraint.m_appliedImpulse!= 0.f)
|
||||
{
|
||||
@@ -1271,8 +1271,8 @@ void processSolverTask(void* userPtr, void* lsMemory)
|
||||
rel_vel = vel1Dotn-vel2Dotn;
|
||||
|
||||
btScalar positionalError = 0.f;
|
||||
positionalError = -constraint.m_penetration * erp/timeStep;
|
||||
btScalar velocityError = constraint.m_restitution - rel_vel;// * damping;
|
||||
positionalError = -penetration * erp/timeStep;
|
||||
btScalar velocityError = restitution - rel_vel;// * damping;
|
||||
btScalar penetrationImpulse = positionalError*constraint.m_jacDiagABInv;
|
||||
btScalar velocityImpulse = velocityError *constraint.m_jacDiagABInv;
|
||||
constraint.m_rhs = penetrationImpulse+velocityImpulse;
|
||||
@@ -1339,9 +1339,9 @@ void processSolverTask(void* userPtr, void* lsMemory)
|
||||
|
||||
btScalar positionalError = 0.f;
|
||||
positionalError = 0;
|
||||
constraint.m_restitution=0.f;
|
||||
btScalar restitution=0.f;
|
||||
|
||||
btSimdScalar velocityError = constraint.m_restitution - rel_vel;
|
||||
btSimdScalar velocityError = restitution - rel_vel;
|
||||
btSimdScalar velocityImpulse = velocityError * btSimdScalar(constraint.m_jacDiagABInv);
|
||||
constraint.m_rhs = velocityImpulse;
|
||||
constraint.m_cfm = 0.f;
|
||||
@@ -1386,9 +1386,9 @@ void processSolverTask(void* userPtr, void* lsMemory)
|
||||
|
||||
btScalar positionalError = 0.f;
|
||||
positionalError = 0;
|
||||
constraint.m_restitution=0.f;
|
||||
btScalar restitution=0.f;
|
||||
|
||||
btSimdScalar velocityError = constraint.m_restitution - rel_vel;
|
||||
btSimdScalar velocityError = restitution - rel_vel;
|
||||
btSimdScalar velocityImpulse = velocityError * btSimdScalar(constraint.m_jacDiagABInv);
|
||||
constraint.m_rhs = velocityImpulse;
|
||||
constraint.m_cfm = 0.f;
|
||||
|
||||
Reference in New Issue
Block a user