示例#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);
        }
示例#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);
        }
示例#3
0
文件: Curve.cs 项目: ByteChkR/Byt3
        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);
        }
示例#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);
        }
示例#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();
 }
示例#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();
 }
示例#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();
 }
示例#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)
 {
 }
示例#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)
 {
 }
示例#10
0
文件: Curve.cs 项目: ByteChkR/Byt3
 /// <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);
示例#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)
 {
 }
示例#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));
 }
示例#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)
 {
 }
示例#14
0
文件: Curve.cs 项目: ByteChkR/Byt3
 /// <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);
示例#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)
 {
 }
示例#16
0
文件: Curve.cs 项目: ByteChkR/Byt3
 /// <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);
示例#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)
 {
 }
示例#18
0
文件: Curve.cs 项目: ByteChkR/Byt3
 /// <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);
示例#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)
 {
 }