- Timestamp:
- Oct 20, 2008, 5:40:38 PM (16 years ago)
- Location:
- code/branches/physics/src/bullet/BulletDynamics/ConstraintSolver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
r1963 r1972 45 45 46 46 int m_solverMode; 47 int m_restingContactRestitutionThreshold;48 47 49 48 … … 71 70 m_warmstartingFactor=btScalar(0.85); 72 71 m_solverMode = SOLVER_RANDMIZE_ORDER | SOLVER_CACHE_FRIENDLY | SOLVER_USE_WARMSTARTING; 73 m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution74 72 } 75 73 }; -
code/branches/physics/src/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
r1963 r1972 719 719 720 720 solverConstraint.m_friction = cp.m_combinedFriction; 721 722 723 if (cp.m_lifeTime>infoGlobal.m_restingContactRestitutionThreshold) 721 solverConstraint.m_restitution = restitutionCurve(rel_vel, cp.m_combinedRestitution); 722 if (solverConstraint.m_restitution <= btScalar(0.)) 724 723 { 725 724 solverConstraint.m_restitution = 0.f; 726 } else 727 { 728 solverConstraint.m_restitution = restitutionCurve(rel_vel, cp.m_combinedRestitution); 729 if (solverConstraint.m_restitution <= btScalar(0.)) 730 { 731 solverConstraint.m_restitution = 0.f; 732 }; 733 } 725 }; 734 726 735 727 … … 994 986 pt->m_appliedImpulse = solveManifold.m_appliedImpulse; 995 987 pt->m_appliedImpulseLateral1 = m_tmpSolverFrictionConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse; 996 pt->m_appliedImpulseLateral 2= m_tmpSolverFrictionConstraintPool[solveManifold.m_frictionIndex+1].m_appliedImpulse;988 pt->m_appliedImpulseLateral1 = m_tmpSolverFrictionConstraintPool[solveManifold.m_frictionIndex+1].m_appliedImpulse; 997 989 998 990 //do a callback here? … … 1229 1221 cpd->m_penetration = cp.getDistance();///btScalar(info.m_numIterations); 1230 1222 cpd->m_friction = cp.m_combinedFriction; 1231 if (cp.m_lifeTime>info.m_restingContactRestitutionThreshold) 1232 { 1233 cpd->m_restitution = 0.f; 1234 } else 1235 { 1236 cpd->m_restitution = restitutionCurve(rel_vel, combinedRestitution); 1237 if (cpd->m_restitution <= btScalar(0.)) 1238 { 1239 cpd->m_restitution = btScalar(0.0); 1240 }; 1241 } 1223 cpd->m_restitution = restitutionCurve(rel_vel, combinedRestitution); 1224 if (cpd->m_restitution <= btScalar(0.)) 1225 { 1226 cpd->m_restitution = btScalar(0.0); 1227 1228 }; 1242 1229 1243 1230 //restitution and penetration work in same direction so
Note: See TracChangeset
for help on using the changeset viewer.