Package WildMagic.LibFoundation.Curves
Class NaturalSpline3
- java.lang.Object
-
- WildMagic.LibFoundation.Curves.Curve3f
-
- WildMagic.LibFoundation.Curves.MultipleCurve3
-
- WildMagic.LibFoundation.Curves.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNaturalSpline3.BoundaryTypeprotected classNaturalSpline3.ThisPlusKeyhelper for GetLengthKey()-
Nested classes/interfaces inherited from class WildMagic.LibFoundation.Curves.Curve3f
Curve3f.PointList
-
-
Field Summary
Fields Modifier and Type Field Description protected Vector3f[]m_akAPoints along the curveprotected Vector3f[]m_akBData, relates to first derivativeprotected Vector3f[]m_akCData, relates to second derivativeprotected Vector3f[]m_akDData, relates to third derivativeprivate static longserialVersionUID-
Fields inherited from class WildMagic.LibFoundation.Curves.MultipleCurve3
m_afAccumLength, m_afLength, m_afTime, m_iSegments
-
-
Constructor Summary
Constructors Constructor Description NaturalSpline3(NaturalSpline3.BoundaryType eType, int iSegments, float[] afTime, Vector3f[] akPoint)Create a natural spline curve in 3D through the set of input points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidCreateClampedSpline()Constructor helperprotected voidCreateClosedSpline()Constructor helperprotected voidCreateFreeSpline()Constructor helperVector3fGetFirstDerivative(float fTime)Get the 3D coordinates of the 1st derivative vector at the point along the curve evaluated for the input time value.floatGetLengthKey(int iKey, float fT0, float fT1)Get the (integrated) length for a key over a time interval.Vector3f[]GetPoints()AccessorVector3fGetPosition(float fTime)Get the 3D coordinates of the position along the curve evaluated for the input time value.Vector3fGetSecondDerivative(float fTime)Get the 3D coordinates of the 2nd derivative vector at the point along the curve evaluated for the input time value.floatGetSpeedKey(int iKey, float fTime)Get the speed (velocity) for a key and timeVector3fGetThirdDerivative(float fTime)floatGetVariationKey(int iKey, float fT0, float fT1, Vector3f rkA, Vector3f rkB)Get variation for a key over a time interval.-
Methods inherited from class WildMagic.LibFoundation.Curves.MultipleCurve3
GetKeyInfo, GetLength, GetSegments, GetSpeedWithData, GetTime, GetTimes, GetVariation, InitializeLength, Integrate
-
Methods inherited from class WildMagic.LibFoundation.Curves.Curve3f
GetBinormal, GetCurvature, GetFrame, GetMaxTime, GetMinTime, GetNormal, GetSpeed, GetTangent, GetTime, GetTorsion, GetTotalLength, SetTimeInterval, SubdivideByLength, SubdivideByTime, SubdivideByVariation, SubdivideByVariation
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 createiSegments- number of segmentsafTime- times for each segmentakPoint- Array of 3D points along curve.
-
-
Method Detail
-
GetFirstDerivative
public Vector3f GetFirstDerivative(float fTime)
Description copied from class:Curve3fGet the 3D coordinates of the 1st derivative vector at the point along the curve evaluated for the input time value.- Specified by:
GetFirstDerivativein classCurve3f- 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:MultipleCurve3Get the (integrated) length for a key over a time interval.- Specified by:
GetLengthKeyin classMultipleCurve3- Parameters:
iKey- input keyfT0- start timefT1- end time- Returns:
- length
-
GetPoints
public Vector3f[] GetPoints()
Accessor- Returns:
- reference to points array
-
GetPosition
public Vector3f GetPosition(float fTime)
Description copied from class:Curve3fGet the 3D coordinates of the position along the curve evaluated for the input time value.- Specified by:
GetPositionin classCurve3f- 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:Curve3fGet the 3D coordinates of the 2nd derivative vector at the point along the curve evaluated for the input time value.- Specified by:
GetSecondDerivativein classCurve3f- 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:MultipleCurve3Get the speed (velocity) for a key and time- Specified by:
GetSpeedKeyin classMultipleCurve3- Parameters:
iKey- input keyfTime- input time- Returns:
- speed at this key and time.
-
GetThirdDerivative
public Vector3f GetThirdDerivative(float fTime)
- Specified by:
GetThirdDerivativein classCurve3f
-
GetVariationKey
public float GetVariationKey(int iKey, float fT0, float fT1, Vector3f rkA, Vector3f rkB)Description copied from class:MultipleCurve3Get variation for a key over a time interval.- Specified by:
GetVariationKeyin classMultipleCurve3- Parameters:
iKey- input keyfT0- start timefT1- end timerkA- ??rkB- ??- Returns:
- variation
-
CreateClampedSpline
protected void CreateClampedSpline()
Constructor helper
-
CreateClosedSpline
protected void CreateClosedSpline()
Constructor helper
-
CreateFreeSpline
protected void CreateFreeSpline()
Constructor helper
-
-