public Mesh getCombinedMesh() { final Mesh mesh = getMesh(); // set our bounding volume using the volume type of our first source found above. mesh.setModelBound(volumeType); // set the render states from the first mesh for (final RenderState state : states.values()) { mesh.setRenderState(state); } return mesh; }
public Mesh getCombinedMesh() { final Mesh mesh = getMesh(); // set our bounding volume using the volume type of our first source found above. mesh.setModelBound(volumeType); // set the render states from the first mesh for (final RenderState state : states.values()) { mesh.setRenderState(state); } return mesh; }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
protected Mesh getFullScreenQuad() { if (_fsq != null) { return _fsq; } _fsq = Quad.newFullScreenQuad(); final ZBufferState zState = new ZBufferState(); zState.setEnabled(false); _fsq.setRenderState(zState); _fsq.updateGeometricState(0); return _fsq; }
@Override public boolean processExtra(final Element extra, final Object[] params) { if (params.length > 0 && params[0] instanceof Mesh) { final Mesh mesh = (Mesh) params[0]; // should have a child: <technique profile="GOOGLEEARTH"> final Element technique = extra.getChild("technique"); if (technique != null) { final Attribute profile = technique.getAttribute("profile"); if (profile != null && "GOOGLEEARTH".equalsIgnoreCase(profile.getValue())) { for (final Element child : technique.getChildren()) { // disable back face culling if it's been enabled. if ("double_sided".equalsIgnoreCase(child.getName()) && "1".equals(child.getTextTrim())) { final CullState cs = new CullState(); cs.setEnabled(false); mesh.setRenderState(cs); } } return true; } } } return false; } }
private static Mesh createMesh() { final Mesh mesh = new Mesh(); mesh.getMeshData().setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(4), 2)); mesh.getMeshData().setTextureBuffer(BufferUtils.createVector2Buffer(4), 0); mesh.getMeshData().setIndexMode(IndexMode.TriangleFan); mesh.setRenderState(SubTexUtil._tstate); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }
private static Mesh createMesh() { final Mesh mesh = new Mesh(); mesh.setRenderMaterial("ui/textured/default_color.yaml"); final MeshData meshData = mesh.getMeshData(); meshData.setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(4), 2)); meshData.setTextureBuffer(BufferUtils.createVector2Buffer(4), 0); meshData.setIndexMode(IndexMode.TriangleFan); meshData.getVertexCoords().setVboAccessMode(VBOAccessMode.DynamicDraw); mesh.setRenderState(SubTexUtil._tstate); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }
if (tState == null) { tState = new TextureState(); mesh.setRenderState(tState);
protected Mesh createSelectionMesh() { final Mesh mesh = new Mesh("selectionMesh"); final MeshData mData = mesh.getMeshData(); mData.setVertexBuffer(BufferUtils.createVector3Buffer(6)); mData.setIndexMode(IndexMode.Triangles); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY); return mesh; }
private static Mesh createMesh() { // create a triangle strip of 8 triangles. final Mesh mesh = new Mesh(); mesh.getMeshData().setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(8), 2)); mesh.getMeshData().setColorBuffer(BufferUtils.createColorBuffer(8)); mesh.getMeshData().setIndexMode(IndexMode.TriangleStrip); final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(10, 7); indices.put(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 }); mesh.getMeshData().setIndices(indices); // set up alpha blending. final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); // use flat shade so our borders will have a solid color. final ShadingState shading = new ShadingState(); shading.setShadingMode(ShadingMode.Flat); mesh.setRenderState(shading); mesh.updateWorldRenderStates(false); return mesh; } }
protected Mesh createSelectionMesh() { final Mesh mesh = new Mesh("selectionMesh"); mesh.setRenderMaterial("ui/untextured/default_color.yaml"); final MeshData mData = mesh.getMeshData(); mData.setVertexBuffer(BufferUtils.createVector3Buffer(6)); mData.setIndexMode(IndexMode.Triangles); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY); return mesh; }
private static Mesh createMesh() { final Mesh mesh = new Mesh(); mesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(4)); mesh.getMeshData().setColorBuffer(BufferUtils.createColorBuffer(4)); mesh.getMeshData().setIndexMode(IndexMode.TriangleFan); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }
protected Mesh getFullScreenQuad() { if (_fsq != null) { return _fsq; } _fsq = new Mesh("fsq"); _fsq.getMeshData().setVertexBuffer(BufferUtils.createFloatBuffer(-1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1)); _fsq.getMeshData().setTextureBuffer(BufferUtils.createFloatBuffer(0, 0, 1, 0, 1, 1, 0, 1), 0); _fsq.getMeshData().setIndices(BufferUtils.createIndexBufferData(new int[] { 0, 1, 3, 1, 2, 3 }, 3)); _fsq.getSceneHints().setCullHint(CullHint.Never); _fsq.getSceneHints().setLightCombineMode(LightCombineMode.Off); final ZBufferState zState = new ZBufferState(); zState.setEnabled(false); _fsq.setRenderState(zState); _fsq.updateGeometricState(0); return _fsq; }
private static Mesh createMesh() { final Mesh mesh = new Mesh(); mesh.setRenderMaterial("ui/untextured/vertex_color.yaml"); final MeshData meshData = mesh.getMeshData(); meshData.setVertexBuffer(BufferUtils.createVector3Buffer(4)); meshData.getVertexCoords().setVboAccessMode(VBOAccessMode.DynamicDraw); meshData.setColorBuffer(BufferUtils.createColorBuffer(4)); meshData.getColorCoords().setVboAccessMode(VBOAccessMode.DynamicDraw); meshData.setIndexMode(IndexMode.TriangleFan); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }
private static Mesh createMesh() { // create a triangle strip of 8 triangles. final Mesh mesh = new Mesh(); mesh.setRenderMaterial("ui/untextured/vertex_color_flat.yaml"); mesh.getMeshData().setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(8), 2)); mesh.getMeshData().setColorBuffer(BufferUtils.createColorBuffer(8)); mesh.getMeshData().setIndexMode(IndexMode.TriangleStrip); final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(10, 7); indices.put(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 }); mesh.getMeshData().setIndices(indices); // set up alpha blending. final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }
|| !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture()); SubTexUtil._mesh.setRenderState(SubTexUtil._tstate); SubTexUtil._mesh.updateWorldRenderStates(false);
|| !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture()); SubTexUtil._mesh.setRenderState(SubTexUtil._tstate); SubTexUtil._mesh.updateWorldRenderStates(false);
|| !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture()); SubTexUtil._mesh.setRenderState(SubTexUtil._tstate); SubTexUtil._mesh.updateWorldRenderStates(false);
|| !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture()); SubTexUtil._mesh.setRenderState(SubTexUtil._tstate); SubTexUtil._mesh.updateWorldRenderStates(false);