/** * Constructs a new line with the given name. By default, the line has no information. * * @param name * The name of the line. */ public Line(final String name) { super(name); _meshData.setIndexMode(IndexMode.Lines); }
/** * Constructs a new line with the given name. By default, the line has no information. * * @param name * The name of the line. */ public Line(final String name) { super(name); _meshData.setIndexMode(IndexMode.Lines); }
private void setIndexData() { getMeshData().setIndexMode(IndexMode.TriangleStrip); }
/** * Set the basic data for this mesh such as texture coordinates, index mode and our vertex buffer. */ private void initialize() { _meshData.setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(4), 2)); final FloatBuffer tbuf = BufferUtils.createVector2Buffer(4); _meshData.setTextureBuffer(tbuf, 0); tbuf.put(0).put(1); tbuf.put(0).put(0); tbuf.put(1).put(0); tbuf.put(1).put(1); _meshData.setIndexMode(IndexMode.TriangleFan); }
/** * * <code>setIndexData</code> sets the indices into the list of vertices, defining all triangles that constitute the * box. * */ private void setIndexData() { _meshData.setIndexMode(IndexMode.TriangleStrip); if (_meshData.getIndices() == null) { final byte[] indices = new byte[] { 2, 3, 6, 7, 5, 3, 0, 2, 1, 6, 4, 5, 1, 0 }; final ByteBuffer buf = BufferUtils.createByteBuffer(indices.length); buf.put(indices); buf.rewind(); _meshData.setIndexBuffer(buf); } }
/** * * <code>setIndexData</code> sets the indices into the list of vertices, defining all triangles that constitute the * box. * */ private void setIndexData() { _meshData.setIndexMode(IndexMode.TriangleStrip); if (_meshData.getIndices() == null) { final byte[] indices = new byte[] { 2, 3, 6, 7, 5, 3, 0, 2, 1, 6, 4, 5, 1, 0 }; final ByteBuffer buf = BufferUtils.createByteBuffer(indices.length); buf.put(indices); buf.rewind(); _meshData.setIndexBuffer(buf); } }
/** * Set the basic data for this mesh such as texture coordinates, index mode and our vertex buffer. */ private void initialize() { final FloatBufferData vbuf = new FloatBufferData(BufferUtils.createVector2Buffer(4), 2); vbuf.setVboAccessMode(VBOAccessMode.DynamicDraw); _meshData.setVertexCoords(vbuf); final FloatBuffer tbuf = BufferUtils.createVector2Buffer(4); _meshData.setTextureBuffer(tbuf, 0); _meshData.getTextureCoords(0).setVboAccessMode(VBOAccessMode.DynamicDraw); tbuf.put(0).put(1); tbuf.put(0).put(0); tbuf.put(1).put(0); tbuf.put(1).put(1); _meshData.setIndexMode(IndexMode.TriangleFan); }
private void createVLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer(((int) (texWidth / _vSpan) + 1) * 2); for (float x = _vSpan; x <= texWidth + _vSpan; x += _vSpan) { verts.put(x).put(0).put(0); verts.put(x).put(texHeight).put(0); } _verticals = new Line("vert", verts, null, null, null); _verticals.getMeshData().setIndexMode(IndexMode.Lines); _verticals.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); _verticals.setDefaultColor( getColorConfig(LineGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(LineGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setAntialiased(getBooleanConfig(LineGrapher.Vertical, ConfigKeys.Antialias.name(), true)); }
private void createHLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer((100 / majorHBar) * 2); final float div = texHeight * majorHBar / 100f; for (int y = 0, i = 0; i < verts.capacity(); i += 6, y += div) { verts.put(0).put(y).put(0); verts.put(texWidth).put(y).put(0); } _horizontals = new Line("horiz", verts, null, null, null); _horizontals.getMeshData().setIndexMode(IndexMode.Lines); _horizontals.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); _horizontals.setDefaultColor( getColorConfig(LineGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(LineGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals.setAntialiased(getBooleanConfig(LineGrapher.Horizontal, ConfigKeys.Antialias.name(), true)); }
/** * Construct a new TextCaret */ public TextCaret() { final MeshData md = _strip.getMeshData(); md.setVertexBuffer(BufferUtils.createVector3Buffer(4)); md.setIndices(BufferUtils.createIndexBufferData(new int[] { 0, 1, 3, 2 }, 3)); md.setIndexMode(IndexMode.TriangleStrip); final float[] vals = new float[] { 0, 0, 0, // 1, 0, 0, // 1, 1, 0, // 0, 1, 0 // }; md.getVertexBuffer().put(vals); _strip.updateGeometricState(0); setCaretColor(ColorRGBA.BLACK); }
public TextMesh() { super("text"); getMeshData().setIndexMode(IndexMode.Triangles); getSceneHints().setLightCombineMode(LightCombineMode.Off); getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); // -- never cull setModelBound(null); getSceneHints().setCullHint(CullHint.Never); // -- default to non-pickable getSceneHints().setAllPickingHints(false); } }
public TextMesh() { super("text"); getMeshData().setIndexMode(IndexMode.Triangles); getSceneHints().setLightCombineMode(LightCombineMode.Off); getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); // -- never cull setModelBound(null); getSceneHints().setCullHint(CullHint.Never); // -- default to non-pickable getSceneHints().setAllPickingHints(false); } }
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; }
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; }
public AreaEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; area = new Mesh("a"); area.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(maxSamples * 2)); area.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); area.getMeshData().setIndexMode(IndexMode.LineStrip); area.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { area.getSceneHints().setCullHint(CullHint.Always); } } }
public AreaEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; area = new Mesh("a"); area.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(maxSamples * 2)); area.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); area.getMeshData().setIndexMode(IndexMode.LineStrip); area.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { area.getSceneHints().setCullHint(CullHint.Always); } } }
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; } }
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; } }
private void setIndexData() { final IndexBufferData<?> indices = _meshData.getIndices(); indices.getBuffer().rewind(); indices.put(9).put(5).put(10).put(6); indices.put(4).put(0).put(5).put(1).put(6).put(2); indices.put(2).put(3).put(6).put(7).put(10).put(11); indices.put(11).put(15).put(10).put(14).put(9).put(13); indices.put(13).put(12).put(9).put(8).put(5).put(4); _meshData.setIndexLengths(new int[] { 4, 6, 6, 6, 6 }); _meshData.setIndexMode(IndexMode.TriangleStrip); _meshData.markIndicesDirty(); }