Package WildMagic.LibFoundation.Curves
Class MultipleCurve3
- java.lang.Object
-
- WildMagic.LibFoundation.Curves.Curve3f
-
- WildMagic.LibFoundation.Curves.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class WildMagic.LibFoundation.Curves.Curve3f
Curve3f.PointList
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]
m_afAccumLength
protected float[]
m_afLength
protected float[]
m_afTime
Array of time valuesprotected int
m_iSegments
Number of segmentsprivate static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
MultipleCurve3(int iSegments, float[] afTime)
Create a segment-based 3D curve.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
GetKeyInfo(float fTime, int[] riKey, float[] rfDt)
Helper methodfloat
GetLength(float fT0, float fT1)
Get the arc length of the curve for the specified interval of times within the specified segment.protected abstract float
GetLengthKey(int iKey, float fT0, float fT1)
Get the (integrated) length for a key over a time interval.int
GetSegments()
Accessorprotected abstract float
GetSpeedKey(int iKey, float fTime)
Get the speed (velocity) for a key and timeprotected float
GetSpeedWithData(float fTime, Curve3f pvData)
Helper methodfloat
GetTime(float fLength, int iIterations, float fTolerance)
Re-parameterize the curve where the time value is defined as a function of arc length.float[]
GetTimes()
Accessorfloat
GetVariation(float fT0, float fT1, Vector3f pkP0, Vector3f pkP1)
Subdivision by variation.protected abstract float
GetVariationKey(int iKey, float fT0, float fT1, Vector3f rkA, Vector3f rkB)
Get variation for a key over a time interval.protected void
InitializeLength()
Helper methodfloat
Integrate(float fTime)
-
Methods inherited from class WildMagic.LibFoundation.Curves.Curve3f
GetBinormal, GetCurvature, GetFirstDerivative, GetFrame, GetMaxTime, GetMinTime, GetNormal, GetPosition, GetSecondDerivative, GetSpeed, GetTangent, GetThirdDerivative, GetTime, GetTorsion, GetTotalLength, SetTimeInterval, SubdivideByLength, SubdivideByTime, SubdivideByVariation, SubdivideByVariation
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 classCurve3f
- 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 classCurve3f
- 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 methodfTolerance
- 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 classCurve3f
- Parameters:
fT0
- point 0fT1
- point 1pkP0
- curvature at point 0, may be nullpkP1
- curvature at point 1, may be null- See Also:
Curve3f.SubdivideByVariation(float, int, int, Vector3f[])
-
Integrate
public float Integrate(float fTime)
- Specified by:
Integrate
in interfaceIntegrateInterface
-
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 keyfT0
- start timefT1
- 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 keyfTime
- 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 keyfT0
- start timefT1
- end timerkA
- ??rkB
- ??- Returns:
- variation
-
InitializeLength
protected void InitializeLength()
Helper method
-
-