Package jinngine.geometry.contact

Examples of jinngine.geometry.contact.ContactGeneratorClassifier


    // add the handler to the broad phase
    broadphase.addHandler(handler);
   
    // create some initial ContactGeneratorClassifiers
    // The Sphere - Sphere classifier
    geometryClassifiers.add(new ContactGeneratorClassifier() {
      @Override
      public final ContactGenerator getGenerator(Geometry a,
          Geometry b) {
        if ( a instanceof jinngine.geometry.Sphere && b instanceof jinngine.geometry.Sphere) {
          return new SphereContactGenerator((jinngine.geometry.Sphere)a, (jinngine.geometry.Sphere)b);
        }
        //not recognised
        return null
      }
    });
   
    // The Sphere - SupportMap classifier
    geometryClassifiers.add(new ContactGeneratorClassifier() {
      @Override
      public final ContactGenerator getGenerator(Geometry a,
          Geometry b) {
        if ( a instanceof jinngine.geometry.SupportMap3 && b instanceof jinngine.geometry.Sphere) {
          return new SupportMapSphereContactGenerator(a.getBody(), a, (jinngine.geometry.SupportMap3)a, b.getBody(), (jinngine.geometry.Sphere)b);
        }
        if ( a instanceof jinngine.geometry.Sphere && b instanceof jinngine.geometry.SupportMap3) {
          return new SupportMapSphereContactGenerator(a.getBody(), (jinngine.geometry.Sphere)a, b.getBody(), b, (jinngine.geometry.SupportMap3)b);
        }
        //not recognised
        return null
      }
    });
   
   
    // General convex support maps
    geometryClassifiers.add(new ContactGeneratorClassifier() {
      @Override
      public final ContactGenerator getGenerator(Geometry a,
          Geometry b) {
        if ( a instanceof SupportMap3 && b instanceof SupportMap3) {
          return new SupportMapContactGenerator((SupportMap3)a, a,  (SupportMap3)b, b);
View Full Code Here

TOP

Related Classes of jinngine.geometry.contact.ContactGeneratorClassifier

Copyright © 2018 www.massapicom. 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.