Package jinngine.physics.solver

Examples of jinngine.physics.solver.ConjugateGradients.solve()


    List<Body> bodies = new ArrayList<Body>();
    List<NCPConstraint> constraints = new ArrayList<NCPConstraint>();
    bodies.add(b1); bodies.add(b2); constraints.add(c1);

    //run the solver
    s.solve(constraints, bodies, 0.0);
   
    System.out.println("cg test="+c1.lambda);
   
    //expect solution 1/2
    assertTrue( Math.abs(-0.5 - c1.lambda) < epsilon )
View Full Code Here


    List<Body> bodies = new ArrayList<Body>();
    List<NCPConstraint> constraints = new ArrayList<NCPConstraint>();
    bodies.add(b1); bodies.add(b2); constraints.add(c1); constraints.add(c2);

    //run the solver
    s.solve(constraints, bodies, 0.0);
   
    System.out.println("("+c1.lambda+","+c2.lambda+")");
   
    //expect solution (1/4,1/4)
    assertTrue( Math.abs(-0.25 - c1.lambda) < epsilon )
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.