Package com.jme3.scene

Examples of com.jme3.scene.Geometry


        e1.printStackTrace();
      }
     
     
      Box b = new Box(.5f,1f,.5f);
      Geometry walker = new Geometry("wakler", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        walker.setMaterial(mat);
//        269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
        Entity e = placeObject(new Vector3f(270f,-280f,90f), new Vector3f(375f,-170f,455f));
        if(e != null){
          e.attachChild(walker);
          rootNode.attachChild(e);
          this.walker = e;
        }

     
      Box b2 = new Box(.6f, .3f, .6f);
      Geometry g2 = new Geometry("tgt", b2);
      Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setColor("Color", ColorRGBA.Green);
        g2.setMaterial(mat2);
        Vector3f p = new Vector3f(375f,-170f,455f);
        enm.snapToGround(p);
        g2.setLocalTranslation(p);
      rootNode.attachChild(g2);
    }
View Full Code Here


      }
     
      System.out.println("EntityNavManager finished");
     
      Box b2 = new Box(.3f, 1.3f, .3f);
      Geometry g2 = new Geometry("tgt", b2);
      Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setColor("Color", ColorRGBA.Green);
        g2.setMaterial(mat2);
        Vector3f p = new Vector3f(-9979.581f, 28.097652f, 8380.083f);
        enm.snapToGround(p);
        g2.setLocalTranslation(p);
      rootNode.attachChild(g2);
      System.out.println("Target placed at:"+p);
     
     
      Box b = new Box(.5f,1f,.5f);
      Geometry walker = new Geometry("wakler", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        walker.setMaterial(mat);
//        269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
        //Entity e = placeObject(new Vector3f(-9969.057f, 15.097652f, 8429.296f), new Vector3f(-9979.581f, 28.097652f, 8420.083f));
        Entity e = placeObject(new Vector3f(-9890.341f, 14.610833f, 8302.891f), p.clone());
        if(e != null){
          e.attachChild(walker);
View Full Code Here

        Node a = s.getParent();
        if(a==null)return;
        BoundingVolume bound = ((Geometry) s).getModelBound();
        if(bound instanceof BoundingBox) {
          WireBox b = new WireBox(((BoundingBox) bound).getXExtent(), ((BoundingBox) bound).getYExtent(), ((BoundingBox) bound).getZExtent());
          Geometry g = new Geometry(null, b);
          g.setLocalTransform(s.getWorldTransform());
          g.setMaterial(matWireframe);
          bboxes.attachChild(g);
        }
      }
      if(s instanceof Node) {
        addBBoxes((Node) s);
View Full Code Here

  }
 
  private void addNavs(Node n) {
    TiledNavMesh[] array = Singleton.get().getNavManager().getNavMeshes();
    for(TiledNavMesh t : array){
      Geometry g = t.getDebugMesh();
      g.setMaterial(matWireframe);
      navs.attachChild(g);
//      NavTestHelper.debugShowMesh(assetManager, navs,t);
      NavTestHelper.debugShowCost(assetManager, navs, t, ColorRGBA.White);
    }
  }
View Full Code Here

        }
    m.setBuffer(Type.Position, 3, vb);
    m.setBuffer(Type.Index, 3, ib);
    m.updateBound();
   
    Geometry g = new Geometry("Debug_NavMesh_"+this.toString(),m);
    g.updateModelBound();
    return g;
  }
View Full Code Here

        }
    m.setBuffer(Type.Position, 3, vb);
    m.setBuffer(Type.Index, 3, ib);
    m.updateBound();
   
    Geometry g = new Geometry("Debug_NavBorderMesh_"+this.toString(),m);
    g.updateModelBound();
    return 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);
    Geometry g = new Geometry("bounds of "+toString(), m);
    g.updateModelBound();
    return g;

  }
View Full Code Here

        Node a = s.getParent();
        if(a==null)return;
        BoundingVolume bound = ((Geometry) s).getModelBound();
        if(bound instanceof BoundingBox) {
        WireBox b = new WireBox(((BoundingBox) bound).getXExtent(), ((BoundingBox) bound).getYExtent(), ((BoundingBox) bound).getZExtent());
        Geometry g = new Geometry(null, b);
        g.setLocalTransform(s.getWorldTransform());
        g.setMaterial(matWireframe);
        bboxes.attachChild(g);
        }
      }
      if(s instanceof Node) {
        addBBoxes((Node) s);
View Full Code Here

        navs.detachChildNamed("NavMeshes");
      } else {
        Node node = new Node("NavMeshes");
        TiledNavMesh[] array = Singleton.get().getNavManager().getNavMeshes();
        for(TiledNavMesh t : array){
          Geometry g = t.getDebugMesh();
          g.setMaterial(matWireframe);
          node.attachChild(g);
        }
        navs.attachChild(node);   
      }
    }
View Full Code Here

    }


   
    private void dropBox() {
      Geometry g = new Geometry("Box",new Box());
      g.setMaterial(matWireframe);
      Vector3f pos = cam.getLocation().clone();
      singles.getNavManager().snapToGround(pos);
      singles.getSceneManager().changeAnyNode(rootNode, g, Action.ADD);
     
  }
View Full Code Here

TOP

Related Classes of com.jme3.scene.Geometry

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.