Class CurvySpline
 Namespace
 FluffyUnderware.Curvy
Curvy Spline class
[AddComponentMenu("Curvy/Curvy Spline")]
[ExecuteAlways]
public class CurvySpline : DTVersionedMonoBehaviour
 Inheritance

ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourCurvySpline
 Derived
 Extension Methods
Constructors
CurvySpline()
public CurvySpline()
Fields
ShowGizmos
Whether to show the Gizmos enabled in the view settings or not at all
[HideInInspector]
public bool ShowGizmos
Field Value
Properties
AutoEndTangents
Whether the first/last Control Point should act as the end tangent, too.
public bool AutoEndTangents { get; set; }
Property Value
Remarks
Ignored by linear splines and Bezier ones
AutoHandleDistance
Gets or sets the default Handle distance for Bezier splines
public float AutoHandleDistance { get; set; }
Property Value
Bias
Global Bias
public float Bias { get; set; }
Property Value
Remarks
This only applies to TCB interpolation
Bounds
The bounding box of the spline, in world space
public Bounds Bounds { get; }
Property Value
 Bounds
BSplineDegree
Used only when Interpolation is BSpline The degree of the piecewise polynomial functions Is in the range [2; control points count  1]
public int BSplineDegree { get; set; }
Property Value
CacheDensity
Gets or sets the cache density Defines how densely the cached points are. When the value is 100, the number of cached points per world distance unit is equal to the spline's MaxPointsPerUnit
public int CacheDensity { get; set; }
Property Value
CacheSize
Gets total Cache Size
public int CacheSize { get; }
Property Value
CheckTransform
Whether the spline should automatically refresh when a Control Point's position change
public bool CheckTransform { get; set; }
Property Value
Remarks
Enable this if you animate a Control Point's transform!
Closed
Whether this spline is closed or not
public bool Closed { get; set; }
Property Value
Remarks
AutoEndTangents's value can be updated depending on Close value
Continuity
Global Continuity
public float Continuity { get; set; }
Property Value
Remarks
This only applies to TCB interpolation
ControlPointCount
Gets the number of Control Points
public int ControlPointCount { get; }
Property Value
ControlPointsList
The list of control points
public ReadOnlyCollection<CurvySplineSegment> ControlPointsList { get; }
Property Value
Count
Gets the number of Segments
public int Count { get; }
Property Value
Dirty
When a spline is dirty, this means that it's cached data is no more up to date, and should be updated. The update is done automatically each frame when needed, or manually by calling Refresh()
public bool Dirty { get; }
Property Value
FirstSegment
Gets the first segment of the spline
[CanBeNull]
public CurvySplineSegment FirstSegment { get; }
Property Value
FirstVisibleControlPoint
Gets the first visible Control Point (equals the first segment or this[0])
[CanBeNull]
public CurvySplineSegment FirstVisibleControlPoint { get; }
Property Value
Remarks
Can be null, for example for a CatmullRom spline whith only two splines and AutoEndTangent set to false
GizmoColor
Gets or sets Spline color
public Color GizmoColor { get; set; }
Property Value
 Color
GizmoSelectionColor
Gets or sets selected segment color
public Color GizmoSelectionColor { get; set; }
Property Value
 Color
GlobalCoordinatesChangedThisFrame
Returns true if the global position, rotation or scale of the spline has changed this frame
public bool GlobalCoordinatesChangedThisFrame { get; }
Property Value
 See Also
Interpolation
The interpolation method used by this spline
public CurvyInterpolation Interpolation { get; set; }
Property Value
Remarks
AutoEndTangents's value can be updated depending on Interpolation value
IsBSplineClamped
Used only when Interpolation is BSpline Make the curve pass through the first and last control points by increasing the multiplicity of the first and last knots. In technical terms, when this parameter is true, the knot vector is [0, 0, ...,0, 1, 2, ..., N1, N, N, ..., N]. When false, it is [0, 1, 2, ..., N1, N]
public bool IsBSplineClamped { get; set; }
Property Value
IsInitialized
Whether the spline is fully initialized and all segments loaded
public bool IsInitialized { get; }
Property Value
this[int]
Gets the Segment at a certain index
public CurvySplineSegment this[int idx] { get; }
Parameters
idx
intan index in the range 0..Count
Property Value
 CurvySplineSegment
