/** * Creates a new <code>Point</code> from the given control point indices. It will have the name <code>point</code>, * no normals, colour or texture, these can be added to the returned point 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 more points * will be shown, but it will also contain more vertices, must be greater than one. * @return A <code>Point</code> containing all the curve points, will not be <code>null</code>. */ public Point toRenderablePoint(final int start, final int end, final int steps) { final Vector3[] points = toVector3(start, end, steps); return new Point("point", points, null, null, null); }
@Override public void render(final Renderer renderer) { renderer.setupPointParameters(_pointSize, isAntialiased(), isPointSprite(), _useDistanceAttenuation, _attenuationCoefficients, _minPointSize, _maxPointSize); super.render(renderer); }
@Override public Point makeCopy(final boolean shareGeometricData) { final Point pointCopy = (Point) super.makeCopy(shareGeometricData); pointCopy.setAntialiased(_antialiased); pointCopy.setDistanceAttenuationCoefficients(_attenuationCoefficients.get(0), _attenuationCoefficients.get(1), _attenuationCoefficients.get(2)); pointCopy.setMaxPointSize(_maxPointSize); pointCopy.setMinPointSize(_minPointSize); pointCopy.setPointSize(_pointSize); pointCopy.setPointType(_pointType); return pointCopy; }
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); } } }
@Override public void draw(final Renderer r) { final Camera camera = Camera.getCurrentCamera(); boolean anyAlive = false; for (int i = 0; i < _particles.length; i++) { final Particle particle = _particles[i]; if (particle.getStatus() == Particle.Status.Alive) { particle.updateVerts(camera); anyAlive = true; } } // Since we've updated our verts, update the model boundary where applicable if (getParticleGeometry().getWorldBound() != null && anyAlive) { getParticleGeometry().updateModelBound(); } if (!_particlesInWorldCoords) { getParticleGeometry().setWorldTransform(getWorldTransform()); } else { getParticleGeometry().setWorldTranslation(Vector3.ZERO); getParticleGeometry().setWorldRotation(Matrix3.IDENTITY); getParticleGeometry().setWorldScale(getWorldScale()); } getParticleGeometry().draw(r); }
return null; final Point points = new Point(); points.setName(mesh.getAttributeValue("name", mesh.getName())); points.getMeshData().setVertexBuffer(vertices); } else if (source.getChild("int_array") != null) { points.getMeshData().setVertexBuffer(vertices); final int[] indices = new int[points.getMeshData().getVertexCount()]; for (int i = 0; i < indices.length; i++) { indices[i] = i; points.updateModelBound();
final Point points = new Point(name, vertices, null, null, null); final IndexBufferData<? extends Buffer> indexBuffer = BufferUtils .createIndexBufferData(_pointManager.getIndices().size(), vertices.length - 1); indexBuffer.put(index); points.getMeshData().setIndices(indexBuffer); mapToGroups(points); points.updateModelBound();
entry.point.removeFromParent(); i.remove(); continue; entry.point.getMeshData().setVertexBuffer(fb); final double scaleWidth = texWidth / (StatCollector.getMaxSamples() - 1.0); final double scaleHeight = texHeight / (entry.max * 1.02); entry.point.setScale(new Vector3(scaleWidth, scaleHeight, 1)); entry.line.getMeshData().setVertexBuffer(fb); entry.line.setScale(new Vector3(scaleWidth, scaleHeight, 1)); _graphRoot.attachChild(entry.line); if (!_graphRoot.equals(entry.point.getParent())) { _graphRoot.attachChild(entry.point);
for (int a = verts - 1; a >= 0; a--) { final int ind = (k * verts) + a; BufferUtils.setInBuffer(sharedTextureData[a], getParticleGeometry().getMeshData().getTextureCoords(0) .getBuffer(), ind); BufferUtils.setInBuffer(_particles[k].getCurrentColor(), _appearanceColors, (ind));
/** * Sets whether the points should be antialiased. May decrease performance. If you want to enabled antialiasing, you * should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of * DB_ONE_MINUS_SRC_ALPHA or DB_ONE. * * @param antialiased * true if the line should be antialiased. */ public void setAntialiased(final boolean antialiased) { getParticleGeometry().setAntialiased(antialiased); }
/** * Sets the pixel width of the points when drawn. Non anti-aliased point sizes are rounded to the nearest whole * number by opengl. * * @param size * The size to set. */ public void setPointSize(final float size) { getParticleGeometry().setPointSize(size); }
/** * @return true if points are to be drawn antialiased */ public boolean isAntialiased() { return getParticleGeometry().isAntialiased(); }
/** * @return the pixel size of each point. */ public float getPointSize() { return getParticleGeometry().getPointSize(); }
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); } } }
@Override public void draw(final Renderer r) { final Camera camera = Camera.getCurrentCamera(); boolean anyAlive = false; for (int i = 0; i < _particles.length; i++) { final Particle particle = _particles[i]; if (particle.getStatus() == Particle.Status.Alive) { particle.updateVerts(camera); anyAlive = true; } } // Since we've updated our verts, update the model boundary where applicable if (getParticleGeometry().getWorldBound() != null && anyAlive) { getParticleGeometry().updateModelBound(); } if (!_particlesInWorldCoords) { getParticleGeometry().setWorldTransform(getWorldTransform()); } else { getParticleGeometry().setWorldTranslation(Vector3.ZERO); getParticleGeometry().setWorldRotation(Matrix3.IDENTITY); getParticleGeometry().setWorldScale(getWorldScale()); } getParticleGeometry().draw(r); }
entry.point.removeFromParent(); i.remove(); continue; entry.point.getMeshData().setVertexBuffer(fb); final double scaleWidth = texWidth / (StatCollector.getMaxSamples() - 1.0); final double scaleHeight = texHeight / (entry.max * 1.02); entry.point.setScale(new Vector3(scaleWidth, scaleHeight, 1)); entry.line.getMeshData().setVertexBuffer(fb); entry.line.setScale(new Vector3(scaleWidth, scaleHeight, 1)); _graphRoot.attachChild(entry.line); if (!_graphRoot.equals(entry.point.getParent())) { _graphRoot.attachChild(entry.point);
for (int a = verts - 1; a >= 0; a--) { final int ind = (k * verts) + a; BufferUtils.setInBuffer(sharedTextureData[a], getParticleGeometry().getMeshData().getTextureCoords(0) .getBuffer(), ind); BufferUtils.setInBuffer(_particles[k].getCurrentColor(), _appearanceColors, (ind));
/** * Sets whether the points should be antialiased. May decrease performance. If you want to enabled antialiasing, you * should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of * DB_ONE_MINUS_SRC_ALPHA or DB_ONE. * * @param antialiased * true if the line should be antialiased. */ public void setAntialiased(final boolean antialiased) { getParticleGeometry().setAntialiased(antialiased); }
/** * Sets the pixel width of the points when drawn. Non anti-aliased point sizes are rounded to the nearest whole * number by opengl. * * @param size * The size to set. */ public void setPointSize(final float size) { getParticleGeometry().setPointSize(size); }
/** * @return true if points are to be drawn antialiased */ public boolean isAntialiased() { return getParticleGeometry().isAntialiased(); }