Class MultipleCurve3

  • All Implemented Interfaces:
    java.io.Serializable, IntegrateInterface
    Direct Known Subclasses:
    NaturalSpline3

    public abstract class MultipleCurve3
    extends Curve3f
    implements IntegrateInterface, java.io.Serializable
    This is an abstract interface for a curve in 3D. This interface builds upon that of the IntervalLengthCurve3f abstract interface by adding support for curves defined by segments. Each segment is defined by time values, the same ones used to define the length intervals used in the IntervalLengthCurve3f superclass.
    See Also:
    Serialized Form
    • Field Detail

      • m_iSegments

        protected int m_iSegments
        Number of segments
      • m_afTime

        protected final float[] m_afTime
        Array of time values
      • m_afLength

        protected float[] m_afLength
      • m_afAccumLength

        protected float[] m_afAccumLength
    • Constructor Detail

      • MultipleCurve3

        protected MultipleCurve3​(int iSegments,
                                 float[] afTime)
        Create a segment-based 3D curve.
        Parameters:
        afTime - float[] Array of time values associated with the segments. These times values must be increasing where the first and last values in the array define the minimum and maximum input time values, respectively.
    • Method Detail

      • GetLength

        public float GetLength​(float fT0,
                               float fT1)
        Get the arc length of the curve for the specified interval of times within the specified segment.
        Specified by:
        GetLength in class Curve3f
        Parameters:
        fT0 - Minimum time of the specified interval. This time is relative to the starting time of the specified segment.
        fT1 - Maximum time of the specified interval. This time is relative to the starting time of the specified segment.
        Returns:
        Computed arc length.
      • GetSegments

        public int GetSegments()
        Accessor
        Returns:
        number of segments
      • GetTime

        public float GetTime​(float fLength,
                             int iIterations,
                             float fTolerance)
        Description copied from class: Curve3f
        Re-parameterize the curve where the time value is defined as a function of arc length. Location the time value associated with this arc length along the curve.
        Specified by:
        GetTime in class Curve3f
        Parameters:
        fLength - Input arc length for which the associated time is to be determined. This length is measured from the starting point of the curve which is at the getMinTime().
        iIterations - iterations to run Newton's method
        fTolerance - tolerance for early termination
        Returns:
        Time value associated with this arc length along the curve. The returned value is always within the range of getMinTime() and getMaxTime().
      • GetTimes

        public float[] GetTimes()
        Accessor
        Returns:
        array of segment times
      • GetVariation

        public float GetVariation​(float fT0,
                                  float fT1,
                                  Vector3f pkP0,
                                  Vector3f pkP1)
        Description copied from class: Curve3f
        Subdivision by variation. The pointers pkP0 and pkP1 correspond to the curve points at fT0 and fT1. If the pointer values are not null, the assumption is that the caller has passed in the curve points. Otherwise, the function computes the curve points.
        Specified by:
        GetVariation in class Curve3f
        Parameters:
        fT0 - point 0
        fT1 - point 1
        pkP0 - curvature at point 0, may be null
        pkP1 - curvature at point 1, may be null
        See Also:
        Curve3f.SubdivideByVariation(float, int, int, Vector3f[])
      • GetKeyInfo

        protected void GetKeyInfo​(float fTime,
                                  int[] riKey,
                                  float[] rfDt)
        Helper method
      • GetLengthKey

        protected abstract float GetLengthKey​(int iKey,
                                              float fT0,
                                              float fT1)
        Get the (integrated) length for a key over a time interval.
        Parameters:
        iKey - input key
        fT0 - start time
        fT1 - end time
        Returns:
        length
      • GetSpeedKey

        protected abstract float GetSpeedKey​(int iKey,
                                             float fTime)
        Get the speed (velocity) for a key and time
        Parameters:
        iKey - input key
        fTime - input time
        Returns:
        speed at this key and time.
      • GetSpeedWithData

        protected float GetSpeedWithData​(float fTime,
                                         Curve3f pvData)
        Helper method
      • GetVariationKey

        protected abstract float GetVariationKey​(int iKey,
                                                 float fT0,
                                                 float fT1,
                                                 Vector3f rkA,
                                                 Vector3f rkB)
        Get variation for a key over a time interval.
        Parameters:
        iKey - input key
        fT0 - start time
        fT1 - end time
        rkA - ??
        rkB - ??
        Returns:
        variation
      • InitializeLength

        protected void InitializeLength()
        Helper method