// Path: src/main/java/com/pesegato/collision/hitbox/HBCircle.java
// public class HBCircle extends DebuggableBody {
//     String name = "";
//     int radius;
//     public long id;
// 
//     public HBCircle(long id, int radius) {
//         this.id = id;
//         this.radius = radius;
//         addFixture(new BodyFixture(new Circle(radius)));
//     }
// 
//     public HBCircle(String name, long id, int radius) {
//         this.name = name;
//         this.id = id;
//         this.radius = radius;
//         addFixture(new BodyFixture(new Circle(radius)));
//     }
// 
//     public HBCircle(long id, Filter filter, int radius) {
//         this.id = id;
//         this.radius = radius;
//         BodyFixture bf=new BodyFixture(new Circle(radius));
//         bf.setFilter(filter);
//         addFixture(bf);
//     }
// 
//     @Deprecated
//     public Node getNode(AssetManager assetM, ColorRGBA color) {
//         Node n = new Node();
//         if (SHOW_HITBOX) {
//             n.attachChild(makeHitboxMarker(assetM, n, color));
//         }
//         return n;
//     }
// 
//     public Convex getConvex() {
//         return new Circle(radius);
//     }
// 
//     @Override
//     public Geometry makeHitboxMarker(AssetManager assetManager, Node n, ColorRGBA color) {
//         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//         ColorRGBA col = color.clone();
//         col.a = .5f;
//         mat.setColor("Color", col);
//         mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
//         Geometry geo = new Geometry(name, new Prism(radius , 5,12));
//         geo.setMaterial(mat);
//         geo.rotate(FastMath.PI/2,0,0);
//         return geo;
//     }
// }
// 
// Path: src/main/java/com/pesegato/collision/hitbox/HBRect.java
// public class HBRect extends DebuggableBody {
//     String name = "";
//     float w, h;
//     public long id;
// 
//     public HBRect(long id, float wP, float hP) {
//         this.id = id;
//         this.w = wP * SPRITE_SIZE;
//         this.h = hP * SPRITE_SIZE;
//         addFixture(new BodyFixture(new Rectangle(new Float(w), new Float(h))));
//     }
// 
//     public HBRect(String name, long id, float wP, float hP) {
//         this.name = name;
//         this.id = id;
//         this.w = wP * SPRITE_SIZE;
//         this.h = hP * SPRITE_SIZE;
//         addFixture(new BodyFixture(new Rectangle(new Float(w), new Float(h))));
//     }
// 
//     public HBRect(long id, Filter filter, int w, int h) {
//         this.id = id;
//         this.w = w;
//         this.h = h;
//         BodyFixture bf=new BodyFixture(new Rectangle(new Float(w), new Float(h)));
//         bf.setFilter(filter);
//         addFixture(bf);
//     }
// 
//     @Deprecated
//     public Node getNode(AssetManager assetM, ColorRGBA color) {
//         Node n = new Node();
//         if (SHOW_HITBOX) {
//             n.attachChild(makeHitboxMarker(assetM, n, color));
//         }
//         return n;
//     }
// 
//     public Convex getConvex() {
//         return new Rectangle(new Float(w), new Float(h));
//     }
// 
//     @Deprecated
//     public Dyn4JShapeControl getControl() {
//         return new Dyn4JShapeControl(getConvex(), MassType.INFINITE, this);
//     }
// 
//     @Override
//     public Geometry makeHitboxMarker(AssetManager assetManager, Node n, ColorRGBA color) {
//         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//         ColorRGBA col = color.clone();
//         col.a = .5f;
//         mat.setColor("Color", col);
//         mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
//         Geometry geo = new Geometry(name, new Quad(w, h));
//         geo.setMaterial(mat);
//         geo.setLocalTranslation(-w / 2, -h / 2, 0);
//         return geo;
//     }
// }


import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.pesegato.collision.hitbox.HBCircle;
import com.pesegato.collision.hitbox.HBRect;
import org.dyn4j.dynamics.Body;
import org.dyn4j.geometry.MassType;
import org.dyn4j.geometry.Vector2;
package com.pesegato.collision;


public class SampleD4J2 extends SimpleApplication {

    public static void main(String[] args) {
        SampleD4J2 app = new SampleD4J2();
        //app.setShowSettings(false);
        app.start(); // start the game
    }

    D4JSpace2 d4j;

