/** * Sets the model bound to use for this geometry. * This alters the bound used on the mesh as well via * {@link Mesh#setBound(com.jme3.bounding.BoundingVolume) } and * forces the world bounding volume to be recomputed. * * @param modelBound The model bound to set */ @Override public void setModelBound(BoundingVolume modelBound) { this.worldBound = null; mesh.setBound(modelBound); setBoundRefresh(); // NOTE: Calling updateModelBound() would cause the mesh // to recompute the bound based on the geometry thus making // this call useless! //updateModelBound(); }
q.setBound(new BoundingSphere()); q.updateBound();
@Override public void simpleInitApp() { Mesh mesh = new Mesh(); mesh.setBuffer(VertexBuffer.Type.Index, 1, BufferUtils.createIntBuffer(new int[]{1})); mesh.setBuffer(VertexBuffer.Type.Position, 3, BufferUtils.createFloatBuffer(new float[]{0, 0, 0})); mesh.setMode(Mesh.Mode.Points); mesh.setBound(new BoundingBox(new Vector3f(0, 0, 0), 10, 10, 10)); mesh.updateCounts(); Geometry geometry = new Geometry("Test", mesh); geometry.updateGeometricState(); geometry.setMaterial(new Material(assetManager, "Materials/Geom/SimpleGeom.j3md")); //geometry.getMaterial().getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off); //geometry.setMaterial(assetManager.loadMaterial("Materials/Geom/SimpleTess.j3md")); rootNode.attachChild(geometry); Geometry geometry1 = new Geometry("T1", new Sphere(10, 10, 1)); geometry1.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md")); rootNode.attachChild(geometry1); }
/** * Sets the model bound to use for this geometry. * This alters the bound used on the mesh as well via * {@link Mesh#setBound(com.jme3.bounding.BoundingVolume) } and * forces the world bounding volume to be recomputed. * * @param modelBound The model bound to set */ @Override public void setModelBound(BoundingVolume modelBound) { this.worldBound = null; mesh.setBound(modelBound); setBoundRefresh(); // NOTE: Calling updateModelBound() would cause the mesh // to recompute the bound based on the geometry thus making // this call useless! //updateModelBound(); }
/** * Sets the model bound to use for this geometry. * This alters the bound used on the mesh as well via * {@link Mesh#setBound(com.jme3.bounding.BoundingVolume) } and * forces the world bounding volume to be recomputed. * * @param modelBound The model bound to set */ @Override public void setModelBound(BoundingVolume modelBound) { this.worldBound = null; mesh.setBound(modelBound); setBoundRefresh(); // NOTE: Calling updateModelBound() would cause the mesh // to recompute the bound based on the geometry thus making // this call useless! //updateModelBound(); }