/** * Since splines require at least 4 points to interpolate correctly the default maximum value is overridden to 1 * less than normal. */ @Override protected int getMaximumIndex() { return super.getMaximumIndex() - 1; }
/** * Since splines require at least 4 points to interpolate correctly the default minimum value is overridden to 1 * more than normal. */ @Override protected int getMinimumIndex() { return super.getMinimumIndex() + 1; }
@Override public void reset() { super.reset(); _distance = 0.0; }
final ReadOnlyVector3 interpolated = interpolateVectors(from, to, delta, target); switch (getUpdateField()) { case LOCAL_SCALE: caller.setScale(interpolated);
@Override protected int incrementIndex() { assert (null != _arcLengths) : "You need to call generateArcLengths() to create the required arc length tables!"; _distance -= _arcLengths.getLength(getIndex()); return super.incrementIndex(); }
@Override public void setConstantSpeed(final boolean constantSpeed) { super.setConstantSpeed(constantSpeed); if (isConstantSpeed() && null == _arcLengths) { LOGGER .warning("Constant speed was set to true, you will need to call generateArcLengths() to avoid errors during update."); } }
@Override protected int decrementIndex() { assert (null != _arcLengthsReverse) : "You need to call generateArcLengths() to create the required arc length tables!"; _distance -= _arcLengthsReverse.getLength(getIndex()); return super.decrementIndex(); }
@Override protected double incrementDelta(final double by) { double delta; /* * If constant speed we need to also check we aren't clamped at max index before we call lookup in the arc * length table because there would be no point */ if (isConstantSpeed()) { _distance += by; if (isCycleForward()) { assert (null != _arcLengths) : "You need to call generateArcLengths(x, false) to create the required arc length table!"; delta = _arcLengths.getDelta(getIndex(), _distance); } else { assert (null != _arcLengthsReverse) : "You need to call generateArcLengths(x, true) to create the required reverse arc length table!"; delta = _arcLengthsReverse.getDelta(getIndex(), _distance); } setDelta(delta); } else { delta = super.incrementDelta(by); } return delta; }
final ReadOnlyVector3 interpolated = interpolateVectors(from, to, delta, target); switch (getUpdateField()) { case LOCAL_SCALE: caller.setScale(interpolated);
@Override protected int incrementIndex() { assert (null != _arcLengths) : "You need to call generateArcLengths() to create the required arc length tables!"; _distance -= _arcLengths.getLength(getIndex()); return super.incrementIndex(); }
@Override public void setConstantSpeed(final boolean constantSpeed) { super.setConstantSpeed(constantSpeed); if (isConstantSpeed() && null == _arcLengths) { LOGGER .warning("Constant speed was set to true, you will need to call generateArcLengths() to avoid errors during update."); } }
@Override protected int decrementIndex() { assert (null != _arcLengthsReverse) : "You need to call generateArcLengths() to create the required arc length tables!"; _distance -= _arcLengthsReverse.getLength(getIndex()); return super.decrementIndex(); }
@Override protected double incrementDelta(final double by) { double delta; /* * If constant speed we need to also check we aren't clamped at max index before we call lookup in the arc * length table because there would be no point */ if (isConstantSpeed()) { _distance += by; if (isCycleForward()) { assert (null != _arcLengths) : "You need to call generateArcLengths(x, false) to create the required arc length table!"; delta = _arcLengths.getDelta(getIndex(), _distance); } else { assert (null != _arcLengthsReverse) : "You need to call generateArcLengths(x, true) to create the required reverse arc length table!"; delta = _arcLengthsReverse.getDelta(getIndex(), _distance); } setDelta(delta); } else { delta = super.incrementDelta(by); } return delta; }
@Override public void reset() { super.reset(); _distance = 0.0; }
/** * Since splines require at least 4 points to interpolate correctly the default maximum value is overridden to 1 * less than normal. */ @Override protected int getMaximumIndex() { return super.getMaximumIndex() - 1; }
/** * Since splines require at least 4 points to interpolate correctly the default minimum value is overridden to 1 * more than normal. */ @Override protected int getMinimumIndex() { return super.getMinimumIndex() + 1; }