    @Override
    public void simpleInitApp() {
        d4j = new D4JSpace2();
        stateManager.attachAll(d4j,
                new D4JSpaceDebugAppState(),
                new MainAppState());
    }

// Path: src/main/java/com/pesegato/collision/hitbox/HBCircle.java
// public class HBCircle extends DebuggableBody {
//     String name = "";
//     int radius;
//     public long id;
// 
//     public HBCircle(long id, int radius) {
//         this.id = id;
//         this.radius = radius;
//         addFixture(new BodyFixture(new Circle(radius)));
//     }
// 
//     public HBCircle(String name, long id, int radius) {
//         this.name = name;
//         this.id = id;
//         this.radius = radius;
//         addFixture(new BodyFixture(new Circle(radius)));
//     }
// 
//     public HBCircle(long id, Filter filter, int radius) {
//         this.id = id;
//         this.radius = radius;
//         BodyFixture bf=new BodyFixture(new Circle(radius));
//         bf.setFilter(filter);
//         addFixture(bf);
//     }
// 
//     @Deprecated
//     public Node getNode(AssetManager assetM, ColorRGBA color) {
//         Node n = new Node();
//         if (SHOW_HITBOX) {
//             n.attachChild(makeHitboxMarker(assetM, n, color));
//         }
//         return n;
//     }
// 
//     public Convex getConvex() {
//         return new Circle(radius);
//     }
// 
//     @Override
//     public Geometry makeHitboxMarker(AssetManager assetManager, Node n, ColorRGBA color) {
//         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//         ColorRGBA col = color.clone();
//         col.a = .5f;
//         mat.setColor("Color", col);
//         mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
//         Geometry geo = new Geometry(name, new Prism(radius , 5,12));
//         geo.setMaterial(mat);
//         geo.rotate(FastMath.PI/2,0,0);
//         return geo;
//     }
// }
// 
// Path: src/main/java/com/pesegato/collision/hitbox/HBRect.java
// public class HBRect extends DebuggableBody {
//     String name = "";
//     float w, h;
//     public long id;
// 
//     public HBRect(long id, float wP, float hP) {
//         this.id = id;
//         this.w = wP * SPRITE_SIZE;
//         this.h = hP * SPRITE_SIZE;
//         addFixture(new BodyFixture(new Rectangle(new Float(w), new Float(h))));
//     }
// 
//     public HBRect(String name, long id, float wP, float hP) {
//         this.name = name;
//         this.id = id;
//         this.w = wP * SPRITE_SIZE;
//         this.h = hP * SPRITE_SIZE;
//         addFixture(new BodyFixture(new Rectangle(new Float(w), new Float(h))));
//     }
// 
//     public HBRect(long id, Filter filter, int w, int h) {
//         this.id = id;
//         this.w = w;
//         this.h = h;
//         BodyFixture bf=new BodyFixture(new Rectangle(new Float(w), new Float(h)));
//         bf.setFilter(filter);
//         addFixture(bf);
//     }
// 
//     @Deprecated
//     public Node getNode(AssetManager assetM, ColorRGBA color) {
//         Node n = new Node();
//         if (SHOW_HITBOX) {
//             n.attachChild(makeHitboxMarker(assetM, n, color));
//         }
//         return n;
//     }
// 
//     public Convex getConvex() {
//         return new Rectangle(new Float(w), new Float(h));
//     }
// 
//     @Deprecated
//     public Dyn4JShapeControl getControl() {
//         return new Dyn4JShapeControl(getConvex(), MassType.INFINITE, this);
//     }
// 
//     @Override
//     public Geometry makeHitboxMarker(AssetManager assetManager, Node n, ColorRGBA color) {
//         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//         ColorRGBA col = color.clone();
//         col.a = .5f;
//         mat.setColor("Color", col);
//         mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
//         Geometry geo = new Geometry(name, new Quad(w, h));
//         geo.setMaterial(mat);
//         geo.setLocalTranslation(-w / 2, -h / 2, 0);
//         return geo;
//     }
// }


// Path: src/main/java/com/pesegato/collision/SampleD4J2.java
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.pesegato.collision.hitbox.HBCircle;
import com.pesegato.collision.hitbox.HBRect;
import org.dyn4j.dynamics.Body;
import org.dyn4j.geometry.MassType;
import org.dyn4j.geometry.Vector2;

package com.pesegato.collision;


public class SampleD4J2 extends SimpleApplication {

    public static void main(String[] args) {
        SampleD4J2 app = new SampleD4J2();
        //app.setShowSettings(false);
        app.start(); // start the game
    }

    D4JSpace2 d4j;

    @Override
    public void simpleInitApp() {
        d4j = new D4JSpace2();
        stateManager.attachAll(d4j,
                new D4JSpaceDebugAppState(),
                new MainAppState());
    }

    HBRect hbRect;