/** * Sets the mesh to use for this geometry when rendering. * * @param mesh the mesh to use for this geometry * * @throws IllegalArgumentException If mesh is null */ public void setMesh(Mesh mesh) { if (mesh == null) { throw new IllegalArgumentException(); } this.mesh = mesh; setBoundRefresh(); if (isGrouped()) { groupNode.onMeshChange(this); } }
/** * Sets the LOD level to use when rendering the mesh of this geometry. * Level 0 indicates that the default index buffer should be used, * levels [1, LodLevels + 1] represent the levels set on the mesh * with {@link Mesh#setLodLevels(com.jme3.scene.VertexBuffer[]) }. * * @param lod The lod level to set */ @Override public void setLodLevel(int lod) { if (mesh.getNumLodLevels() == 0) { throw new IllegalStateException("LOD levels are not set on this mesh"); } if (lod < 0 || lod >= mesh.getNumLodLevels()) { throw new IllegalArgumentException("LOD level is out of range: " + lod); } lodLevel = lod; if (isGrouped()) { groupNode.onMeshChange(this); } }
/** * Sets the mesh to use for this geometry when rendering. * * @param mesh the mesh to use for this geometry * * @throws IllegalArgumentException If mesh is null */ public void setMesh(Mesh mesh) { if (mesh == null) { throw new IllegalArgumentException(); } this.mesh = mesh; setBoundRefresh(); if (isGrouped()) { groupNode.onMeshChange(this); } }
/** * Sets the LOD level to use when rendering the mesh of this geometry. * Level 0 indicates that the default index buffer should be used, * levels [1, LodLevels + 1] represent the levels set on the mesh * with {@link Mesh#setLodLevels(com.jme3.scene.VertexBuffer[]) }. * * @param lod The lod level to set */ @Override public void setLodLevel(int lod) { if (mesh.getNumLodLevels() == 0) { throw new IllegalStateException("LOD levels are not set on this mesh"); } if (lod < 0 || lod >= mesh.getNumLodLevels()) { throw new IllegalArgumentException("LOD level is out of range: " + lod); } lodLevel = lod; if (isGrouped()) { groupNode.onMeshChange(this); } }