Package com.jme3.scene

Examples of com.jme3.scene.Geometry.updateModelBound()


    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);
        geom.updateModelBound();

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        mat.setColor("m_Color", ColorRGBA.Blue);
        geom.setMaterial(mat);
View Full Code Here


    m.setBuffer(Type.Position, 3, vb);
    m.setBuffer(Type.Index, 3, ib);
    m.updateBound();
   
    Geometry g = new Geometry("Debug_NavMesh_"+this.toString(),m);
    g.updateModelBound();
    return g;
  }
 
  /**
   * Packs all border cells into a renderable mesh
View Full Code Here

    m.setBuffer(Type.Position, 3, vb);
    m.setBuffer(Type.Index, 3, ib);
    m.updateBound();
   
    Geometry g = new Geometry("Debug_NavBorderMesh_"+this.toString(),m);
    g.updateModelBound();
    return g;
  }
 

  public Geometry getDebugBounds(float y){
View Full Code Here

    geometries.add(new Geometry("left", l));

    Mesh m = new Mesh();
    GeometryBatchFactory.mergeGeometries(geometries, m);
    Geometry g = new Geometry("bounds of "+toString(), m);
    g.updateModelBound();
    return g;

  }
 
  public void setPosition(Vector3f position){
View Full Code Here

        Spatial s = n.getChild(0);
        String mat = "default";
        if(s instanceof Geometry) {
          Geometry g = ((Geometry)s);
          g.setName(fName);
          g.updateModelBound();
          mat = g.getMaterial().getName();
          //remove material, we don't want jme to store different materials being all the same on load, so we remove it here
          g.setMaterial(null);
        }
       
View Full Code Here

    private static Geometry createDebugShape(CollisionShape shape) {
        Geometry geom = new Geometry();
        geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
//        geom.setLocalScale(shape.getScale());
        geom.updateModelBound();
        return geom;
    }

    public static Mesh getDebugMesh(CollisionShape shape) {
        Mesh mesh = new Mesh();
View Full Code Here

                mesh.setBuffer(Type.Index, 3, (ShortBuffer) indexBuffers[i].getBuffer());
            }
            mesh.setBuffer(Type.Normal, 3, normalBuffers[i]);
            Geometry g = new Geometry("g" + i, mesh);
            g.setUserData("curveLength", oneReferenceToCurveLength);
            g.updateModelBound();
            result.add(g);
        }
        return result;
    }
View Full Code Here

        m.updateCounts();
        m.updateBound();

        g = new Geometry("Face(" + verts[0] + ", " + verts[1]
                + ", " + verts[2] + ", " + verts[3] + ")", m);
        g.updateModelBound();

        return g;
    }

    public static final Geometry createBox(float xExtent, float yExtent, float zExtent) {
View Full Code Here

        m.setMode(Mode.Lines);
        m.updateCounts();
        m.updateBound();

        g = new Geometry("Box" + extent, m);
        g.updateModelBound();

        return g;
    }

    public static final Node createPolygon(Vector3f[] vertices, boolean triangulate,
View Full Code Here

            //Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
            //spatial.setMaterial(mat);
            node.attachChild(spatial);

      node.setModelBound(new BoundingSphere());
      node.updateModelBound();
  } catch (Exception e) {
            e.printStackTrace();
      //logger.logp(Level.SEVERE, this.getClass().toString(),"loadNode()", "Exception", e);
      node = null;
  }
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.