Class NaturalSpline3

  • All Implemented Interfaces:
    java.io.Serializable, IntegrateInterface

    public class NaturalSpline3
    extends MultipleCurve3
    implements java.io.Serializable
    This is an implementation for a curve in 3D defined by a natural spline. The spline is defined to pass through an input set of control points with an associated set of time values (any range).
    See Also:
    Serialized Form
    • Field Detail

      • m_akA

        protected Vector3f[] m_akA
        Points along the curve
      • m_akB

        protected Vector3f[] m_akB
        Data, relates to first derivative
      • m_akC

        protected Vector3f[] m_akC
        Data, relates to second derivative
      • m_akD

        protected Vector3f[] m_akD
        Data, relates to third derivative
    • Constructor Detail

      • NaturalSpline3

        public NaturalSpline3​(NaturalSpline3.BoundaryType eType,
                              int iSegments,
                              float[] afTime,
                              Vector3f[] akPoint)
        Create a natural spline curve in 3D through the set of input points. Automatically compute the "times" associated with each point based on the accumulated distance between the points.
        Parameters:
        eType - Type of curve to create
        iSegments - number of segments
        afTime - times for each segment
        akPoint - Array of 3D points along curve.
    • Method Detail

      • GetFirstDerivative

        public Vector3f GetFirstDerivative​(float fTime)
        Description copied from class: Curve3f
        Get the 3D coordinates of the 1st derivative vector at the point along the curve evaluated for the input time value.
        Specified by:
        GetFirstDerivative in class Curve3f
        Parameters:
        fTime - Input time value which must be within the range for which this curve is defined.
        Returns:
        New instance created to contain the 3D coordinates of the computed 1st derivative vector. If the time value is less than getMinTime() then the 1st derivative vector at the start of the curve is returned. If the time value is greater than getMaxTime() then the 1st derivative vector at the end of the curve is returned.
      • GetLengthKey

        public float GetLengthKey​(int iKey,
                                  float fT0,
                                  float fT1)
        Description copied from class: MultipleCurve3
        Get the (integrated) length for a key over a time interval.
        Specified by:
        GetLengthKey in class MultipleCurve3
        Parameters:
        iKey - input key
        fT0 - start time
        fT1 - end time
        Returns:
        length
      • GetPoints

        public Vector3f[] GetPoints()
        Accessor
        Returns:
        reference to points array
      • GetPosition

        public Vector3f GetPosition​(float fTime)
        Description copied from class: Curve3f
        Get the 3D coordinates of the position along the curve evaluated for the input time value.
        Specified by:
        GetPosition in class Curve3f
        Parameters:
        fTime - Input time value which must be within the range for which this curve is defined.
        Returns:
        New instance created to contain the 3D coordinates of the computed position. If the time value is less than getMinTime() then the coordinates of the point at the start of the curve is returned. If the time value is greater than getMaxTime() then the coordinates of the point at the end of the curve is returned.
      • GetSecondDerivative

        public Vector3f GetSecondDerivative​(float fTime)
        Description copied from class: Curve3f
        Get the 3D coordinates of the 2nd derivative vector at the point along the curve evaluated for the input time value.
        Specified by:
        GetSecondDerivative in class Curve3f
        Parameters:
        fTime - Input time value which must be within the range for which this curve is defined.
        Returns:
        New instance created to contain the 3D coordinates of the computed 1st derivative vector. If the time value is less than getMinTime() then the 2nd derivative vector at the start of the curve is returned. If the time value is greater than getMaxTime() then the 2nd derivative vector at the end of the curve is returned.
      • GetSpeedKey

        public float GetSpeedKey​(int iKey,
                                 float fTime)
        Description copied from class: MultipleCurve3
        Get the speed (velocity) for a key and time
        Specified by:
        GetSpeedKey in class MultipleCurve3
        Parameters:
        iKey - input key
        fTime - input time
        Returns:
        speed at this key and time.
      • GetVariationKey

        public float GetVariationKey​(int iKey,
                                     float fT0,
                                     float fT1,
                                     Vector3f rkA,
                                     Vector3f rkB)
        Description copied from class: MultipleCurve3
        Get variation for a key over a time interval.
        Specified by:
        GetVariationKey in class MultipleCurve3
        Parameters:
        iKey - input key
        fT0 - start time
        fT1 - end time
        rkA - ??
        rkB - ??
        Returns:
        variation
      • CreateClampedSpline

        protected void CreateClampedSpline()
        Constructor helper
      • CreateClosedSpline

        protected void CreateClosedSpline()
        Constructor helper
      • CreateFreeSpline

        protected void CreateFreeSpline()
        Constructor helper