Store the computed impulses to use them to warm start the solver at the next iteration
| 761 | // Store the computed impulses to use them to |
| 762 | // warm start the solver at the next iteration |
| 763 | void ContactSolverSystem::storeImpulses() { |
| 764 | |
| 765 | RP3D_PROFILE("ContactSolver::storeImpulses()", mProfiler); |
| 766 | |
| 767 | uint32 contactPointIndex = 0; |
| 768 | |
| 769 | // For each contact manifold |
| 770 | for (uint32 c=0; c<mNbContactManifolds; c++) { |
| 771 | |
| 772 | for (short int i=0; i<mContactConstraints[c].nbContacts; i++) { |
| 773 | |
| 774 | mContactPoints[contactPointIndex].externalContact->setPenetrationImpulse(mContactPoints[contactPointIndex].penetrationImpulse); |
| 775 | |
| 776 | contactPointIndex++; |
| 777 | } |
| 778 | |
| 779 | mContactConstraints[c].externalContactManifold->frictionImpulse1 = mContactConstraints[c].friction1Impulse; |
| 780 | mContactConstraints[c].externalContactManifold->frictionImpulse2 = mContactConstraints[c].friction2Impulse; |
| 781 | mContactConstraints[c].externalContactManifold->frictionTwistImpulse = mContactConstraints[c].frictionTwistImpulse; |
| 782 | mContactConstraints[c].externalContactManifold->frictionVector1 = mContactConstraints[c].frictionVector1; |
| 783 | mContactConstraints[c].externalContactManifold->frictionVector2 = mContactConstraints[c].frictionVector2; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | // Compute the two unit orthogonal vectors "t1" and "t2" that span the tangential friction plane |
| 788 | // for a contact manifold. The two vectors have to be such that : t1 x t2 = contactNormal. |
no test coverage detected