the corresponding spline segment
LastSegment
Gets the last segment of the spline
[CanBeNull]
public CurvySplineSegment LastSegment { get; }
Property Value
LastVisibleControlPoint
Gets the last visible Control Point (i.e. the end CP of the last segment)
[CanBeNull]
public CurvySplineSegment LastVisibleControlPoint { get; }
Property Value
Remarks
Is null if spline has no segments
Length
Gets the total length of the Spline or SplineGroup
public float Length { get; }
Property Value
Remarks
The accuracy depends on the current Granularity (higher Granularity means more exact values)
MaxPointsPerUnit
The maximum number of sampling points per world distance unit. Sampling is used in caching or shape extrusion for example
public float MaxPointsPerUnit { get; set; }
Property Value
OnAfterControlPointAdd
Callback after a Control Point has been added and the spline was refreshed
public CurvyControlPointEvent OnAfterControlPointAdd { get; set; }
Property Value
OnAfterControlPointChanges
Callback after one or more Control Points have been added or deleted
public CurvySplineEvent OnAfterControlPointChanges { get; set; }
Property Value
Remarks
This executes last, after individual add/delete events and OnRefresh
OnBeforeControlPointAdd
Callback before a Control Point is about to be added
public CurvyControlPointEvent OnBeforeControlPointAdd { get; set; }
Property Value
OnBeforeControlPointDelete
Callback before a Control Point is about to be deleted. Return false to cancel the execution.
public CurvyControlPointEvent OnBeforeControlPointDelete { get; set; }
Property Value
OnGlobalCoordinatesChanged
Is triggered when the global position, rotation or scale of the spline changes. The triggering instance of CurvySpline is passed as a parameter of the delegate
[CanBeNull]
public Action<CurvySpline> OnGlobalCoordinatesChanged { get; set; }
Property Value
Remarks
This is triggered at the very end of the spline updating method. UpdateIn
 See Also
OnInitialized
Event triggered when the spline is initialized
public CurvySplineEvent OnInitialized { get; set; }
Property Value
OnRefresh
Event triggered when the spline is updated, including its initial update
public CurvySplineEvent OnRefresh { get; set; }
Property Value
Orientation
Orientation mode
public CurvyOrientation Orientation { get; set; }
Property Value
Restricted2DPlane
The local 2D plane to restrict the spline's control point in
public CurvyPlane Restricted2DPlane { get; set; }
Property Value
 See Also
RestrictTo2D
Whether to restrict Control Points to a local 2D plane
public bool RestrictTo2D { get; set; }
Property Value
 See Also
Tension
Global Tension
public float Tension { get; set; }
Property Value
Remarks
This only applies to TCB interpolation
UpdateIn
public CurvyUpdateMethod UpdateIn { get; set; }
Property Value
UsePooling
Whether to use GameObject pooling for Control Points at runtime
public bool UsePooling { get; set; }
Property Value
UseThreading
Whether to use threading where applicable or not. Threading is currently not supported when targeting WebGL and Universal Windows Platform
public bool UseThreading { get; set; }
Property Value
Methods
Add()
Adds a Control Point at the end of the spline This method will Refresh() the spline and call the relevant events. If you want more control on the order of the added Control Point, its position, or whether Refresh() and events should be called, use the InsertBefore(CurvySplineSegment, Vector3, bool, Space) and InsertAfter(CurvySplineSegment, Vector3, bool, Space) and Add(Vector3, Space) instead
public CurvySplineSegment Add()
Returns
 CurvySplineSegment
The added Control Point
Add(int)
Adds several Control Points at the end of the spline This method will Refresh() the spline and call the relevant events. If you want more control on the order of the added Control Points, their position, or whether Refresh() and events should be called, use the InsertBefore(CurvySplineSegment, Vector3, bool, Space) and InsertAfter(CurvySplineSegment, Vector3, bool, Space) and Add(Vector3[], Space) instead
public CurvySplineSegment[] Add(int controlPointsCount)
Parameters
controlPointsCount
intThe number of Control Points to add
Returns
Add(Vector3, Space)
Adds several Control Points at the end of the spline This method will Refresh() the spline and call the relevant events. If you want more control on the order of the added Control Points, their position, or whether Refresh() and events should be called, use the InsertBefore(CurvySplineSegment, Vector3, bool, Space) and InsertAfter(CurvySplineSegment, Vector3, bool, Space) instead
public CurvySplineSegment Add(Vector3 controlPointPosition, Space space)
Parameters
controlPointPosition
Vector3The position of the Control Point to add
space
SpaceWhether the position is in the local or global space
Returns
 CurvySplineSegment
The added Control Points
Add(Vector3[], Space)
Adds several Control Points at the end of the spline This method will Refresh() the spline and call the relevant events. If you want more control on the order of the added Control Points, their position, or whether Refresh() and events should be called, use the InsertBefore(CurvySplineSegment, Vector3, bool, Space) and InsertAfter(CurvySplineSegment, Vector3, bool, Space) instead
public CurvySplineSegment[] Add(Vector3[] controlPointsPositions, Space space)
Parameters
controlPointsPositions
Vector3[]The positions of the Control Points to add
space
SpaceWhether the positions are in the local or global space
Returns
 CurvySplineSegment[]
The added Control Points
Add(params Vector3[])
Adds several Control Points at the end of the spline This method will Refresh() the spline and call the relevant events. If you want more control on the order of the added Control Points, their position, or whether Refresh() and events should be called, use the InsertBefore(CurvySplineSegment, Vector3, bool, Space) and InsertAfter(CurvySplineSegment, Vector3, bool, Space) and Add(Vector3[], Space) instead
public CurvySplineSegment[] Add(params Vector3[] controlPointsLocalPositions)
Parameters
controlPointsLocalPositions
Vector3[]The local position of the Control Points to add
Returns
 CurvySplineSegment[]
