3334353637383940414243
Solver.NCPConstraint c1 = new NCPConstraint(); Vector3 va =new Vector3(1,0,0); Vector3 vb =new Vector3(-1,0,0); Vector3 z = new Vector3(0,0,0); c1.assign(b1,b2, va,z,vb,z, va,z,vb,z, -Double.POSITIVE_INFINITY,Double.POSITIVE_INFINITY,null,1, 0); //This is the system
8081828384858687888990
Vector3 z = new Vector3(0,0,0); c1.assign(b1,b2, va,z,vb,z, va,z,vb,z, 0,0,null,1, 0); c2.assign(b1,b2, va,z,vb,z, va,z,vb,z, 0,0,null,1, 0);
172173174175176177178179180181182
//correction=correction>0?0:correction; // the normal constraint final NCPConstraint c = new NCPConstraint(); c.assign(b1,b2, nB1, nB2, nB3, nB4, nJ1, nJ2, nJ3, nJ4, lowerNormalLimit, Double.POSITIVE_INFINITY, null, -(unf-uni)-correction, -correction) ;
204205206207208209210211212213214
double ut1i = t2J1.dot(b1.state.velocity) + t2J2.dot(b1.state.omega) + t2J3.dot(b2.state.velocity) + t2J4.dot(b2.state.omega); //relativeVelocity(b1,b2,p,t2); double ut1f = 0; //double t2Fext = t2B1.dot(b1.state.FCm) + t2B2.dot(b1.state.tauCm) + t2B3.dot(b2.state.FCm) + t2B4.dot(b2.state.tauCm); final NCPConstraint c2 = new NCPConstraint(); c2.assign(b1,b2, t2B1, t2B2, t2B3, t2B4, t2J1, t2J2, t2J3, t2J4, -frictionBoundMagnitude, frictionBoundMagnitude, coupling, -(ut1f-ut1i),
227228229230231232233234235236237
double ut2i = t3J1.dot(b1.state.velocity) + t3J2.dot(b1.state.omega) + t3J3.dot(b2.state.velocity) + t3J4.dot(b2.state.omega); //relativeVelocity(b1,b2,p,t2); double ut2f = 0; final NCPConstraint c3 = new NCPConstraint(); c3.assign(b1,b2, t3B1, t3B2, t3B3, t3B4, t3J1, t3J2, t3J3, t3J4, -frictionBoundMagnitude, frictionBoundMagnitude, coupling, -(ut2f-ut2i), 0