Package com.jme3.scene.shape

Examples of com.jme3.scene.shape.Line


        app.start();
    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);
        geom.updateModelBound();

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        mat.setColor("m_Color", ColorRGBA.Blue);
View Full Code Here


            inputManager.getCursorPosition(), 0.0f);
        Vector3f direction = cam.getWorldCoordinates(
            inputManager.getCursorPosition(), 0.3f);
        direction.subtractLocal(origin).normalizeLocal();
       
        Line li = new Line(origin.clone(), origin.add(direction.mult(30f)));
//        li.setLineWidth(3f);
        Geometry g = new Geometry(null, li);
      g.setMaterial(matWireframe);
      bboxes.attachChild(g);
View Full Code Here

  }
 

  public Geometry getDebugBounds(float y){
    Collection<Geometry> geometries = new ArrayList<Geometry>();
    Line l = new Line(new Vector3f(top.EndPointA().x, y, top.EndPointA().y),
              new Vector3f(top.EndPointB().x, y, top.EndPointB().y));
    geometries.add(new Geometry("top", l));

   
    l = new Line(new Vector3f(right.EndPointA().x, y, right.EndPointA().y),
          new Vector3f(right.EndPointB().x, y, right.EndPointB().y));
    geometries.add(new Geometry("right", l));
   
    l = new Line(new Vector3f(bottom.EndPointA().x, y, bottom.EndPointA().y),
          new Vector3f(bottom.EndPointB().x, y, bottom.EndPointB().y));
    geometries.add(new Geometry("bottom", l));
   
    l = new Line(new Vector3f(left.EndPointA().x, y, left.EndPointA().y),
          new Vector3f(left.EndPointB().x, y, left.EndPointB().y));
    geometries.add(new Geometry("left", l));

    Mesh m = new Mesh();
    GeometryBatchFactory.mergeGeometries(geometries, m);
View Full Code Here

//    debugShowLine(p.m_WaypointList.get(p.m_WaypointList.size()-1).Position, p.EndPoint().Position, ColorRGBA.White);
  }
 
  private static void debugShowLine(AssetManager assetMan, com.jme3.scene.Node root, Vector3f start, Vector3f end,
      ColorRGBA color) {
    Line b = new Line(start.add(0f, 1f, 0f), end.add(0f,1f,0f));//, 0.1f, 0.4f, 0.1f);
    b.setLineWidth(2f);
    Geometry geom = new Geometry("Box", b);
    Material mat = new Material(assetMan, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", color);
    geom.setMaterial(mat);
    root.attachChild(geom);   
View Full Code Here

  private static Geometry getLine(Vector3f st, Vector3f en){
    return getLine(st, en, 3f);
  }
 
  private static Geometry getLine(Vector3f st, Vector3f en, float size){
    Line b = new Line(st, en);//, 0.1f, 0.4f, 0.1f);
    b.setLineWidth(size);
    return new Geometry("",b);
  }
View Full Code Here

        ControlledSpaceObject cso = new ControlledSpaceObject(so, fighter);
        cso.setDebugDisplay(name);
        cso.setGameThreadCallback(new SpatialUpdater(cso));

        Geometry gSphere = new Geometry("Sphere", new Sphere(10,10,0.25f));
        Geometry gDirection =  new Geometry("Direction-Line", new Line(new Vector3f(0,0,0), new Vector3f(0,0,2)));
       
        gSphere.setMaterial(main);
        gDirection.setMaterial(scnd);

        fighter.attachChild(gSphere);
View Full Code Here

    this.attachChild(createLineGeometry(createLine(start, end, isGlobal)));
    }
 
  protected Line createLine(Vector3f start, Vector3f end, boolean isGlobal)
    {
    Line l = new Line(isGlobal ? cam.getScreenCoordinates(start) : start, isGlobal ? cam.getScreenCoordinates(end) : end);
    l.setLineWidth(2);
   
    return l;
    }
View Full Code Here

        this.showSettings = showSettings;
    }
   
   
    public void createAxis(){
          Line x = new Line(Vector3f.ZERO, Vector3f.UNIT_X);
            Line y = new Line(Vector3f.ZERO, Vector3f.UNIT_Y);
            Line z = new Line(Vector3f.ZERO, Vector3f.UNIT_Z);

            x.setLineWidth(3f);
            y.setLineWidth(3f);
            z.setLineWidth(3f);

            Geometry xg = new Geometry("x axis", x);
            Geometry yg = new Geometry("y axis", y);
            Geometry zg = new Geometry("z axis", z);
View Full Code Here

    }

    public static Node createTriPolygon(ArrayList<Vector2f> vertices, Material mat) {
        if ((vertices.size() > 2) && ((vertices.size() % 3) == 0)) {
            Node node = new Node("triPolygon");
            Line line;
            Geometry g;

            System.out.println("tri count = " + (vertices.size() / 3));
            for (int i = 0; i < vertices.size(); i += 3) {
                v3f_0.set(vertices.get(i).x, vertices.get(i).y, 0);
                v3f_1.set(vertices.get(i + 1).x, vertices.get(i + 1).y, 0);
                v3f_2.set(vertices.get(i + 2).x, vertices.get(i + 2).y, 0);

                line = new Line(v3f_0, v3f_1);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);

                line = new Line(v3f_1, v3f_2);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);

                line = new Line(v3f_2, v3f_0);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);
            }
            return node;
View Full Code Here

    }

    public static Node createTriPolygon3d(ArrayList<Vector3f> vertices, Material mat) {
        if ((vertices.size() > 2) && ((vertices.size() % 3) == 0)) {
            Node node = new Node("triPolygon");
            Line line;
            Geometry g;

            System.out.println("tri count = " + (vertices.size() / 3));
            for (int i = 0; i < vertices.size(); i += 3) {
                v3f_0.set(vertices.get(i));
                v3f_1.set(vertices.get(i + 1));
                v3f_2.set(vertices.get(i + 2));

                line = new Line(v3f_0, v3f_1);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);

                line = new Line(v3f_1, v3f_2);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);

                line = new Line(v3f_2, v3f_0);
                g = new Geometry("", line);
                g.setMaterial(mat);
                node.attachChild(g);
            }
            return node;
View Full Code Here

TOP

Related Classes of com.jme3.scene.shape.Line

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.