/** * Creates a new <code>Line</code> from the given control point indices. It will have the name <code>curve</code>, * no normals, colour or texture, these can be added to the returned line if needed. * * @param start * The index of the control point to start from, must be greater than or equal to one and less than * <code>end</code>. * @param end * The index of the control point to end with, must be less than {@link #getControlPointCount() * controlPointCount} minus one and greater than <code>start</code>. * @param steps * The number of iterations to perform between control points, the higher this number the smoother the * returned line will be, but it will also contain more vertices, must be greater than one. * @return A <code>Line</code> representing this curve, will not be <code>null</code>. */ public Line toRenderableLine(final int start, final int end, final int steps) { final Vector3[] vertex = toVector3(start, end, steps); final Vector3[] normal = null; final ColorRGBA[] color = null; final Vector2[] texture = null; final Line line = new Line("curve", vertex, normal, color, texture); line.getMeshData().setIndexMode(IndexMode.LineStrip); return line; }
/** * Creates a new <code>Line</code> from the given control point indices. It will have the name <code>curve</code>, * no normals, colour or texture, these can be added to the returned line if needed. * * @param start * The index of the control point to start from, must be greater than or equal to one and less than * <code>end</code>. * @param end * The index of the control point to end with, must be less than {@link #getControlPointCount() * controlPointCount} minus one and greater than <code>start</code>. * @param steps * The number of iterations to perform between control points, the higher this number the smoother the * returned line will be, but it will also contain more vertices, must be greater than one. * @return A <code>Line</code> representing this curve, will not be <code>null</code>. */ public Line toRenderableLine(final int start, final int end, final int steps) { final Vector3[] vertex = toVector3(start, end, steps); final Vector3[] normal = null; final ColorRGBA[] color = null; final Vector2[] texture = null; final Line line = new Line("curve", vertex, normal, color, texture); line.getMeshData().setIndexMode(IndexMode.LineStrip); return line; }
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 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(TimedAreaGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(TimedAreaGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setAntialiased(getBooleanConfig(TimedAreaGrapher.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(TimedAreaGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals.setAntialiased(getBooleanConfig(TimedAreaGrapher.Horizontal, 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)); }
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.Ortho); _verticals.setDefaultColor(getColorConfig(TimedAreaGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(TimedAreaGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setStipplePattern(getShortConfig(TimedAreaGrapher.Vertical, ConfigKeys.Stipple.name(), (short) 0xFF00)); _verticals.setAntialiased(getBooleanConfig(TimedAreaGrapher.Vertical, ConfigKeys.Antialias.name(), true)); }
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.Ortho); _verticals.setDefaultColor(getColorConfig(LineGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(LineGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setStipplePattern(getShortConfig(LineGrapher.Vertical, ConfigKeys.Stipple.name(), (short) 0xFF00)); _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.Ortho); _horizontals.setDefaultColor(getColorConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals.setStipplePattern(getShortConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Stipple.name(), (short) 0xFF00)); _horizontals.setAntialiased(getBooleanConfig(TimedAreaGrapher.Horizontal, 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.Ortho); _horizontals.setDefaultColor(getColorConfig(LineGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(LineGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals .setStipplePattern(getShortConfig(LineGrapher.Horizontal, ConfigKeys.Stipple.name(), (short) 0xFF00)); _horizontals.setAntialiased(getBooleanConfig(LineGrapher.Horizontal, ConfigKeys.Antialias.name(), true)); }
pipe.setupBuffer(numEntries, lineMesh.getMeshData(), _dataCache);
_particleMesh = line; attachChild(line); line.getMeshData().setVertexBuffer(_geometryCoordinates); line.getMeshData().setColorBuffer(_appearanceColors); line.getMeshData().setTextureBuffer(BufferUtils.createVector2Buffer(numParticles * 2), 0); getSceneHints().setRenderBucketType(RenderBucketType.Opaque); getSceneHints().setLightCombineMode(LightCombineMode.Off); for (int a = verts - 1; a >= 0; a--) { final int ind = (k * verts) + a; BufferUtils.setInBuffer(sharedTextureData[a], line.getMeshData().getTextureCoords(0).getBuffer(), ind); BufferUtils.setInBuffer(_particles[k].getCurrentColor(), _appearanceColors, (ind));
_particleMesh = line; attachChild(line); line.getMeshData().setVertexBuffer(_geometryCoordinates); line.getMeshData().setColorBuffer(_appearanceColors); line.getMeshData().setTextureBuffer(BufferUtils.createVector2Buffer(numParticles * 2), 0); getSceneHints().setRenderBucketType(RenderBucketType.Opaque); getSceneHints().setLightCombineMode(LightCombineMode.Off); for (int a = verts - 1; a >= 0; a--) { final int ind = (k * verts) + a; BufferUtils.setInBuffer(sharedTextureData[a], line.getMeshData().getTextureCoords(0).getBuffer(), ind); BufferUtils.setInBuffer(_particles[k].getCurrentColor(), _appearanceColors, (ind));
public Line updateLineKey(final StatType type, Line lineKey) { if (lineKey == null) { lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null); final FloatBuffer fb = BufferUtils .createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0), new Vector3(30, 0, 0) }); fb.rewind(); lineKey.getMeshData().setVertexBuffer(fb); } lineKey.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); lineKey.getMeshData().setIndexMode(IndexMode.LineLoop); lineKey.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); lineKey.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); lineKey.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { lineKey.getSceneHints().setCullHint(CullHint.Always); } return lineKey; }
public Line updateLineKey(final StatType type, Line lineKey) { if (lineKey == null) { lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null); final FloatBuffer fb = BufferUtils .createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0), new Vector3(30, 0, 0) }); fb.rewind(); lineKey.getMeshData().setVertexBuffer(fb); } lineKey.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); lineKey.getMeshData().setIndexMode(IndexMode.LineStrip); lineKey.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); lineKey.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); lineKey.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowLines.name(), true)) { lineKey.getSceneHints().setCullHint(CullHint.Always); } return lineKey; }
public Line updateLineKey(final StatType type, Line lineKey) { if (lineKey == null) { lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null); final FloatBuffer fb = BufferUtils.createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0), new Vector3(30, 0, 0) }); fb.rewind(); lineKey.getMeshData().setVertexBuffer(fb); } lineKey.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); lineKey.getMeshData().setIndexMode(IndexMode.LineStrip); lineKey.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); lineKey.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); lineKey.setStipplePattern(getShortConfig(type, ConfigKeys.Stipple.name(), (short) 0xFFFF)); lineKey.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowLines.name(), true)) { lineKey.getSceneHints().setCullHint(CullHint.Always); } return lineKey; }
public Line updateLineKey(final StatType type, Line lineKey) { if (lineKey == null) { lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null); final FloatBuffer fb = BufferUtils.createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0), new Vector3(30, 0, 0) }); fb.rewind(); lineKey.getMeshData().setVertexBuffer(fb); } lineKey.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); lineKey.getMeshData().setIndexMode(IndexMode.LineLoop); lineKey.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); lineKey.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); lineKey.setStipplePattern(getShortConfig(type, ConfigKeys.Stipple.name(), (short) 0xFFFF)); lineKey.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { lineKey.getSceneHints().setCullHint(CullHint.Always); } return lineKey; }
lineFrustum.getMeshData().setIndexModes( new IndexMode[] { IndexMode.LineLoop, IndexMode.LineLoop, IndexMode.Lines, IndexMode.Lines }); lineFrustum.getMeshData().setIndexLengths(new int[] { 4, 4, 8, 8 }); lineFrustum.getSceneHints().setLightCombineMode(LightCombineMode.Off); extendedCamera.calculateFrustum(fNear, fFar); final FloatBuffer colors = lineFrustum.getMeshData().getColorBuffer(); for (int i = 0; i < 16; i++) { BufferUtils.setInBuffer(color, colors, i); final FloatBuffer verts = lineFrustum.getMeshData().getVertexBuffer(); BufferUtils.setInBuffer(corners[0], verts, 0); BufferUtils.setInBuffer(corners[1], verts, 1);
public LineEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; point = new Point("p", BufferUtils.createVector3Buffer(maxSamples), null, null, null); point.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); point.setDefaultColor(getColorConfig(type, ConfigKeys.PointColor.name(), new ColorRGBA(ColorRGBA.WHITE))); point.setPointSize(getIntConfig(type, ConfigKeys.PointSize.name(), 5)); point.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowPoints.name(), false)) { point.getSceneHints().setCullHint(CullHint.Always); } line = new Line("l", BufferUtils.createVector3Buffer(maxSamples), null, null, null); line.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); line.getMeshData().setIndexMode(IndexMode.LineStrip); line.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); line.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); line.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowLines.name(), true)) { line.getSceneHints().setCullHint(CullHint.Always); } } }
public LineEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; point = new Point("p", BufferUtils.createVector3Buffer(maxSamples), null, null, null); point.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); point.setDefaultColor(getColorConfig(type, ConfigKeys.PointColor.name(), new ColorRGBA(ColorRGBA.WHITE))); point.setPointSize(getIntConfig(type, ConfigKeys.PointSize.name(), 5)); point.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowPoints.name(), false)) { point.getSceneHints().setCullHint(CullHint.Always); } line = new Line("l", BufferUtils.createVector3Buffer(maxSamples), null, null, null); line.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); line.getMeshData().setIndexMode(IndexMode.LineStrip); line.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); line.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3)); line.setStipplePattern(getShortConfig(type, ConfigKeys.Stipple.name(), (short) 0xFFFF)); line.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true)); if (!getBooleanConfig(type, ConfigKeys.ShowLines.name(), true)) { line.getSceneHints().setCullHint(CullHint.Always); } } }