/** * @return The number of control points in this curve. */ public int getControlPointCount() { return getControlPoints().size(); }
/** * @return The number of control points in this curve. */ public int getControlPointCount() { return getControlPoints().size(); }
/** * Setting a new curve will automatically update the control points. * * @param curve * The new curve to follow, can not be <code>null</code>. * @see #getCurve() */ public void setCurve(final Curve curve) { if (null == curve) { throw new IllegalArgumentException("curve can not be null!"); } _curve = curve; setControls(_curve.getControlPoints()); if (isConstantSpeed()) { LOGGER .warning("Constant speed is set to true, you will need to call generateArcLengths() to avoid errors during update."); } }
/** * Setting a new curve will automatically update the control points. * * @param curve * The new curve to follow, can not be <code>null</code>. * @see #getCurve() */ public void setCurve(final Curve curve) { if (null == curve) { throw new IllegalArgumentException("curve can not be null!"); } _curve = curve; setControls(_curve.getControlPoints()); if (isConstantSpeed()) { LOGGER .warning("Constant speed is set to true, you will need to call generateArcLengths() to avoid errors during update."); } }
/** * Interpolates between the control points at the given indices. * * @param start * The index of the control point to start from. * @param end * The index of the control point to end at. * @param t * Should be between zero and one. Zero will return point <code>start</code> while one will return * <code>end</code>, a value in between will return an interpolated vector between the two. * @param result * The result of the interpolation will be stored in this vector. * @return The result vector as a convenience. */ public ReadOnlyVector3 interpolate(final int start, final int end, final double t, final Vector3 result) { if (start <= 0) { throw new IllegalArgumentException("start must be > 0! start=" + start); } if (end >= (getControlPointCount() - 1)) { throw new IllegalArgumentException("end must be < " + (getControlPointCount() - 1) + "! end=" + end); } final List<ReadOnlyVector3> points = getControlPoints(); return getSpline().interpolate(points.get(start - 1), points.get(start), points.get(end), points.get(end + 1), t, result); }
final List<ReadOnlyVector3> controlPoints = getControlPoints();
/** * Interpolates between the control points at the given indices. * * @param start * The index of the control point to start from. * @param end * The index of the control point to end at. * @param t * Should be between zero and one. Zero will return point <code>start</code> while one will return * <code>end</code>, a value in between will return an interpolated vector between the two. * @param result * The result of the interpolation will be stored in this vector. * @return The result vector as a convenience. */ public ReadOnlyVector3 interpolate(final int start, final int end, final double t, final Vector3 result) { if (start <= 0) { throw new IllegalArgumentException("start must be > 0! start=" + start); } if (end >= (getControlPointCount() - 1)) { throw new IllegalArgumentException("end must be < " + (getControlPointCount() - 1) + "! end=" + end); } final List<ReadOnlyVector3> points = getControlPoints(); return getSpline().interpolate(points.get(start - 1), points.get(start), points.get(end), points.get(end + 1), t, result); }
final List<ReadOnlyVector3> controlPoints = getControlPoints();
double length = 0; previous.set(_curve.getControlPoints().get(i));
double length = 0; previous.set(_curve.getControlPoints().get(i));