Package org.jbox2d.collision

Examples of org.jbox2d.collision.PolygonDef


  }

  static ShapeDef translateShape(Shape shape, double elasticity) {
    if (shape instanceof Polygon) {
      Polygon poly = (Polygon) shape;
      PolygonDef def = new PolygonDef();
      // TODO Set def.density for realistic mass;
      def.restitution = (float) elasticity;
      for (int i = 0; i < poly.npoints; i++) {
        def.vertices.add(new Vec2(poly.xpoints[i], poly.ypoints[i]));
      }
View Full Code Here

TOP

Related Classes of org.jbox2d.collision.PolygonDef

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.