/** * @return The final control point, will not be <code>null</code>. */ protected ReadOnlyVector3 getCotnrolPointEnd() { ReadOnlyVector3 control = null; final int toIndex = getIndex(); switch (getRepeatType()) { case CLAMP: control = getControls().get(toIndex + 2); break; case CYCLE: if (isCycleForward()) { control = getControls().get(toIndex + 2); } else { control = getControls().get(toIndex - 2); } break; case WRAP: control = getControls().get(toIndex + 2); break; } return control; }
/** * @return The initial control point, will not be <code>null</code>. */ protected ReadOnlyVector3 getControlPointStart() { ReadOnlyVector3 control = null; final int fromIndex = getIndex(); switch (getRepeatType()) { case CLAMP: control = getControls().get(fromIndex - 1); break; case CYCLE: if (isCycleForward()) { control = getControls().get(fromIndex - 1); } else { control = getControls().get(fromIndex + 1); } break; case WRAP: control = getControls().get(fromIndex - 1); break; } return control; }
/** * @return The final control point, will not be <code>null</code>. */ protected ReadOnlyVector3 getCotnrolPointEnd() { ReadOnlyVector3 control = null; final int toIndex = getIndex(); switch (getRepeatType()) { case CLAMP: control = getControls().get(toIndex + 2); break; case CYCLE: if (isCycleForward()) { control = getControls().get(toIndex + 2); } else { control = getControls().get(toIndex - 2); } break; case WRAP: control = getControls().get(toIndex + 2); break; } return control; }
/** * @return The initial control point, will not be <code>null</code>. */ protected ReadOnlyVector3 getControlPointStart() { ReadOnlyVector3 control = null; final int fromIndex = getIndex(); switch (getRepeatType()) { case CLAMP: control = getControls().get(fromIndex - 1); break; case CYCLE: if (isCycleForward()) { control = getControls().get(fromIndex - 1); } else { control = getControls().get(fromIndex + 1); } break; case WRAP: control = getControls().get(fromIndex - 1); break; } return control; }
@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 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; }