Package com.jme3.scene.shape

Examples of com.jme3.scene.shape.Box


        // TODO Auto-generated catch block
        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);
        Entity e = placeObject(new Vector3f(257f,2.2f,0f), new Vector3f(389f,0f,0f));
        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(256f,2.2f,0f);
View Full Code Here


      cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
      flyCam.setMoveSpeed(50f);
     
      Box b = new Box(1f, 2f, 1f);
      Geometry g = new Geometry("RefBox", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        g.setMaterial(mat);
        g.setLocalTranslation(256f,2.2f,0f);
View Full Code Here

      if(s instanceof Geometry){
        Node a = s.getParent();
        if(a==null)return;
        BoundingVolume bound = ((Geometry) s).getModelBound();
        if(bound instanceof BoundingBox) {
        Box b = new Box(bound.getCenter(), ((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);
        }
View Full Code Here

      TestEndlessModelsOpt app = new TestEndlessModelsOpt();
        app.start();
    }
   
    private void addReferences(){
      Box b1 = new Box(new Vector3f(1f,0f,1f), .5f, .5f, .5f);
      Geometry g1 = new Geometry("1,0,0",b1);
      g1.setMaterial(matBones);
      rootNode.attachChild(g1);
     
      Box b2 = new Box(new Vector3f(1f,0f,0f), .5f, .5f, .5f);
      Geometry g2 = new Geometry("0,0,1",b2);
      g2.setMaterial(matWireframe);
      rootNode.attachChild(g2);
     
    }
View Full Code Here

        // TODO Auto-generated catch block
        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);
View Full Code Here

        e1.printStackTrace();
      }
     
      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
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

    root.attachChild(geom);
    }}
  }
 
  public static void debugShowBox(AssetManager assetMan, com.jme3.scene.Node root, Vector3f position, ColorRGBA color, float x, float y, float z) {
    Box b = new Box(position, x, y, z);
    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

    @Deprecated
    private Geometry createObject(String key, int x, int y) {
        Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        material.setColor("Color", ColorRGBA.Orange);

        Geometry geometry = new Geometry("x" + key, new Box(0.3f, 1, 0.3f));
        geometry.move(x, 1, y);
        geometry.setMaterial(material);
        return geometry;
    }
View Full Code Here

    }
   
    public static Spatial getPlaceholderModel(AssetManager assetManager){
        // What should be the size? Nobody knows
        // the user's expected scale...
        Box box = new Box(1, 1, 1);
        Geometry geom = new Geometry("placeholder", box);
        geom.setMaterial(getPlaceholderMaterial(assetManager));
        return geom;
    }
View Full Code Here

TOP

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

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.