Package com.jme3.math

Examples of com.jme3.math.Vector3f


      man.loadParts("megaset.csv");
      templates = man.getTemplates();

        DirectionalLight dr = new DirectionalLight();
        dr.setColor(ColorRGBA.White);
        dr.setDirection(new Vector3f(1, 0 , 1));
       
        AmbientLight am = new AmbientLight();
        am.setColor(ColorRGBA.White);
        rootNode.addLight(am);
        rootNode.addLight(dr);
View Full Code Here


    public void simpleInitApp() {
      man.loadParts("dwarf.csv");

        DirectionalLight dr = new DirectionalLight();
        dr.setColor(ColorRGBA.White);
        dr.setDirection(new Vector3f(1, 0 , 1));
       
        AmbientLight am = new AmbientLight();
        am.setColor(ColorRGBA.White);
        rootNode.addLight(am);
        rootNode.addLight(dr);
View Full Code Here

      man.loadParts("megaset.csv");
      templates = man.getTemplates();

        DirectionalLight dr = new DirectionalLight();
        dr.setColor(ColorRGBA.White);
        dr.setDirection(new Vector3f(1, 0 , 1));
       
        AmbientLight am = new AmbientLight();
        am.setColor(ColorRGBA.White);
        rootNode.addLight(am);
        rootNode.addLight(dr);
View Full Code Here

    }
    @Override
    public void update() {
      if(renderDebug && bboxes.getChildren().size()<=0){
        Vector3f origin = cam.getWorldCoordinates(
            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

      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

    }

    @Override
    public void simpleInitApp() {
      sin.init(TileTerrainManager.get());
      cam.setLocation(new Vector3f(390f,10f,10f));
      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
      cam.lookAt(new Vector3f(256f,-50,0), Vector3f.UNIT_Y);
      flyCam.setMoveSpeed(50f);
     
    assetManager = sin.getAssetManager().getJmeAssetMan();
      enm = sin.getNavManager();
      enm.USE_OPTIMZED_PATH = true;
      em = sin.getEntityManager();
      tm = (TileTerrainManager) sin.getTerrainManager();
      tm.setLoadedAtOrigin(false);//models already at world coords (nav & environment)
      sm = sin.getSceneManager();
      js = sin.getJmeSystem();
      ps = sin.getPosSystem();
    tm.update(cam.getLocation());
      rootNode.attachChild(debugNodes);

        DirectionalLight light = new DirectionalLight();
        light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
        rootNode.addLight(light);

        AmbientLight ambLight = new AmbientLight();
        ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f));
        rootNode.addLight(ambLight);
     

     
      rootNode.attachChild(scene);
      sm.setRoot(scene);

      while(enm.getMeshCount()<9)
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e1) {
        // 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);
        enm.snapToGround(p);
        g2.setLocalTranslation(p);
      rootNode.attachChild(g2);
    }
View Full Code Here

        inputManager.setCursorVisible(true);
        flyCam.setEnabled(false);
       
        DirectionalLight dr = new DirectionalLight();
        dr.setColor(ColorRGBA.White);
        dr.setDirection(new Vector3f(1, 0 , 1));
       
        AmbientLight am = new AmbientLight();
        am.setColor(ColorRGBA.White);
        rootNode.addLight(am);
        rootNode.addLight(dr);
View Full Code Here

//          rootNode.attachChild(debug);
}

        dl = new DirectionalLight();
        dl.setColor(ColorRGBA.White);
        dl.setDirection((new Vector3f(0f, -1f, 0f)).normalizeLocal());
        rootNode.addLight(dl);

//
        AmbientLight ambLight = new AmbientLight();
        ambLight.setColor(ColorRGBA.Gray);
        rootNode.addLight(ambLight);
   
       


//        cam.setLocation(new Vector3f(0, 10, -10));
//        cam.lookAtDirection(new Vector3f(0, -1.5f, -1).normalizeLocal(), Vector3f.UNIT_Y);
        cam.setLocation(new Vector3f(0, 300, 0));
        cam.lookAtDirection(new Vector3f(0, -1f, 0), Vector3f.UNIT_Y);
    }
View Full Code Here

    @Override
    public void simpleInitApp() {

      sin.init(TileTerrainManager.get());
      cam.setLocation(new Vector3f(-9980f,50f,8450f));
      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
      cam.lookAt(new Vector3f(-9980f,-50f,8450), Vector3f.UNIT_Y);
      flyCam.setMoveSpeed(50f);
     
    assetManager = sin.getAssetManager().getJmeAssetMan();
      enm = sin.getNavManager();
      enm.USE_OPTIMZED_PATH = true;
      em = sin.getEntityManager();
      tm = (TileTerrainManager) sin.getTerrainManager();
      tm.setLoadedAtOrigin(true);//models not at world coords (all models != nav)
      sm = sin.getSceneManager();
      js = JmeUpdateSystem.get();
      ps = sin.getPosSystem();
    tm.update(cam.getLocation());
      rootNode.attachChild(debugNodes);
        rootNode.attachChild(bboxes);
        rootNode.attachChild(navs);

        DirectionalLight light = new DirectionalLight();
        light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
        rootNode.addLight(light);

        AmbientLight ambLight = new AmbientLight();
        ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f));
        rootNode.addLight(ambLight);
     

     
      rootNode.attachChild(scene);
      sm.setRoot(scene);

//      while(enm.getMeshCount()<4)
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e1) {
        // TODO Auto-generated catch block
        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
        //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);
          rootNode.attachChild(e);
          this.walker = e;
        }
View Full Code Here

              String[] splits = file.getParentFile().getName().split("_");
              if(splits.length == 2){
                xTile = Integer.parseInt(splits[0]);
                zTile = Integer.parseInt(splits[1]);
                //nm.setPosition(new Vector3f(Tile.getWorldPositionOfXTile(x), 0f,Tile.getWorldPositionOfZTile(z)));
                nm.setPosition(new Vector3f((xTile-160)<<8, 0f, (zTile-144)<<8));
                navMan.addMesh(nm);
//                log.info(navMan.toString());
              }
            }
          } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.jme3.math.Vector3f

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.