The added Control Points
Bezier(Vector3, Vector3, Vector3, Vector3, float)
CubicBeziere Interpolation
public static Vector3 Bezier(Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
Parameters
T0
Vector3HandleIn
P0
Vector3Pn
P1
Vector3Pn+1
T1
Vector3HandleOut
f
floatf in the range 0..1
Returns
 Vector3
BezierTangent(Vector3, Vector3, Vector3, Vector3, float)
public static Vector3 BezierTangent(Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
Parameters
T0
Vector3P0
Vector3P1
Vector3T1
Vector3f
float
Returns
 Vector3
CalculateCacheSize(int, float, float)
Gets the number of Cache Points needed for a certain part of a spline
public static int CalculateCacheSize(int density, float segmentLength, float maxPointsPerUnit)
Parameters
density
intA value between 1 and 100 included. When equal to 100, the number of cache points per world distance unit is equal to maxPointsPerUnit
segmentLength
floatthe length of the spline segment
maxPointsPerUnit
floatMaximum number of Cache Points per world distance unit
Returns
CalculateSamplingPointsPerUnit(int, float)
Returns the (floating) number of sampling points per world distance unit.
public static float CalculateSamplingPointsPerUnit(int density, float maxPointsPerUnit)
Parameters
density
intA value between 1 and 100 included. When equal to 100, the number of sampling points per world distance unit is equal to maxPointsPerUnit
maxPointsPerUnit
floatMaximum number of sampling points per world distance unit
Returns
CanControlPointHaveFollowUp(CurvySplineSegment)
Can this control point have a FollowUp? This is true if the control point is the beginning of the first segment or the end of the last segment of an open spline
public bool CanControlPointHaveFollowUp(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
CatmullRom(Vector3, Vector3, Vector3, Vector3, float)
CatmullRom Interpolation
public static Vector3 CatmullRom(Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
Parameters
T0
Vector3Pn1 (In Tangent)
P0
Vector3Pn
P1
Vector3Pn+1
T1
Vector3Pn+2 (Out Tangent)
f
floatf in the range 0..1
Returns
 Vector3
the interpolated position
ClampDistance(float, CurvyClamping, float, float)
Clamps absolute position
public float ClampDistance(float distance, CurvyClamping clamping, float min, float max)
Parameters
distance
floatclamping
CurvyClampingmin
floatmax
float
Returns
ClampDistance(float, CurvyClamping)
Clamps absolute position
public float ClampDistance(float distance, CurvyClamping clamping)
Parameters
distance
floatclamping
CurvyClamping
Returns
ClampDistance(float, ref int, CurvyClamping, float, float)
Clamps absolute position and sets new direction
public float ClampDistance(float distance, ref int dir, CurvyClamping clamping, float min, float max)
Parameters
distance
floatdir
intclamping
CurvyClampingmin
floatmax
float
Returns
ClampDistance(float, ref int, CurvyClamping)
Clamps absolute position and sets new direction
public float ClampDistance(float distance, ref int dir, CurvyClamping clamping)
Parameters
distance
floatdir
intclamping
CurvyClamping
Returns
Clear(bool)
Removes all control points
If true, the clearing of the spline is made undoable (CTRL+Z) in the editorpublic void Clear(bool isUndoable = true)
Parameters
isUndoable
bool
Create()
Creates an empty spline
public static CurvySpline Create()
Returns
Create(CurvySpline)
Creates an empty spline with the same settings as another spline
public static CurvySpline Create(CurvySpline takeOptionsFrom)
Parameters
takeOptionsFrom
CurvySplineanother spline
Returns
Delete(CurvySplineSegment, bool, bool)
Deletes a Control Point
public void Delete(CurvySplineSegment controlPoint, bool skipRefreshingAndEvents, bool isUndoableDeletion)
Parameters
controlPoint
CurvySplineSegmenta Control Point
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
isUndoableDeletion
boolIf true, the destruction of the control point's game object is made undoable (CTRL+Z) in the editor
Delete(CurvySplineSegment, bool)
Deletes a Control Point
public void Delete(CurvySplineSegment controlPoint, bool skipRefreshingAndEvents = false)
Parameters
controlPoint
CurvySplineSegmenta Control Point
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
DistanceToSegment(float, CurvyClamping)
Gets the segment a certain distance lies within
public CurvySplineSegment DistanceToSegment(float distance, CurvyClamping clamping = CurvyClamping.Clamp)
Parameters
distance
floata distance in the range 0..Length
clamping
CurvyClampingclamping to use
Returns
 CurvySplineSegment
a spline segment or null
DistanceToSegment(float, out float, CurvyClamping)
Gets the segment a certain distance lies within
public CurvySplineSegment DistanceToSegment(float distance, out float localDistance, CurvyClamping clamping = CurvyClamping.Clamp)
Parameters
distance
floata distance in the range 0..Length
localDistance
floatgets the remaining distance inside the segment
clamping
CurvyClampingclamping to use
Returns
 CurvySplineSegment
a spline segment
DistanceToSegment(float, out float, out bool, out bool, CurvyClamping)
Gets the segment a certain distance lies within
public CurvySplineSegment DistanceToSegment(float distance, out float localDistance, out bool isOnSegmentStart, out bool isOnSegmentEnd, CurvyClamping clamping = CurvyClamping.Clamp)
Parameters
distance
floata distance in the range 0..Length
localDistance
floatgets the remaining distance inside the segment
isOnSegmentStart
boolIs True if the given distance is positioned at the returned segment's start
isOnSegmentEnd
boolIs True if the given distance is positioned at the returned segment's end
clamping
CurvyClampingclamping to use
Returns
 CurvySplineSegment
a spline segment
DistanceToTF(float, CurvyClamping)
Converts a distance to a TF value TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float DistanceToTF(float distance, CurvyClamping clamping = CurvyClamping.Clamp)
Parameters
distance
floatdistance
clamping
CurvyClampingClamping to use
Returns
 float
a TF value in the range 0..1
Equalize(CurvySplineSegment, CurvySplineSegment)
Equalizes the segment length of a certain range
public void Equalize(CurvySplineSegment fromCP = null, CurvySplineSegment toCP = null)
Parameters
fromCP
CurvySplineSegmentstarting ControlPoint
toCP
CurvySplineSegmentending ControlPoint
Flip()
Flips the direction of the spline, i.e. the first Control Point will become the last and vice versa.
public void Flip()
GetApproximation(float, float, bool, Space)
Gets all Approximation points for a given spline part
public Vector3[] GetApproximation(float fromTF, float toTF, bool includeEndPoint = true, Space space = Space.Self)
Parameters
fromTF
floatstart TF
toTF
floatend TF
includeEndPoint
boolWhether the end position should be included
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3[]
an array of Approximation points
GetControlPointIndex(CurvySplineSegment)
Index of the control point
public short GetControlPointIndex(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetFollowUpHeadingControlPoint(CurvySplineSegment, ConnectionHeadingEnum)
This method returns the Control Point next to the FollowUp, based on the ConnectionHeadingEnum's value
public static CurvySplineSegment GetFollowUpHeadingControlPoint(CurvySplineSegment followUp, ConnectionHeadingEnum headingDirection)
Parameters
followUp
CurvySplineSegmentThe Control Point used as a FollowUp
headingDirection
ConnectionHeadingEnumThe head to direction
Returns
 CurvySplineSegment
The Control Point the FollowUp is heading to
GetInterpolatedMetadata<T, U>(float)
Gets an interpolated Metadata value for a certain TF
public U GetInterpolatedMetadata<T, U>(float tf) where T : CurvyInterpolatableMetadataBase<U>
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
Returns
 U
The interpolated value. If no Metadata of specified type is present at the given tf, the default value of type U is returned
Type Parameters
T
Metadata type inheriting from CurvyInterpolatableMetadataBase
U
Metadata's Value type
GetMetadata<T>(float)
Gets metadata for a certain TF
public T GetMetadata<T>(float tf) where T : CurvyMetadataBase
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
Returns
 T
the metadata
Type Parameters
T
Metadata type interfacing ICurvyMetadata
GetNearestPoint(Vector3, Space)
Gets the point on the spline that is the nearest to a given position
public Vector3 GetNearestPoint(Vector3 position, Space space)
Parameters
position
Vector3The input point's position
space
SpaceThe space (local/object or global/world) in which the
position
and the returned value are expressed
Returns
 Vector3
The nearest point on the spline to the given
position
, expressed in the space defined by thespace
parameter
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, int, int, Space)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 position, int searchStartSegmentIndex = 0, int searchEndSegmentIndex = 1, Space space = Space.Self)
Parameters
position
Vector3The point's position
searchStartSegmentIndex
intthe index of the first segment to include in the search. Set it to 0 to start searching from the spline's start
searchEndSegmentIndex
intthe index of the last segment to include in the search. Set it to 1 to search until the spline's end
space
SpaceThe space (local/object or global/world) in which the
position
is expressed
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, Space)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 position, Space space)
Parameters
position
Vector3The point's position
space
SpaceThe space (local/object or global/world) in which the
position
is expressed
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, out Vector3, out CurvySplineSegment, out float, int, int, Space)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 position, out Vector3 nearestPoint, out CurvySplineSegment nearestSegment, out float nearestPointLocalF, int searchStartSegmentIndex = 0, int searchEndSegmentIndex = 1, Space space = Space.Self)
Parameters
position
Vector3The point's position
nearestPoint
Vector3the nearest point on the spline to the given
position
, expressed in the space defined by thespace
parameternearestSegment
CurvySplineSegmentthe nearest segment of the spline to the given
position
nearestPointLocalF
floatLocalF of the nearest point on the nearest segment
searchStartSegmentIndex
intthe index of the first segment to include in the search. Set it to 0 to start searching from the spline's start
searchEndSegmentIndex
intthe index of the last segment to include in the search. Set it to 1 to search until the spline's end
space
SpaceThe space (local/object or global/world) in which the
position
is expressed
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, out Vector3, int, int, Space)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 position, out Vector3 nearestPoint, int searchStartSegmentIndex = 0, int searchEndSegmentIndex = 1, Space space = Space.Self)
Parameters
position
Vector3The point's position
nearestPoint
Vector3the nearest point on the spline to the given
position
, expressed in the space defined by thespace
parametersearchStartSegmentIndex
intthe index of the first segment to include in the search. Set it to 0 to start searching from the spline's start
searchEndSegmentIndex
intthe index of the last segment to include in the search. Set it to 1 to search until the spline's end
space
SpaceThe space (local/object or global/world) in which the
position
is expressed
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, out Vector3, Space)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 position, out Vector3 nearestPoint, Space space)
Parameters
position
Vector3The point's position
nearestPoint
Vector3the nearest point on the spline to the given
position
, expressed in the space defined by thespace
parameterspace
SpaceThe space (local/object or global/world) in which the
position
is expressed
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3, out Vector3)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 localPosition, out Vector3 nearestPoint)
Parameters
localPosition
Vector3The point's position expressed in the spline's local space
nearestPoint
Vector3the nearest point on the spline to the given
localPosition
, expressed in the local space
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNearestPointTF(Vector3)
Gets the TF value of the point on the spline that is the nearest to a given position TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float GetNearestPointTF(Vector3 localPosition)
Parameters
localPosition
Vector3The point's position expressed in the spline's local space
Returns
 float
