/** * @param height * The height to set. */ public void setHeight(final double height) { _height = height; allocateVertices(); }
setRadius(radius); _height = height; _closed = closed; _inverted = inverted; allocateVertices();
public void buildArrow() { // Start with cylinders: final Cylinder base = new Cylinder("base", 4, 16, _width * .75, _length); base.getMeshData().rotatePoints(rotator); base.getMeshData().rotateNormals(rotator); attachChild(base); base.updateModelBound(); final Pyramid tip = new Pyramid("tip", 2 * _width, _length / 2f); tip.getMeshData().translatePoints(0, _length * .75, 0); attachChild(tip); tip.updateModelBound(); }
public MovePlanarWidget withDefaultHandle(final double radius, final double height, final ReadOnlyColorRGBA color) { final Cylinder handle = new Cylinder("handle", 2, 16, radius, height, true); handle.setDefaultColor(color); switch (_plane) { case XZ: handle.setRotation(new Matrix3().fromAngleNormalAxis(MathUtils.HALF_PI, Vector3.UNIT_X)); break; case YZ: handle.setRotation(new Matrix3().fromAngleNormalAxis(MathUtils.HALF_PI, Vector3.UNIT_Y)); break; default: // do nothing break; } handle.updateModelBound(); withHandle(handle); return this; }
private void allocateVertices() { // allocate vertices final int verts = _axisSamples * (_radialSamples + 1) + (_closed ? 2 : 0); _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(_meshData.getVertexBuffer(), verts)); // allocate normals if requested _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(_meshData.getNormalBuffer(), verts)); // allocate texture coordinates _meshData.setTextureBuffer(BufferUtils.createVector2Buffer(verts), 0); final int count = ((_closed ? 2 : 0) + 2 * (_axisSamples - 1)) * _radialSamples; if (_meshData.getIndices() == null || _meshData.getIndices().getBufferLimit() != 3 * count) { _meshData.setIndices(BufferUtils.createIndexBufferData(3 * count, verts - 1)); } setGeometryData(); setIndexData(); }
public void buildArrow() { // Start with cylinders: final Cylinder base = new Cylinder("base", 4, 16, _width * .75, _length); base.getMeshData().rotatePoints(rotator); base.getMeshData().rotateNormals(rotator); attachChild(base); base.updateModelBound(); final Pyramid tip = new Pyramid("tip", 2 * _width, _length / 2f); tip.getMeshData().translatePoints(0, _length * .75, 0); attachChild(tip); tip.updateModelBound(); }
private void allocateVertices() { // allocate vertices final int verts = _axisSamples * (_radialSamples + 1) + (_closed ? 2 : 0); _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(_meshData.getVertexBuffer(), verts)); // allocate normals if requested _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(_meshData.getNormalBuffer(), verts)); // allocate texture coordinates _meshData.setTextureBuffer(BufferUtils.createVector2Buffer(verts), 0); final int count = ((_closed ? 2 : 0) + 2 * (_axisSamples - 1)) * _radialSamples; if (_meshData.getIndices() == null || _meshData.getIndices().getBufferLimit() != 3 * count) { _meshData.setIndices(BufferUtils.createIndexBufferData(3 * count, verts - 1)); } setGeometryData(); setIndexData(); }
@Override public void buildArrow() { detachAllChildren(); // Start with cylinder base: final Cylinder base = new Cylinder("base", 4, 16, _width * 0.75, _length - _lengthGap); base.getMeshData().translatePoints(0, 0, (_lengthGap + _length) * 0.5); attachChild(base); base.updateModelBound(); // Add the pyramid tip. final double tipLength = _length / 2.0; final Pyramid tip = new Pyramid("tip", 2 * _width, tipLength); tip.getMeshData().translatePoints(0, _tipGap + _length + 0.5 * tipLength, 0); tip.getMeshData().rotatePoints(InteractArrow.rotator); tip.getMeshData().rotateNormals(InteractArrow.rotator); attachChild(tip); tip.updateModelBound(); }
/** * Set the top radius of the 'cylinder' to differ from the bottom radius. * * @param radius * The first radius to set. * @see com.ardor3d.extension.shape.Cone */ public void setRadius1(final double radius) { _radius = radius; allocateVertices(); }
setRadius(radius); _height = height; _closed = closed; _inverted = inverted; allocateVertices();
/** * Set the bottom radius of the 'cylinder' to differ from the top radius. This makes the Mesh be a frustum of * pyramid, or if set to 0, a cone. * * @param radius * The second radius to set. * @see com.ardor3d.extension.shape.Cone */ public void setRadius2(final double radius) { _radius2 = radius; allocateVertices(); }
/** * Change the radius of this cylinder. This resets any second radius. * * @param radius * The radius to set. */ public void setRadius(final double radius) { _radius = radius; _radius2 = radius; allocateVertices(); }
/** * Change the radius of this cylinder. This resets any second radius. * * @param radius * The radius to set. */ public void setRadius(final double radius) { _radius = radius; _radius2 = radius; allocateVertices(); }
/** * @param height * The height to set. */ public void setHeight(final double height) { _height = height; allocateVertices(); }
/** * Set the top radius of the 'cylinder' to differ from the bottom radius. * * @param radius * The first radius to set. * @see com.ardor3d.extension.shape.Cone */ public void setRadius1(final double radius) { _radius = radius; allocateVertices(); }
/** * Set the bottom radius of the 'cylinder' to differ from the top radius. This makes the Mesh be a frustum of * pyramid, or if set to 0, a cone. * * @param radius * The second radius to set. * @see com.ardor3d.extension.shape.Cone */ public void setRadius2(final double radius) { _radius2 = radius; allocateVertices(); }