Package com.jme3.scene

Examples of com.jme3.scene.Node.attachChild()


            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


      // Assets..
      t.reset();
      Spatial model = assetMan.loadModel(from.getAbsolutePath());
      Node n = new Node("dummy");
      if(!(model instanceof Node))
        n.attachChild(model);
      time = t.getTimeInSeconds();
//      System.out.println("File " + from.getAbsolutePath() + " loaded in "
//          + time + " seconds");

      // jme fucked up the model names, and ignores any object name
View Full Code Here

      if(troll != null){
        n.detachChild(troll);
        VisibleModel newtroll = new VisibleModel(null);
        newtroll.attachVisuals();
        newtroll.setLocalTranslation(troll.getLocalTranslation());
        n.attachChild(newtroll);
      }
      //this is needed as the chars are on a different node and would not be rendered
      //just add, do not remove here..
      for(Light l : n.getLocalLightList()){
          Singleton.get().getSceneManager().changeRootLight(l, Action.ADD);
View Full Code Here

                minIntensity, terrainWidth, channelId)) {
              // this will be in world coords, but we want it to
              // be in local
              candidateGrassPatchLocation.subtractLocal(terrain
                  .getWorldTranslation());
              grassLayer.attachChild(createGrassPatch(
                  candidateGrassPatchLocation, faceMat,
                  patchScaleVariation, patchWidth,
                  patchHeight, rand.nextFloat()));
            }
          }
View Full Code Here

        + (1 / patchScaleVariation);
    Quad faceShape = new Quad((patchWidth * selectedSizeVariation),
        patchHeight * selectedSizeVariation, false);
    Geometry face1 = new Geometry("face1", faceShape);
    face1.move(-(patchWidth * selectedSizeVariation) / 2, 0, 0);
    grassPatch.attachChild(face1);

    Geometry face2 = new Geometry("face2", faceShape);
    face2.rotate(new Quaternion().fromAngleAxis(-FastMath.PI / 2,
        new Vector3f(0, 1, 0)));
    face2.move(0, 0, -(patchWidth * selectedSizeVariation) / 2);
View Full Code Here

    Geometry face2 = new Geometry("face2", faceShape);
    face2.rotate(new Quaternion().fromAngleAxis(-FastMath.PI / 2,
        new Vector3f(0, 1, 0)));
    face2.move(0, 0, -(patchWidth * selectedSizeVariation) / 2);
    grassPatch.attachChild(face2);

    grassPatch.setCullHint(Spatial.CullHint.Dynamic);
    grassPatch.setQueueBucket(RenderQueue.Bucket.Transparent);

    face1.setMaterial(faceMat);
View Full Code Here

          else {
            node.setLocalTranslation(0f, 2.5f+0.5f, 0f);
            logger.finest("Message by Code "+msg+" @ "+node.getLocalTranslation());
          }
        }
        node.attachChild(txt);
    Singleton.get().getSceneManager().changeAnyNode(this, node, Action.ADD);
  }
 
  public void addSelectionMarker(ColorRGBA color){
//    if(selection != null){
View Full Code Here

        mat.setColor("Color", ColorRGBA.White);
      frame.setMaterial(mat);
      frame.setQueueBucket(Bucket.Transparent);
      frame.setShadowMode(ShadowMode.Off);
    frame.setLocalTranslation(-0.5f, 0.11f, 0f);
      n.attachChild(frame);
     
    Geometry bar = new Geometry("health_bar", new Quad(1f, 0.1f));
      mat = new Material(am, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        bar.setMaterial(mat);
View Full Code Here

        mat.setColor("Color", ColorRGBA.Red);
        bar.setMaterial(mat);
      bar.setQueueBucket(Bucket.Transparent);
        bar.setShadowMode(ShadowMode.Off);
        bar.setLocalTranslation(-0.5f, 0f, 0f);
      n.attachChild(bar);
        if(vis.getWorldBound() instanceof BoundingBox){
          BoundingBox bbox = (BoundingBox)vis.getWorldBound();
          n.setLocalTranslation(0f, bbox.getYExtent()+0.6f, 0f);
          logger.finest("Healthbar by BBox @ "+n.getLocalTranslation());
        }
View Full Code Here

                for (int i = 0; i < jsa.length(); i++) {
                    JSONObject someObject = jsa.getJSONObject(i);
                    if (!model.objects.containsKey(someObject.getInt("id"))) {
                        // new node with geometry
                        Node objectNode = new Node("id" + someObject.getInt("id"));
                        objectNode.attachChild(createObject(key, x, y));
                        model.objects.put(someObject.getInt("id"), objectNode);
                        model.worldNode.attachChild(objectNode);
                    }
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.