Beispiel #1
0
        /// <summary>
        /// Adds a new control point to the curve.
        /// </summary>
        /// <param name="time">Time of the new control point.</param>
        /// <param name="value">Value of the new control point.</param>
        /// <returns>Newly created control point.</returns>
        public CurveControlPoint <TValue> Add(float time, TValue value)
        {
            CurveControlPoint <TValue> toAdd = new CurveControlPoint <TValue>(time, value, Curve);

            Add(toAdd);
            return(toAdd);
        }
Beispiel #2
0
        /// <summary>
        /// Removes the control point from the curve.
        /// </summary>
        /// <param name="index">Index to remove at.</param>
        public void RemoveAt(int index)
        {
            CurveControlPoint <TValue> removed = list[index];

            list.RemoveAt(index);
            Curve.ControlPointRemoved(removed, index);
        }
Beispiel #3
0
        internal void InternalControlPointTimeChanged(CurveControlPoint <TValue> controlPoint)
        {
            int oldIndex = ControlPoints.list.IndexOf(controlPoint);

            ControlPoints.list.RemoveAt(oldIndex);
            int index = GetPreviousIndex(controlPoint.Time) + 1;

            ControlPoints.list.Insert(index, controlPoint);
            ControlPointTimeChanged(controlPoint, oldIndex, index);
        }
Beispiel #4
0
        /// <summary>
        /// Adds a control point to the curve.
        /// </summary>
        /// <param name="point">New control point to add to the curve.</param>
        public void Add(CurveControlPoint <TValue> point)
        {
            int index = Curve.GetPreviousIndex(point.Time) + 1;

            //TODO: Test for time-wise duplicate?
            //IndexA would be the one that's possibly duplicated.
            //Even with duplicate, this is still technically sorted.
            list.Insert(index, point);
            Curve.ControlPointAdded(point, index);
        }
Beispiel #5
0
 /// <summary>
 /// Called when a control point belonging to the curve has its value changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 protected internal override void ControlPointValueChanged(CurveControlPoint <Vector3> curveControlPoint)
 {
     tangents.Clear();
     ComputeTangents();
 }
Beispiel #6
0
 /// <summary>
 /// Called when a control point belonging to the curve has its time changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 /// <param name="oldIndex">Old index of the control point.</param>
 /// <param name="newIndex">New index of the control point.</param>
 protected internal override void ControlPointTimeChanged(CurveControlPoint <Vector3> curveControlPoint,
                                                          int oldIndex, int newIndex)
 {
     tangents.Clear();
     ComputeTangents();
 }
Beispiel #7
0
 /// <summary>
 /// Called when a control point is added.
 /// </summary>
 /// <param name="curveControlPoint">New control point.</param>
 /// <param name="index">Index of the control point.</param>
 protected internal override void ControlPointAdded(CurveControlPoint <Vector3> curveControlPoint, int index)
 {
     tangents.Clear();
     ComputeTangents();
 }
Beispiel #8
0
 /// <summary>
 /// Called when a control point belonging to the curve has its value changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 protected internal override void ControlPointValueChanged(CurveControlPoint <Vector3> curveControlPoint)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Called when a control point is removed.
 /// </summary>
 /// <param name="curveControlPoint">Removed control point.</param>
 /// <param name="oldIndex">Index of the control point before it was removed.</param>
 protected internal override void ControlPointRemoved(CurveControlPoint <Quaternion> curveControlPoint,
                                                      int oldIndex)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Called when a control point belonging to the curve has its time changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 /// <param name="oldIndex">Old index of the control point.</param>
 /// <param name="newIndex">New index of the control point.</param>
 protected internal abstract void ControlPointTimeChanged(CurveControlPoint <TValue> curveControlPoint,
                                                          int oldIndex, int newIndex);
Beispiel #11
0
 /// <summary>
 /// Called when a control point is added.
 /// </summary>
 /// <param name="curveControlPoint">New control point.</param>
 /// <param name="index">Index of the control point.</param>
 protected internal override void ControlPointAdded(CurveControlPoint <Vector3> curveControlPoint, int index)
 {
 }
Beispiel #12
0
 /// <summary>
 /// Removes the control point from the curve.
 /// </summary>
 /// <param name="controlPoint">Control point to remove.</param>
 public void Remove(CurveControlPoint <TValue> controlPoint)
 {
     RemoveAt(list.IndexOf(controlPoint));
 }
Beispiel #13
0
 /// <summary>
 /// Called when a control point belonging to the curve has its value changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 protected internal override void ControlPointValueChanged(CurveControlPoint <Quaternion> curveControlPoint)
 {
 }
Beispiel #14
0
 /// <summary>
 /// Called when a control point is added.
 /// </summary>
 /// <param name="curveControlPoint">New control point.</param>
 /// <param name="index">Index of the control point.</param>
 protected internal abstract void ControlPointAdded(CurveControlPoint <TValue> curveControlPoint, int index);
Beispiel #15
0
 /// <summary>
 /// Called when a control point is removed.
 /// </summary>
 /// <param name="curveControlPoint">Removed control point.</param>
 /// <param name="oldIndex">Index of the control point before it was removed.</param>
 protected internal override void ControlPointRemoved(CurveControlPoint <Vector3> curveControlPoint, int oldIndex)
 {
 }
Beispiel #16
0
 /// <summary>
 /// Called when a control point is removed.
 /// </summary>
 /// <param name="curveControlPoint">Removed control point.</param>
 /// <param name="oldIndex">Index of the control point before it was removed.</param>
 protected internal abstract void ControlPointRemoved(CurveControlPoint <TValue> curveControlPoint, int oldIndex);
Beispiel #17
0
 /// <summary>
 /// Called when a control point belonging to the curve has its time changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 /// <param name="oldIndex">Old index of the control point.</param>
 /// <param name="newIndex">New index of the control point.</param>
 protected internal override void ControlPointTimeChanged(CurveControlPoint <Vector3> curveControlPoint,
                                                          int oldIndex, int newIndex)
 {
 }
Beispiel #18
0
 /// <summary>
 /// Called when a control point belonging to the curve has its value changed.
 /// </summary>
 /// <param name="curveControlPoint">Changed control point.</param>
 protected internal abstract void ControlPointValueChanged(CurveControlPoint <TValue> curveControlPoint);
Beispiel #19
0
 /// <summary>
 /// Called when a control point is added.
 /// </summary>
 /// <param name="curveControlPoint">New control point.</param>
 /// <param name="index">Index of the control point.</param>
 protected internal override void ControlPointAdded(CurveControlPoint <Quaternion> curveControlPoint, int index)
 {
 }