a TF value in the range 0..1. If spline has no segments the returned value will be 1
Remarks
This method's precision and speed depend on the CacheDensity
GetNextControlPoint(CurvySplineSegment)
The next control point on the spline. Is null if none. FollowUp not considered
[CanBeNull]
public CurvySplineSegment GetNextControlPoint(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetNextControlPointIndex(CurvySplineSegment)
The index of the next control point on the spline. Is 1 if none. FollowUp not considered
[CanBeNull]
public short GetNextControlPointIndex(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetNextControlPointUsingFollowUp(CurvySplineSegment)
The next control point. Is null if none. FollowUp is considered
[CanBeNull]
public CurvySplineSegment GetNextControlPointUsingFollowUp(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetNextSegment(CurvySplineSegment)
The next control point on the spline if it starts a segment. Is null if none. FollowUp not considered
[CanBeNull]
public CurvySplineSegment GetNextSegment(CurvySplineSegment segment)
Parameters
segment
CurvySplineSegment
Returns
GetNormalsCache(Space)
Gets an array containing all approximation UpVectors
public SubArray<Vector3> GetNormalsCache(Space space)
Parameters
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 SubArray<Vector3>
an array of UpVectors
Remarks
Returns a copy of the internal cache
GetOrientationFast(float, bool, Space)
Gets a rotation looking to Tangent with the head upwards along the UpVector
public Quaternion GetOrientationFast(float tf, bool inverse = false, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
inverse
boolwhether the orientation should be inversed or not
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Quaternion
a rotation, relative to the spline's local space
GetOrientationUpFast(float, Space)
Gets the Up vector of a point on the spline segment. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 GetOrientationUpFast(float tf, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
GetPositionsCache(Space)
Gets an array containing all approximation points
public SubArray<Vector3> GetPositionsCache(Space space)
Parameters
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 SubArray<Vector3>
an array of world/local positions
Remarks
Returns a copy of the internal cache
GetPreviousControlPoint(CurvySplineSegment)
The previous control point on the spline. Is null if none. FollowUp not considered
[CanBeNull]
public CurvySplineSegment GetPreviousControlPoint(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetPreviousControlPointIndex(CurvySplineSegment)
The index of the previous control point on the spline. Is 1 if none. FollowUp not considered
[CanBeNull]
public short GetPreviousControlPointIndex(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetPreviousControlPointUsingFollowUp(CurvySplineSegment)
The previous control point. Is null if none. FollowUp is considered
[CanBeNull]
public CurvySplineSegment GetPreviousControlPointUsingFollowUp(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
GetPreviousSegment(CurvySplineSegment)
The previous control point on the spline if it starts a segment. Is null if none. FollowUp not considered.
[CanBeNull]
public CurvySplineSegment GetPreviousSegment(CurvySplineSegment segment)
Parameters
segment
CurvySplineSegment
Returns
GetSegmentIndex(CurvySplineSegment)
Index of the segment that this control point starts. 1 if control point does not start a segment.
public short GetSegmentIndex(CurvySplineSegment segment)
Parameters
segment
CurvySplineSegment
Returns
GetTangent(float, Space)
Gets the normalized tangent at a point on the spline segment
public Vector3 GetTangent(float tf, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
GetTangent(float, Vector3, Space)
Gets the normalized tangent at a point on the spline segment. This method is faster than GetTangent(float, Space) if you have already the position of the point. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 GetTangent(float tf, Vector3 position, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
position
Vector3the position of the point at localF. In other words, the result of Interpolate(float, Space)
space
SpaceThe space (local/object or global/world) in which the returned result and the
position
parameter are expressed
Returns
 Vector3
GetTangentByDistance(float, Space)
Gets the normalized tangent at a point on the spline segment
public Vector3 GetTangentByDistance(float distance, Space space = Space.Self)
Parameters
distance
floatThe distance between the spline's start and the point you are interested in. Value should be in the range from 0 to Length inclusive
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
GetTangentByDistanceFast(float, Space)
Gets the normalized tangent at a point on the spline segment. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 GetTangentByDistanceFast(float distance, Space space = Space.Self)
Parameters
distance
floatThe distance between the spline's start and the point you are interested in. Value should be in the range from 0 to Length inclusive
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
GetTangentFast(float, Space)
Gets the normalized tangent at a point on the spline segment. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 GetTangentFast(float tf, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
GetTangentsCache(Space)
Gets an array containing all approximation tangents
public SubArray<Vector3> GetTangentsCache(Space space)
Parameters
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 SubArray<Vector3>
an array of tangents
Remarks
Returns a copy of the internal cache
InsertAfter(CurvySplineSegment, bool)
Inserts a Control Point after a given Control Point
public CurvySplineSegment InsertAfter(CurvySplineSegment controlPoint, bool skipRefreshingAndEvents = false)
Parameters
controlPoint
CurvySplineSegmentA control point of the spline, behind which the new control point will be added. If null, the CP will be added at the end of the spline
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
Returns
 CurvySplineSegment
the new Control Point
Remarks
If you add several Control Points in a row, using Add(params Vector3[]) will be more efficient
InsertAfter(CurvySplineSegment, Vector3, bool, Space)
Inserts a Control Point after a given Control Point
public CurvySplineSegment InsertAfter(CurvySplineSegment controlPoint, Vector3 position, bool skipRefreshingAndEvents = false, Space space = Space.World)
Parameters
controlPoint
CurvySplineSegmentA control point of the spline, behind which the new control point will be added. If null, the CP will be added at the end of the spline
position
Vector3The position of the control point at its creation
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
space
SpaceWhether the position is in the local or global space
Returns
 CurvySplineSegment
the new Control Point
Remarks
If you add several Control Points in a row, using Add(params Vector3[]) will be more efficient
InsertBefore(CurvySplineSegment, bool)
Inserts a Control Point before a given Control Point
public CurvySplineSegment InsertBefore(CurvySplineSegment controlPoint, bool skipRefreshingAndEvents = false)
Parameters
controlPoint
CurvySplineSegmentA control point of the spline, before which the new control point will be added. If null, the CP will be added at the start of the spline
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
Returns
 CurvySplineSegment
The created Control Point
Remarks
If you add several Control Points in a row, using Add(params Vector3[]) will be more efficient
InsertBefore(CurvySplineSegment, Vector3, bool, Space)
Inserts a Control Point before a given Control Point
public CurvySplineSegment InsertBefore(CurvySplineSegment controlPoint, Vector3 position, bool skipRefreshingAndEvents = false, Space space = Space.World)
Parameters
controlPoint
CurvySplineSegmentA control point of the spline, before which the new control point will be added. If null, the CP will be added at the start of the spline
position
Vector3The position of the control point at its creation
skipRefreshingAndEvents
boolIf true, the spline's Refresh() method will not be called, and the relevant events will not be triggered
space
SpaceWhether the position is in the local or global space
Returns
 CurvySplineSegment
The created Control Point
Remarks
If you add several Control Points in a row, using Add(params Vector3[]) will be more efficient
Interpolate(float, Space)
Gets the position of a point on the spline segment
public Vector3 Interpolate(float tf, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
InterpolateAndGetTangent(float, out Vector3, out Vector3, Space)
Gets the position and normalized tangent at a point on the spline segment Is Faster than calling Interpolate(float, Space) and Interpolate(float, Space) separately
public void InterpolateAndGetTangent(float tf, out Vector3 position, out Vector3 tangent, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
position
Vector3the output position
tangent
Vector3the output tangent
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
InterpolateAndGetTangentFast(float, out Vector3, out Vector3, Space)
Gets the position and normalized tangent at a point on the spline segment Is Faster than calling Interpolate(float, Space) and Interpolate(float, Space) separately Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public void InterpolateAndGetTangentFast(float tf, out Vector3 position, out Vector3 tangent, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
position
Vector3the output position
tangent
Vector3the output tangent
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
InterpolateByDistance(float, Space)
Gets the position of a point on the spline segment
public Vector3 InterpolateByDistance(float distance, Space space = Space.Self)
Parameters
distance
floatThe distance between the spline's start and the point you are interested in. Value should be in the range from 0 to Length inclusive
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
InterpolateByDistanceFast(float, Space)
Gets the position of a point on the spline segment. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 InterpolateByDistanceFast(float distance, Space space = Space.Self)
Parameters
distance
floatThe distance between the spline's start and the point you are interested in. Value should be in the range from 0 to Length inclusive
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
InterpolateFast(float, Space)
Gets the position of a point on the spline segment. Instead of computing the exact value, this method uses a linear interpolation between cached points for faster result
public Vector3 InterpolateFast(float tf, Space space = Space.Self)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end. This is the "time" parameter used in the splines' formulas. A point's TF is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
space
SpaceThe space (local/object or global/world) in which the returned result is expressed
Returns
 Vector3
IsControlPointAnOrientationAnchor(CurvySplineSegment)
Is the control point an orientation anchor? The answer is related to the control point's serialized OrientationAnchor value, plus it's position in the spline.
public bool IsControlPointAnOrientationAnchor(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
IsControlPointASegment(CurvySplineSegment)
Is the control point the start of a segment?
public bool IsControlPointASegment(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
IsControlPointVisible(CurvySplineSegment)
Is the control point part of a segment (whether starting it or ending it)
public bool IsControlPointVisible(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
IsPlanar(CurvyPlane)
Determines if the spline is at zero position on a certain plane
public bool IsPlanar(CurvyPlane plane)
Parameters
plane
CurvyPlanethe plane the spline should be tested against
Returns
 bool
true if the spline is on the plane
IsPlanar(out bool, out bool, out bool)
Is the spline a 2D spline contained in one of the main planes?
public bool IsPlanar(out bool isYZ, out bool isXZ, out bool isXY)
Parameters
isYZ
boolIs spline contained within the YZ plane
isXZ
boolIs spline contained within the XZ plane
isXY
boolIs spline contained within the XY plane
Returns
 bool
True if the control points are planar along at least one axis; otherwise, false.
JoinWith(CurvySplineSegment)
Insert this spline after another spline's destination Control Point and delete this spline
public void JoinWith(CurvySplineSegment destCP)
Parameters
destCP
CurvySplineSegmentthe Control Point of the destination spline
MakePlanar(CurvyPlane)
Forces the spline to be at zero position on a certain plane
public void MakePlanar(CurvyPlane plane)
Parameters
plane
CurvyPlanethe plane the should be on
MoveControlPoints(int, int, CurvySplineSegment)
Moves ControlPoints from this spline, inserting them after a destination ControlPoint of another spline
public void MoveControlPoints(int startIndex, int count, CurvySplineSegment destCP)
Parameters
startIndex
intControlPointIndex of the first CP to move
count
intnumber of ControlPoints to move
destCP
CurvySplineSegmentControlPoint at the destination spline to insert after
Normalize()
Applies a spline's scale to it's Control Points and resets scale
public void Normalize()
Refresh()
Refreshs the spline
public void Refresh()
Remarks
This is called automatically on the next Update() if any changes are pending
SegmentToTF(CurvySplineSegment, float)
Gets a TF value from a segment and a local F TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float SegmentToTF(CurvySplineSegment segment, float localF)
Parameters
segment
CurvySplineSegmenta segment
localF
floatF of this segment in the range 0..1
Returns
 float
a TF value in the range 0..1
SegmentToTF(CurvySplineSegment)
Gets a TF value from a segment TF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
public float SegmentToTF(CurvySplineSegment segment)
Parameters
segment
CurvySplineSegmenta segment
Returns
 float
a TF value in the range 0..1
SetDirty(CurvySplineSegment, SplineDirtyingType)
Marks a Control Point to get recalculated on next call to Refresh(). Will also mark connected control points and control points that depend on the current one through the FollowUp feature.
public void SetDirty(CurvySplineSegment dirtyControlPoint, SplineDirtyingType dirtyingType)
Parameters
dirtyControlPoint
CurvySplineSegmentthe Control Point to dirty
dirtyingType
SplineDirtyingTypeDefines what aspect should be dirtied
SetDirtyAll()
Ensure the whole spline will be recalculated on next call to Refresh()
public void SetDirtyAll()
SetDirtyAll(SplineDirtyingType, bool)
Ensure the whole spline will be recalculated on next call to Refresh()
public void SetDirtyAll(SplineDirtyingType dirtyingType, bool dirtyConnectedControlPoints)
Parameters
dirtyingType
SplineDirtyingTypeDefines what aspect should be dirtied
dirtyConnectedControlPoints
boolWhether to mark control points of other splines as dirty when they are connected to any control point of this spline.
SetDirtyPartial(CurvySplineSegment, SplineDirtyingType)
Marks a Control Point to get recalculated on next call to Refresh(). Will also mark connected control points and control points that depend on the current one through the FollowUp feature. Be aware, this method, and unlike SetDirty, will not mark as dirty the control points connected to the "controlPoint" parameter
public void SetDirtyPartial(CurvySplineSegment dirtyControlPoint, SplineDirtyingType dirtyingType)
Parameters
dirtyControlPoint
CurvySplineSegmentthe Control Point to dirty
dirtyingType
SplineDirtyingTypeDefines what aspect should be dirtied
SetFirstControlPoint(CurvySplineSegment)
Defines the given Control Point to be the first Control Point of the spline
public void SetFirstControlPoint(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegmentOne of this spline's control points
SetFromString(string)
Eventfriendly helper that sets a field or property value
public void SetFromString(string fieldAndValue)
Parameters
fieldAndValue
stringe.g. "MyValue=42"
SetPivot(float, float, float, bool)
Sets the pivot of the spline
public Vector3 SetPivot(float xRel = 0, float yRel = 0, float zRel = 0, bool preview = false)
Parameters
xRel
float1 to 1
yRel
float1 to 1
zRel
float1 to 1
preview
boolif true, only return the new pivot position
Returns
 Vector3
the new pivot position
Simplify(CurvySplineSegment, CurvySplineSegment)
Simplifies the spline, i.e. remove segments from a certain range
public void Simplify(CurvySplineSegment fromCP = null, CurvySplineSegment toCP = null)
Parameters
fromCP
CurvySplineSegmentstarting ControlPoint
toCP
CurvySplineSegmentending ControlPoint
Split(CurvySplineSegment)
Splits this spline with the parameter controlPoint becoming the first Control Point of the new spline
public CurvySpline Split(CurvySplineSegment controlPoint)
Parameters
controlPoint
CurvySplineSegment
Returns
 CurvySpline
The new spline
Subdivide(CurvySplineSegment, CurvySplineSegment)
Subdivides the spline, i.e. adds additional segments to a certain range
public void Subdivide(CurvySplineSegment fromCP = null, CurvySplineSegment toCP = null)
Parameters
fromCP
CurvySplineSegmentstarting ControlPoint
toCP
CurvySplineSegmentending ControlPoint
SyncSplineFromHierarchy()
Rebuilds the ControlPoints list from the hierarchy. It sets the spline as Dirty
public void SyncSplineFromHierarchy()
TCB(Vector3, Vector3, Vector3, Vector3, float, float, float, float, float, float, float)
KochanekBartels/TCBInterpolation
public static Vector3 TCB(Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f, float FT0, float FC0, float FB0, float FT1, float FC1, float FB1)
Parameters
T0
Vector3Pn1 (In Tangent)
P0
Vector3Pn
P1
Vector3Pn+1
T1
Vector3Pn+2 (Out Tangent)
f
floatf in the range 0..1
FT0
floatStart Tension
FC0
floatStart Continuity
FB0
floatStart Bias
FT1
floatEnd Tension
FC1
floatEnd Continuity
FB1
floatEnd Bias
Returns
 Vector3
the interpolated position
TFToDistance(float, CurvyClamping)
Converts a TF value to a distance
public float TFToDistance(float tf, CurvyClamping clamping = CurvyClamping.Clamp)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
clamping
CurvyClampingClamping to use
Returns
 float
distance from spline's start
TFToSegment(float, CurvyClamping)
Gets the segment for a certain TF
public CurvySplineSegment TFToSegment(float tf, CurvyClamping clamping)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
clamping
CurvyClampingClamping to use
Returns
 CurvySplineSegment
the segment the given TF is inside
TFToSegment(float, out float, CurvyClamping)
Gets the segment and the local F for a certain TF
public CurvySplineSegment TFToSegment(float tf, out float localF, CurvyClamping clamping)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
localF
floatgets the remaining localF in the range 0..1
clamping
CurvyClampingClamping to use
Returns
 CurvySplineSegment
the segment the given TF is inside
TFToSegment(float, out float, out bool, out bool, CurvyClamping)
Gets the segment and the local F for a certain TF
public CurvySplineSegment TFToSegment(float tf, out float localF, out bool isOnSegmentStart, out bool isOnSegmentEnd, CurvyClamping clamping)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
localF
floatgets the remaining localF in the range 0..1
isOnSegmentStart
boolIs True if the given distance is positioned at the returned segment's start
isOnSegmentEnd
boolIs True if the given distance is positioned at the returned segment's end
clamping
CurvyClampingClamping to use
Returns
 CurvySplineSegment
the segment the given TF is inside
TFToSegment(float, out float)
Gets the segment and the local F for a certain TF clamped to 0..1
public CurvySplineSegment TFToSegment(float tf, out float localF)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
localF
floatgets the remaining localF in the range 0..1
Returns
 CurvySplineSegment
the segment the given TF is inside
TFToSegment(float)
Gets the segment for a certain TF clamped to 0..1
public CurvySplineSegment TFToSegment(float tf)
Parameters
tf
floatTF stands for Total Fragment. It's a value ranging from 0 to 1 inclusive. 0 means the spline's start and 1 means the spline's end.This is the "time" parameter used in the splines' formulas. A point's F is not proportional to its distance from the spline's start. Depending on the spline, a value of 0.5 does not always mean the middle, distance wise, of the spline
Returns
 CurvySplineSegment
the segment the given TF is inside
ToLocalDirection(Vector3)
Transforms direction from world space to local space
public Vector3 ToLocalDirection(Vector3 localDirection)
Parameters
localDirection
Vector3
Returns
 Vector3
ToLocalPosition(Vector3)
Transforms position from world space to local space
public Vector3 ToLocalPosition(Vector3 worldPosition)
Parameters
worldPosition
Vector3
Returns
 Vector3
ToWorldDirection(Vector3)
Transforms direction from local space to world space
public Vector3 ToWorldDirection(Vector3 localDirection)
Parameters
localDirection
Vector3
Returns
 Vector3
ToWorldPosition(Vector3)
Transforms position from local space to world space
public Vector3 ToWorldPosition(Vector3 localPosition)
Parameters
localPosition
Vector3
Returns
 Vector3