Package com.jme3.scene

Examples of com.jme3.scene.Node


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


  private void addBBoxes(Node n) {
    System.out.println("add boxes");
    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) {
        Box b = new Box(bound.getCenter(), ((BoundingBox) bound).getXExtent(), ((BoundingBox) bound).getYExtent(), ((BoundingBox) bound).getZExtent());
        Geometry g = new Geometry(null, b);
View Full Code Here

   
    protected void prevTemplate(){ template_index--; if(template_index<0)template_index=0;  System.out.println("prev template:"+templates[template_index]);}
   
    protected void addModel(){    

      Node n = Assembler2.getModel3(templates[template_index]);
     
      if(n != null){
//        n.removeControl(JMEAnimationController.class);
//        n.removeControl(SkeletonControl.class);
        nodes.add(n);
        currentNode++;
        int x = currentNode;
        int y = 2+((currentNode%2)*-1);//*currentNode;
        n.setLocalTranslation(x, 0.0f, y);
        rootNode.attachChild(n);
      }
    }
View Full Code Here

      if(currentNode<0)
        currentNode = 0;
      if(nodes.size()<=0)
        return;
     
      Node n = nodes.remove(nodes.size()-1);
      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;
      }
     
//      if(currentNode%2!=0){
        n = Assembler2.getModel3("DwarfWarriorM"); //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;
      }
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) {
          BoundingBox bb = ((BoundingBox) bound);
          WireBox b = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent());
View Full Code Here

   
    protected void prevTemplate(){ template_index--; if(template_index<0)template_index=0;  System.out.println("prev template:"+templates[template_index]);}
   
    protected void addModel(){    

      Node n = Assembler2.getModel4(templates[template_index],true, true);
      if(n != null){
        n.setModelBound(new BoundingBox());
        n.updateGeometricState();
        n.updateModelBound();
        nodes.add(n);
        currentNode++;
        int x = currentNode;
        int y = 2+((currentNode%2)*-1);//*currentNode;
//        n.setLocalTranslation(x, 0.0f, y);
        n.setLocalTranslation(x, 0.0f, y);
        rootNode.attachChild(n);
      }
    }
View Full Code Here

      if(currentNode<0)
        currentNode = 0;
      if(nodes.size()<=0)
        return;
     
      Node n = nodes.remove(nodes.size()-1);
      if(n != null){
        rootNode.detachChild(n);
        n = null;
      }
      currentNode--;
View Full Code Here

     * add terrain
     */
    private void setupScene() {

      //TODO could use getTemplates to switch through models..
      Node n = Assembler2.getModel3("DwarfWarriorM"); //"pelffwarrior");//humanhalberd"); //goblin");

      if(n != null){
        rootNode.attachChild(n);
//        n.updateGeometricState();
     

        final AnimControl conn = n.getControl(AnimControl.class);
        SwingUtilities.invokeLater(new Runnable() {

          public void run() {
            final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
            final JInternalFrame internalFrame = new JInternalFrame();
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.