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 class
NaturalSpline3.BoundaryType
protected class
NaturalSpline3.ThisPlusKey
helper 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_akA
Points along the curveprotected Vector3f[]
m_akB
Data, relates to first derivativeprotected Vector3f[]
m_akC
Data, relates to second derivativeprotected Vector3f[]
m_akD
Data, relates to third derivativeprivate static long
serialVersionUID
-
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 void
CreateClampedSpline()
Constructor helperprotected void
CreateClosedSpline()
Constructor helperprotected void
CreateFreeSpline()
Constructor helperVector3f
GetFirstDerivative(float fTime)
Get the 3D coordinates of the 1st derivative vector at the point along the curve evaluated for the input time value.float
GetLengthKey(int iKey, float fT0, float fT1)
Get the (integrated) length for a key over a time interval.Vector3f[]
GetPoints()
AccessorVector3f
GetPosition(float fTime)
Get the 3D coordinates of the position along the curve evaluated for the input time value.Vector3f
GetSecondDerivative(float fTime)
Get the 3D coordinates of the 2nd derivative vector at the point along the curve evaluated for the input time value.float
GetSpeedKey(int iKey, float fTime)
Get the speed (velocity) for a key and timeVector3f
GetThirdDerivative(float fTime)
float
GetVariationKey(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: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 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:MultipleCurve3
Get the (integrated) length for a key over a time interval.- Specified by:
GetLengthKey
in 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:Curve3f
Get the 3D coordinates of the position along the curve evaluated for the input time value.- Specified by:
GetPosition
in 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: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 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:MultipleCurve3
Get the speed (velocity) for a key and time- Specified by:
GetSpeedKey
in classMultipleCurve3
- Parameters:
iKey
- input keyfTime
- input time- Returns:
- speed at this key and time.
-
GetThirdDerivative
public Vector3f GetThirdDerivative(float fTime)
- Specified by:
GetThirdDerivative
in classCurve3f
-
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 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
-
-