Solve the contacts and constraints
| 319 | |
| 320 | // Solve the contacts and constraints |
| 321 | void PhysicsWorld::solveContactsAndConstraints(decimal timeStep) { |
| 322 | |
| 323 | RP3D_PROFILE("PhysicsWorld::solveContactsAndConstraints()", mProfiler); |
| 324 | |
| 325 | // ---------- Solve velocity constraints for joints and contacts ---------- // |
| 326 | |
| 327 | // Initialize the contact solver |
| 328 | mContactSolverSystem.init(mCollisionDetection.mCurrentContactManifolds, mCollisionDetection.mCurrentContactPoints, timeStep); |
| 329 | |
| 330 | // Initialize the constraint solver |
| 331 | mConstraintSolverSystem.initialize(timeStep); |
| 332 | |
| 333 | // For each iteration of the velocity solver |
| 334 | for (uint32 i=0; i<mNbVelocitySolverIterations; i++) { |
| 335 | |
| 336 | mConstraintSolverSystem.solveVelocityConstraints(); |
| 337 | |
| 338 | mContactSolverSystem.solve(); |
| 339 | } |
| 340 | |
| 341 | mContactSolverSystem.storeImpulses(); |
| 342 | |
| 343 | // Reset the contact solver |
| 344 | mContactSolverSystem.reset(); |
| 345 | } |
| 346 | |
| 347 | // Solve the position error correction of the constraints |
| 348 | void PhysicsWorld::solvePositionCorrection() { |
nothing calls this directly
no test coverage detected