Package com.jme3.scene

Examples of com.jme3.scene.Node


    private CharacterControl player;
    private GhostControl control;

    public MainCharacter() {
        super();
        spatial = new Node("mainCharacter");
        spatial.setUserData("entity", this);
    }
View Full Code Here


        myApp.getBulletAppState().getPhysicsSpace().addAll(island);

        island.getChild("SpawningPoints").setCullHint(Spatial.CullHint.Always);

        //Spawning enemies
        Node level2enemie = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("2")).getChild("Enemy");
        Node level3enemie = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("3")).getChild("Enemy");
        Node level4enemie = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("4")).getChild("Enemy");

        //Blobs
        for (Spatial point : level2enemie.getChildren()) {
            addEnemy((Enemy) Entity.ENEMY_BLOB.createEntity(), 2f, point.getWorldTranslation().add(0f, -15.4556f, 0f));
        }
        //Armadilos
        for (Spatial point : level3enemie.getChildren()) {
            addEnemy((Enemy) Entity.ENEMY_ARMADILO.createEntity(), 4f, point.getWorldTranslation().add(0f, -15.4556f, 0f));
        }
        //Elephants
        for (Spatial point : level4enemie.getChildren()) {
            addEnemy((Enemy) Entity.ENEMY_ELEPHANT.createEntity(), 6f, point.getWorldTranslation().add(0f, -15.4556f, 0f));
        }

        cc = new GameStartCinematic(myApp);
        cc.attach();
View Full Code Here

        enemy.getSpatial().setLocalTranslation(wa.getRandomPointInside(spawn.getY()));
        rootNode.attachChild(enemy.getSpatial());
    }

    public void initialiseEachLevel() {
        Node level1Food = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("1")).getChild("Food");
        //Node level2Food = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("2")).getChild("Food");
        //Node level3Food = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("3")).getChild("Food");
        //Node level4Food = (Node) ((Node) ((Node) island.getChild("SpawningPoints")).getChild("4")).getChild("Food");

        Node[] foodSpawnLocations = new Node[]{level1Food}; //level2Food, level3Food, level4Food};
View Full Code Here


  private void addBBoxes(Node n) {
    for(Spatial s : n.getChildren()){
      if(s instanceof Geometry){
        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);
View Full Code Here

    
    private void toggelNavMeshes(){
      if(navs.getChild("NavMeshes") != null){
        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 toggelNavBorderMeshes() {
      if(navs.getChild("NavBorderMeshes") != null){
        navs.detachChildNamed("NavBorderMeshes");
      } else {
        Node node = new Node("NavBorderMeshes");
        Material mat = matWireframe.clone();
            mat.setColor("Color", ColorRGBA.Blue);
        TiledNavMesh[] array = Singleton.get().getNavManager().getNavMeshes();
        for(TiledNavMesh t : array){
          Geometry g = t.getDebugBorderMesh();
          g.setMaterial(mat);
          node.attachChild(g);
        }
        navs.attachChild(node);
      }
    }
View Full Code Here

      //Node n = Assembler2.getModel3("dwarfwarrior"); //"pelffwarrior");//humanhalberd"); //goblin");
      m.attachVisuals();
//      if(n != null){ 
        ent = em.createEntity(_1000);
       
        Node nn = new Node("intermed");
        nn.attachChild(m);
        ent.attachChild(nn);
       
        rootNode.attachChild(ent);
        VisualComponent vis = new VisualComponent();
        EnvironmentComponent env = new EnvironmentComponent();
View Full Code Here

      if(currentNode<0)
        currentNode = 0;
      if(currentNode >= MAX_NODES){
        currentNode = 0;
      }
      Node n = nodes[currentNode];
      if(n!= null){
        rootNode.detachChild(n);
        n = null;
      }
     
//      if(currentNode%2!=0){
        n = Assembler2.getModel3("ElfWizardM"); //goblin");
//      } else{
//        VisibleModel v = new VisibleModel(new NewCharSummary());
//        v.attachVisuals();
//        n = v;
//      }
     
      if(n != null){
        nodes[currentNode] = n;
        currentNode++;
        int x = currentNode;
        int y = 2+((currentNode%2)*-1);//*currentNode;
        System.out.println("New Model at:"+x+","+y);
        n.setLocalTranslation(x, y, 0.0f);
 
        rootNode.attachChild(n);
//        n.updateGeometricState();
      }
    }
View Full Code Here

        currentNode = 0;
     
      if(currentNode >= MAX_NODES)
        currentNode = MAX_NODES-1;
     
      Node n = nodes[currentNode];
     
      if(n != null){
        rootNode.detachChild(n);
        n = null;
        currentNode--;
View Full Code Here

      if(currentNode<0)
        currentNode = 0;
      if(currentNode >= MAX_NODES){
        currentNode = 0;
      }
      Node n = nodes[currentNode];
      if(n!= null){
        rootNode.detachChild(n);
        n = null;
      }
     

      n = Assembler2.getModel3(templates[template_index]);
     
      if(n != null){
        nodes[currentNode] = n;
        currentNode++;
        int x = currentNode;
        int y = 2+((currentNode%2)*-1);//*currentNode;
        System.out.println("New Model at:"+x+","+y);
        n.setLocalTranslation(x, 0.0f, y);
 
        rootNode.attachChild(n);
//        n.updateGeometricState();
      }
    }
View Full Code Here

TOP

Related Classes of com.jme3.scene.Node

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.