/** * Interpolates between the given colors using the * {@link ColorRGBA#lerpLocal(ReadOnlyColorRGBA, ReadOnlyColorRGBA, float)} method. */ @Override protected void interpolate(final ReadOnlyColorRGBA from, final ReadOnlyColorRGBA to, final double delta, final Mesh caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final ColorRGBA color = ColorRGBA.fetchTempInstance().set(caller.getDefaultColor()); color.lerpLocal(from, to, (float) delta); caller.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); }
/** * Interpolates between the given colors using the * {@link ColorRGBA#lerpLocal(ReadOnlyColorRGBA, ReadOnlyColorRGBA, float)} method. */ @Override protected void interpolate(final ReadOnlyColorRGBA from, final ReadOnlyColorRGBA to, final double delta, final Mesh caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final ColorRGBA color = ColorRGBA.fetchTempInstance().set(caller.getDefaultColor()); color.lerpLocal(from, to, (float) delta); caller.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); }
public void draw(final Renderer renderer, final ReadOnlyTransform xform) { if (getSelectionLength() == 0) { return; } // set our alpha final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(_standin.getDefaultColor()).setAlpha(UIComponent.getCurrentOpacity()); _standin.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); // set our location _standin.setWorldTransform(xform); // draw _standin.render(renderer); }
public void draw(final Renderer renderer, final ReadOnlyTransform xform) { if (getSelectionLength() == 0) { return; } // set our alpha final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(_standin.getDefaultColor()).setAlpha(UIComponent.getCurrentOpacity()); _standin.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); // set our location _standin.setWorldTransform(xform); // draw _standin.render(renderer); }
public void update(final double time, final Spatial caller) { if (_target == null) { return; } final ColorRGBA color = ColorRGBA.fetchTempInstance().set(_target.getDefaultColor()); float alpha = color.getAlpha(); alpha += _rate * time; if (_dir && alpha <= _targetAlpha) { alpha = _targetAlpha; } else if (!_dir && alpha >= _targetAlpha) { alpha = _targetAlpha; } if (alpha != 0) { _target.getSceneHints().setCullHint(CullHint.Inherit); } else { _target.getSceneHints().setCullHint(CullHint.Always); } color.setAlpha(alpha); _target.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); if (alpha == _targetAlpha) { _target.removeController(this); // enable gc _target = null; } }
public void update(final double time, final Spatial caller) { if (_target == null) { return; } final ColorRGBA color = ColorRGBA.fetchTempInstance().set(_target.getDefaultColor()); float alpha = color.getAlpha(); alpha += _rate * time; if (_dir && alpha <= _targetAlpha) { alpha = _targetAlpha; } else if (!_dir && alpha >= _targetAlpha) { alpha = _targetAlpha; } if (alpha != 0) { _target.getSceneHints().setCullHint(CullHint.Inherit); } else { _target.getSceneHints().setCullHint(CullHint.Always); } color.setAlpha(alpha); _target.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); if (alpha == _targetAlpha) { _target.removeController(this); // enable gc _target = null; } }
final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(1, 1, 1, getCombinedOpacity()); _standin.setDefaultColor(color);
final ColorRGBA bgColor = ColorRGBA.fetchTempInstance().set(_textureRenderer.getBackgroundColor()); if (_minimalBackground) { bgColor.setAlpha(0);
final ColorRGBA bgColor = ColorRGBA.fetchTempInstance().set(_textureRenderer.getBackgroundColor()); if (_minimalBackground) { bgColor.setAlpha(0);
final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(1, 1, 1, getCombinedOpacity()); _standin.setDefaultColor(color);
final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance(); if (tintOverride != null) { defaultColor.set(tintOverride);
final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance(); if (tintOverride != null) { defaultColor.set(tintOverride);
final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance(); if (subTex.getTint() != null) { defaultColor.set(subTex.getTint());
final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance(); if (subTex.getTint() != null) { defaultColor.set(subTex.getTint());
final ColorRGBA clr6 = ColorRGBA.fetchTempInstance(); clr6.set(clr1); assertEquals(clr1, clr6);