Package jinngine.collision

Examples of jinngine.collision.GJK.run()


   
    //closest point vectors
    Vector3 p1 = new Vector3();
    Vector3 p2 = new Vector3();
       
    gjk.run(s1,s2,p1,p2,Double.POSITIVE_INFINITY, epsilon, 31);
   
    double d = p1.sub(p2).norm();
   
    System.out.println( "d="+d);
   
View Full Code Here


   
    //closest point vectors
    Vector3 p1 = new Vector3();
    Vector3 p2 = new Vector3();
       
    gjk.run(s1,s2,p1,p2,Double.POSITIVE_INFINITY, epsilon, 31);
   
    double d = p1.sub(p2).norm();
    System.out.println("d="+d);
   
    // distance should be 2a within precision
View Full Code Here

   
    //closest point vectors
    Vector3 p1 = new Vector3();
    Vector3 p2 = new Vector3();
       
    gjk.run(s1,s2,p1,p2,Double.POSITIVE_INFINITY, epsilon, 31);
   
    // we expect closest points to be the same
    assertTrue( p1.sub(p2).norm() < epsilon );
  }
 
View Full Code Here

      GJK gjk = new GJK();
     
      // when the distance between objects becomes close to zero,
      // the gjk algorithm gegenerates and produces less acurate results.
      // therefore we use more iterations here
      gjk.run(s1,s2,p1,p2,Double.POSITIVE_INFINITY, epsilon, 2256);
     
      // we want the expected distance
      assertTrue( Math.abs( p1.sub(p2).norm() - expected ) < 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.