Package com.jme3.scene

Examples of com.jme3.scene.Node



  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


  protected Node createVisuals() {

    if (charSelection != null) {
 
     
      Node n = null;
      String gamemodel = Singleton.get().getDataManager().getNpcGameModel(charSelection.templateId);
      if(gamemodel != null && gamemodel.length() > 0)
        n = Assembler2.getModel4(gamemodel, true, true);
      else {
        logger.warning("No game model found in npc table for entity:"+charSelection.templateId+" name:"+Singleton.get().getDataManager().getNpcName(charSelection.templateId));
View Full Code Here

  //FIXME hmm, why have we done this ? Pre component system code?
  private void addEntityIdToGeoms(int id, Spatial spatial){
    if(spatial instanceof Geometry)
      spatial.setUserData(Entity.ENTITY_ID, new Integer(id));
    if(spatial instanceof Node){
      Node node = (Node)spatial;
      for(Spatial n  : node.getChildren())
        addEntityIdToGeoms(id, n);
    }
  }
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

        replaceModel();
    }
  }
 
  private void replaceModel() {
    Node n = assembler.getModel();
    // the models are rotated so z is up
    n.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
//    // FIXME modelconverter should already have set this one, this is
//    // not the case -> NPE
//    n.setModelBound(new BoundingBox());
//    n.updateModelBound();
//    if (vis != null && vis.getParent() != null) {
View Full Code Here

    if(lastCharSummary.hair != charSelection.hair && top != null){
     
      Asset a = Assembler2.getHair(top, -1);
      if(a != null){
        assembler.getMeshes().remove(hair);
        Node me = (Node) (a.getBaseAsset());
        hair = me.getName();
        assembler.getMeshes().put(hair, (Geometry)me.getChild(0));
        replaceModel();       
      }
    }
//    Singleton.get().getSceneManager().changeAnyNode(this,vis, 0);
    //TODO hair color change ??
View Full Code Here

      time = t.getTimeInSeconds();
      System.out.println("File " + from.getAbsolutePath() + " loaded in "
          + time + " seconds");
      if (n instanceof Geometry) {
        g = (Geometry) n;
        n = new Node(g.getName());
        ((Node)n).attachChild(g);
      } else if (n instanceof Node) {
        if (((Node) n).getChildren().size() > 1)
          throw new Throwable(
              "Mesh with more children detected than one on "
View Full Code Here

//      System.out.println("-------------------------------------------------------");
      // need to load vial loadModel, JME does not see obj, etc as
      // 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

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.