public Arrow(final String name, final double length, final double width) { super(name); _length = length; _width = width; buildArrow(); }
public void setSolidColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setSolidColor(color); } } }
protected void buildAxis() { xAxis = new Arrow("_xAxis", length, width); xAxis.setDefaultColor(xAxisColor); xAxis.setRotation(new Matrix3().fromAngles(0, 0, -90 * MathUtils.DEG_TO_RAD)); xAxis.setTranslation(length * .5, 0, 0); attachChild(xAxis); yAxis = new Arrow("yAxis", length, width); yAxis.setDefaultColor(yAxisColor); yAxis.setTranslation(0, length * .5, 0); attachChild(yAxis); zAxis = new Arrow("zAxis", length, width); zAxis.setDefaultColor(zAxisColor); if (rightHanded) { zAxis.setRotation(new Matrix3().fromAngles(90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, length * .5); } else { zAxis.setRotation(new Matrix3().fromAngles(-90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, -length * .5); } attachChild(zAxis); }
public SimpleScaleWidget withArrow(final ReadOnlyVector3 arrowDirection, final ReadOnlyColorRGBA color, final double lengthGap, final double tipGap) { _arrowDirection = new Vector3(arrowDirection); _handle = new InteractArrow("scaleHandle", 1.0, 0.125, lengthGap, tipGap); if (!_arrowDirection.equals(Vector3.UNIT_Z)) { _handle.setRotation(new Quaternion().fromVectorToVector(Vector3.UNIT_Z, _arrowDirection)); } final BlendState blend = new BlendState(); blend.setBlendEnabled(true); _handle.setRenderState(blend); ((Arrow) _handle).setDefaultColor(color); final ZBufferState zstate = new ZBufferState(); zstate.setWritable(false); zstate.setFunction(TestFunction.Always); _handle.setRenderState(zstate); _handle.getSceneHints().setRenderBucketType(RenderBucketType.PostBucket); _handle.updateGeometricState(0); return this; }
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(); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _lengthGap = capsule.readDouble("lengthGap", 0); _tipGap = capsule.readDouble("tipGap", 0); } }
protected void buildAxis() { xAxis = new Arrow("_xAxis", length, width); xAxis.setDefaultColor(xAxisColor); xAxis.setRotation(new Matrix3().fromAngles(0, 0, -90 * MathUtils.DEG_TO_RAD)); xAxis.setTranslation(length * .5, 0, 0); attachChild(xAxis); yAxis = new Arrow("yAxis", length, width); yAxis.setDefaultColor(yAxisColor); yAxis.setTranslation(0, length * .5, 0); attachChild(yAxis); zAxis = new Arrow("zAxis", length, width); zAxis.setDefaultColor(zAxisColor); if (rightHanded) { zAxis.setRotation(new Matrix3().fromAngles(90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, length * .5); } else { zAxis.setRotation(new Matrix3().fromAngles(-90 * MathUtils.DEG_TO_RAD, 0, 0)); zAxis.setTranslation(0, 0, -length * .5); } attachChild(zAxis); }
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 void setSolidColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setSolidColor(color); } } }
public Arrow(final String name, final double length, final double width) { super(name); _length = length; _width = width; buildArrow(); }
public void setDefaultColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setDefaultColor(color); } } }
public void setDefaultColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setDefaultColor(color); } } }