@Override public void targetDataUpdated(final InteractManager manager) { final Spatial target = manager.getSpatialTarget(); if (target == null) { _handle.setRotation(Matrix3.IDENTITY); } else { target.updateGeometricState(0); // update arrow rotations from target if (_interactMatrix == InteractMatrix.Local) { _handle.setRotation(target.getWorldRotation()); } else { _handle.setRotation(Matrix3.IDENTITY); } } _handle.setScale(calculateHandleScale(manager)); }
@Override public void targetDataUpdated(final InteractManager manager) { final Spatial target = manager.getSpatialTarget(); if (target == null) { _handle.setRotation(Matrix3.IDENTITY); } else { target.updateGeometricState(0); // update arrow rotations from target if (_interactMatrix == InteractMatrix.Local) { _handle.setRotation(target.getWorldRotation()); } else { _handle.setRotation(Matrix3.IDENTITY); } } _handle.setScale(calculateHandleScale(manager)); }
@Override public void targetDataUpdated(final InteractManager manager) { final Spatial target = manager.getSpatialTarget(); if (target == null) { _handle.setRotation(Matrix3.IDENTITY); } else { target.updateGeometricState(0); // update arrow rotations from target if (_interactMatrix == InteractMatrix.Local) { _handle.setRotation(target.getWorldRotation()); } else { _handle.setRotation(Matrix3.IDENTITY); } } _handle.setScale(calculateHandleScale(manager)); }
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; }