Curvy  4.1.0
CurvySpline Class Reference
+ Inheritance diagram for CurvySpline:
+ Collaboration diagram for CurvySpline:

Detailed Description

Curvy Spline class

Public Attributes

bool ShowGizmos = true
 Whether to show the Gizmos enabled in the view settings or not at all More...
 

Properties

bool AutoEndTangents [get, set]
 Whether the first/last Control Point should act as the end tangent, too. More...
 
float AutoHandleDistance [get, set]
 Gets or sets the default Handle distance for Bezier splines More...
 
float Bias [get, set]
 Global Bias More...
 
Bounds Bounds [get]
 The bounding box of the spline More...
 
int CacheDensity [get, set]
 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 More...
 
int CacheSize [get]
 Gets total Cache Size More...
 
bool CheckTransform [get, set]
 Whether the spline should automatically refresh when a Control Point's position change More...
 
bool Closed [get, set]
 Whether this spline is closed or not More...
 
float Continuity [get, set]
 Global Continuity More...
 
int ControlPointCount [get]
 Gets the number of Control Points More...
 
ReadOnlyCollection< CurvySplineSegmentControlPointsList [get]
 The list of control points More...
 
int Count [get]
 Gets the number of Segments More...
 
bool Dirty [get]
 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 More...
 
CurvySplineSegment FirstSegment [get]
 Gets the first segment of the spline More...
 
CurvySplineSegment FirstVisibleControlPoint [get]
 Gets the first visible Control Point (equals the first segment or this[0]) More...
 
Color GizmoColor [get, set]
 Gets or sets Spline color More...
 
Color GizmoSelectionColor [get, set]
 Gets or sets selected segment color More...
 
bool GlobalCoordinatesChangedThisFrame [get]
 Returns true if the global position, rotation or scale of the spline has changed this frame More...
 
CurvyInterpolation Interpolation [get, set]
 The interpolation method used by this spline More...
 
bool IsClosed [get]
 
bool IsInitialized [get]
 Whether the spline is fully initialized and all segments loaded More...
 
CurvySplineSegment LastSegment [get]
 Gets the last segment of the spline More...
 
CurvySplineSegment LastVisibleControlPoint [get]
 Gets the last visible Control Point (i.e. the end CP of the last segment) More...
 
float Length [get]
 Gets the total length of the Spline or SplineGroup More...
 
float MaxPointsPerUnit [get, set]
 The maximum number of sampling points per world distance unit. Sampling is used in caching or shape extrusion for example" More...
 
CurvySpline NextSpline [get]
 Gets the FollowUp spline of the last Control Point, i.e. the next fully connected spline More...
 
CurvyControlPointEvent OnAfterControlPointAdd [get, set]
 Callback after a Control Point has been added and the spline was refreshed More...
 
CurvySplineEvent OnAfterControlPointChanges [get, set]
 Callback after one or more Control Points have been added or deleted More...
 
CurvyControlPointEvent OnBeforeControlPointAdd [get, set]
 Callback before a Control Point is about to be added. Return false to cancel the execution More...
 
CurvyControlPointEvent OnBeforeControlPointDelete [get, set]
 Callback before a Control Point is about to be deleted. Return false to cancel the execution. More...
 
CurvySplineEvent OnRefresh [get, set]
 
CurvyOrientation Orientation [get, set]
 Orientation mode More...
 
CurvySpline PreviousSpline [get]
 Gets the FollowUp spline of the first Control Point, i.e. the previous fully connected spline More...
 
bool RestrictTo2D [get, set]
 Whether to restrict Control Points to the local X/Y plane More...
 
float Tension [get, set]
 Global Tension More...
 
CurvySplineSegment this[int idx] [get]
 Gets the Segment at a certain index More...
 
CurvyUpdateMethod UpdateIn [get, set]
 
bool UsePooling [get, set]
 Whether to use GameObject pooling for Control Points at runtime More...
 
bool UseThreading [get, set]
 Whether to use threading where applicable or not. Threading is currently not supported when targetting WebGL and Universal Windows Platform More...
 

Public Member Functions

CurvySplineSegment Add ()
 Adds a Control Point and refreshes the spline More...
 
CurvySplineSegment[] Add (params Vector3[] controlPoints)
 Adds several Control Points at once and refresh the spline More...
 
bool CanControlPointHaveFollowUp (CurvySplineSegment controlPoint)
 Can this control point have a follow up? 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 More...
 
float ClampDistance (float distance, CurvyClamping clamping)
 Clamps absolute position More...
 
float ClampDistance (float distance, CurvyClamping clamping, float min, float max)
 Clamps absolute position More...
 
float ClampDistance (float distance, ref int dir, CurvyClamping clamping)
 Clamps absolute position and sets new direction More...
 
float ClampDistance (float distance, ref int dir, CurvyClamping clamping, float min, float max)
 Clamps absolute position and sets new direction More...
 
void Clear ()
 Removes all control points More...
 
 CurvySpline ()
 
void Delete (CurvySplineSegment controlPoint, bool skipRefreshingAndEvents=false)
 Deletes a Control Point More...
 
CurvySplineSegment DistanceToSegment (float distance, CurvyClamping clamping=CurvyClamping.Clamp)
 Gets the segment a certain distance lies within More...
 
CurvySplineSegment DistanceToSegment (float distance, out float localDistance, CurvyClamping clamping=CurvyClamping.Clamp)
 Gets the segment a certain distance lies within More...
 
float DistanceToTF (float distance, CurvyClamping clamping=CurvyClamping.Clamp)
 Converts a distance to a TF value More...
 
void Equalize (CurvySplineSegment fromCP=null, CurvySplineSegment toCP=null)
 Equalizes the segment length of a certain range More...
 
float ExtrapolateDistanceToTF (float tf, float distance, float stepSize)
 Converts a unit distance into TF-distance by extrapolating the curvation at a given point on the curve More...
 
float ExtrapolateDistanceToTFFast (float tf, float distance, float stepSize)
 Converts a unit distance into TF-distance by extrapolating the curvation at a given point on the curve using a linear approximation More...
 
void Flip ()
 Flips the direction of the spline, i.e. the first Control Point will become the last and vice versa. More...
 
Vector3[] GetApproximation (Space space=Space.Self)
 Gets an array containing all approximation points More...
 
Vector3[] GetApproximationPoints (float fromTF, float toTF, bool includeEndPoint=true)
 Gets all Approximation points for a given spline part More...
 
Vector3[] GetApproximationT ()
 Gets an array containing all approximation tangents More...
 
Vector3[] GetApproximationUpVectors ()
 Gets an array containing all approximation Up-Vectors More...
 
short GetControlPointIndex (CurvySplineSegment controlPoint)
 Index of the control point More...
 
short GetControlPointOrientationAnchorIndex (CurvySplineSegment controlPoint)
 The index of the control point being the orientation anchor for the anchor group containing the controlPoint Is -1 for non visible control points More...
 
Vector3 GetExtrusionPoint (float tf, float radius, float angle)
 Gets the point at a certain radius and angle on the plane defined by P and it's Tangent More...
 
Vector3 GetExtrusionPointFast (float tf, float radius, float angle)
 Gets the point at a certain radius and angle on the plane defined by P and it's Tangent, using a linear interpolation More...
 
Component GetMetadata (System.Type type, float tf)
 Gets metadata for a certain TF More...
 
GetMetadata< T > (float tf)
 Gets metadata for a certain TF More...
 
float GetNearestPointTF (Vector3 localPosition)
 Gets the TF value that is nearest to localPosition More...
 
float GetNearestPointTF (Vector3 localPosition, out Vector3 nearest)
 Gets the TF value that is nearest to localPosition More...
 
float GetNearestPointTF (Vector3 localPosition, int startSegmentIndex=0, int stopSegmentIndex=-1)
 Gets the TF value that is nearest to localPosition More...
 
float GetNearestPointTF (Vector3 localPosition, out Vector3 nearest, int startSegmentIndex=0, int stopSegmentIndex=-1)
 Gets the TF value that is nearest to localPosition More...
 
float GetNearestPointTF (Vector3 localPosition, out Vector3 nearestPoint, [CanBeNull] out CurvySplineSegment nearestSegment, out float nearestSegmentF, int startSegmentIndex=0, int stopSegmentIndex=-1)
 Gets the TF value that is nearest to localPosition More...
 
CurvySplineSegment GetNextControlPoint (CurvySplineSegment controlPoint)
 The next control point on the spline. Is null if none. Follow up not considered More...
 
short GetNextControlPointIndex (CurvySplineSegment controlPoint)
 The index of the next control point on the spline. Is -1 if none. Follow up not considered More...
 
CurvySplineSegment GetNextControlPointUsingFollowUp (CurvySplineSegment controlPoint)
 The next control point. Is null if none. Follow up is considered More...
 
CurvySplineSegment GetNextSegment (CurvySplineSegment segment)
 The next control point on the spline if it starts a segment. Is null if none. Follow up not considered More...
 
Quaternion GetOrientationFast (float tf, bool inverse=false)
 Gets a rotation looking to Tangent with the head upwards along the Up-Vector More...
 
Vector3 GetOrientationUpFast (float tf)
 Gets the Up-Vector for a certain TF based on the splines' Orientation mode More...
 
Vector3[] GetPolygon (float fromTF, float toTF, float maxAngle, float minDistance, float maxDistance, out List< float > vertexTF, out List< Vector3 > vertexTangents, bool includeEndPoint=true, float stepSize=0.01f)
 Gets an array containing spline positions More...
 
Vector3[] GetPolygonByAngle (float angle, float minDistance)
 Gets an array containing spline positions by angle difference More...
 
CurvySplineSegment GetPreviousControlPoint (CurvySplineSegment controlPoint)
 The previous control point on the spline. Is null if none. Follow up not considered More...
 
short GetPreviousControlPointIndex (CurvySplineSegment controlPoint)
 The index of the previous control point on the spline. Is -1 if none. Follow up not considered More...
 
CurvySplineSegment GetPreviousControlPointUsingFollowUp (CurvySplineSegment controlPoint)
 The previous control point. Is null if none. Follow up is considered More...
 
CurvySplineSegment GetPreviousSegment (CurvySplineSegment segment)
 The previous control point on the spline if it starts a segment. Is null if none. Follow up not considered. More...
 
Vector3 GetRotatedUp (float tf, float angle)
 Gets a rotated Up-Vector More...
 
Vector3 GetRotatedUpFast (float tf, float angle)
 Gets an rotated Up-Vector using cached values More...
 
short GetSegementIndex (CurvySplineSegment segment)
 Index of the segment that this control point starts. -1 if control point does not start a segment. More...
 
short GetSegmentIndex (CurvySplineSegment segment)
 Index of the segment that this control point starts. -1 if control point does not start a segment. More...
 
Vector3 GetTangent (float tf)
 Gets the normalized tangent for a certain TF More...
 
Vector3 GetTangent (float tf, Vector3 localPosition)
 Gets the normalized tangent for a certain TF with a known local position for TF More...
 
Vector3 GetTangentByDistance (float distance)
 Gets the normalized tangent by distance from the spline/group's start. More...
 
Vector3 GetTangentByDistanceFast (float distance)
 Gets the normalized tangent by distance from the spline/group's start. Unlike TangentByDistance() this uses a linear approximation More...
 
Vector3 GetTangentFast (float tf)
 Gets the normalized tangent for a certain TF using a linear approximation More...
 
CurvySplineSegment InsertAfter (CurvySplineSegment controlPoint, bool skipRefreshingAndEvents=false)
 Inserts a Control Point after a given Control Point More...
 
CurvySplineSegment InsertAfter (CurvySplineSegment controlPoint, Vector3 globalPosition, bool skipRefreshingAndEvents=false)
 Inserts a Control Point after a given Control Point More...
 
CurvySplineSegment InsertBefore (CurvySplineSegment controlPoint, bool skipRefreshingAndEvents=false)
 Inserts a Control Point before a given Control Point More...
 
CurvySplineSegment InsertBefore (CurvySplineSegment controlPoint, Vector3 globalPosition, bool skipRefreshingAndEvents=false)
 Inserts a Control Point before a given Control Point More...
 
Vector3 Interpolate (float tf)
 Gets the interpolated local position for a certain TF More...
 
Vector3 Interpolate (float tf, CurvyInterpolation interpolation)
 Gets the interpolated local position for a certain TF More...
 
Vector3 InterpolateByDistance (float distance)
 Gets the interpolated local position by distance from the spline/group's start More...
 
Vector3 InterpolateByDistanceFast (float distance)
 Gets the interpolated local position by distance from the spline/group's start. Unlike InterpolateByDistance() this uses a linear approximation More...
 
Vector3 InterpolateFast (float tf)
 Gets the interpolated local position for a certain TF using a linear approximation More...
 
object InterpolateMetadata (System.Type type, float tf)
 Gets an interpolated Metadata value for a certain TF More...
 
InterpolateMetadata< T, U > (float tf)
 Gets an interpolated Metadata value for a certain TF More...
 
Vector3 InterpolateScale (float tf)
 Gets an interpolated Scale for a certain TF More...
 
bool IsControlPointAnOrientationAnchor (CurvySplineSegment controlPoint)
 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. More...
 
bool IsControlPointASegment (CurvySplineSegment controlPoint)
 Is the control point the start of a segment? More...
 
bool IsControlPointVisible (CurvySplineSegment controlPoint)
 Is the control point part of a segment (whether starting it or ending it) More...
 
bool IsPlanar (out int ignoreAxis)
 Checks if the curve is planar More...
 
bool IsPlanar (out bool xplanar, out bool yplanar, out bool zplanar)
 Checks if the curve is planar More...
 
bool IsPlanar (CurvyPlane plane)
 Determines if the spline is at zero position on a certain plane More...
 
void JoinWith (CurvySplineSegment destCP)
 Insert this spline after another spline's destination Control Point and delete this spline More...
 
void MakePlanar (CurvyPlane plane)
 Forces the spline to be at zero position on a certain plane More...
 
void MakePlanar (int axis)
 Equalize one axis of the spline to match the first control points's value More...
 
Vector3 Move (ref float tf, ref int direction, float fDistance, CurvyClamping clamping)
 Alter TF to reflect a movement over a certain portion of the spline/group More...
 
Vector3 MoveBy (ref float tf, ref int direction, float distance, CurvyClamping clamping, float stepSize=0.002f)
 Alter TF to reflect a movement over a certain distance More...
 
Vector3 MoveByAngle (ref float tf, ref int direction, float angle, CurvyClamping clamping, float stepSize=0.002f)
 Alter TF to move until the curvation reached angle. More...
 
Vector3 MoveByAngleFast (ref float tf, ref int direction, float angle, CurvyClamping clamping, float stepSize)
 Alter TF to move until the curvation reached angle. Unlike MoveByAngle, a linear approximation will be used More...
 
Vector3 MoveByFast (ref float tf, ref int direction, float distance, CurvyClamping clamping, float stepSize=0.002f)
 Alter TF to reflect a movement over a certain distance. Unlike MoveBy, a linear approximation will be used More...
 
Vector3 MoveByLengthFast (ref float tf, ref int direction, float distance, CurvyClamping clamping)
 Alter TF to reflect a movement over a certain distance. More...
 
void MoveControlPoints (int startIndex, int count, CurvySplineSegment destCP)
 Moves ControlPoints from this spline, inserting them after a destination ControlPoint of another spline More...
 
Vector3 MoveFast (ref float tf, ref int direction, float fDistance, CurvyClamping clamping)
 Alter TF to reflect a movement over a certain portion of the spline/group, respecting Clamping. Unlike Move() a linear approximation will be used More...
 
void Normalize ()
 Applies a spline's scale to it's Control Points and resets scale More...
 
void Refresh ()
 Refreshs the spline/group More...
 
float SegmentToTF (CurvySplineSegment segment)
 Gets a TF value from a segment More...
 
float SegmentToTF (CurvySplineSegment segment, float localF)
 Gets a TF value from a segment and a local F More...
 
void SetDirty (CurvySplineSegment dirtyControlPoint, SplineDirtyingType dirtyingType)
 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 Follow Up feature. More...
 
void SetDirtyAll ()
 Ensures the whole spline (curve & orientation) will be recalculated on next call to Refresh() More...
 
void SetDirtyAll (SplineDirtyingType dirtyingType, bool dirtyConnectedControlPoints)
 Ensure the whole spline will be recalculated on next call to Refresh() More...
 
void SetDirtyPartial (CurvySplineSegment dirtyControlPoint, SplineDirtyingType dirtyingType)
 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 Follow Up feature. Be aware, this method, and unlike SetDirty, will not mark as dirty the control points connected to the "controlPoint" parameter More...
 
void SetFirstControlPoint (CurvySplineSegment controlPoint)
 Defines the given Control Point to be the first Control Point of the spline More...
 
void SetFromString (string fieldAndValue)
 Event-friedly helper that sets a field or property value More...
 
Vector3 SetPivot (float xRel=0, float yRel=0, float zRel=0, bool preview=false)
 Sets the pivot of the spline More...
 
void Simplify (CurvySplineSegment fromCP=null, CurvySplineSegment toCP=null)
 Simplifies the spline, i.e. remove segments from a certain range More...
 
CurvySpline Split (CurvySplineSegment controlPoint)
 Splits this spline with the parameter controlPoint becoming the first Control Point of the new spline More...
 
void Subdivide (CurvySplineSegment fromCP=null, CurvySplineSegment toCP=null)
 Subdivides the spline, i.e. adds additional segments to a certain range More...
 
void SyncSplineFromHierarchy ()
 Rebuilds the ControlPoints list from the hierarchy. It sets the spline as Dirty More...
 
float TFToDistance (float tf, CurvyClamping clamping=CurvyClamping.Clamp)
 Converts a TF value to a distance More...
 
CurvySplineSegment TFToSegment (float tf, out float localF, CurvyClamping clamping)
 Gets the segment and the local F for a certain TF More...
 
CurvySplineSegment TFToSegment (float tf, CurvyClamping clamping)
 Gets the segment for a certain TF More...
 
CurvySplineSegment TFToSegment (float tf)
 Gets the segment for a certain TF clamped to 0..1 More...
 
CurvySplineSegment TFToSegment (float tf, out float localF)
 Gets the segment and the local F for a certain TF clamped to 0..1 More...
 
Vector3 ToWorldPosition (Vector3 localPosition)
 Shortcut to transform.TransformPoint(localPosition) More...
 

Static Public Member Functions

static Vector3 Bezier (Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
 Cubic-Beziere Interpolation More...
 
static float BezierTangent (float T0, float P0, float P1, float T1, float t)
 
static Vector3 BezierTangent (Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
 
static int CalculateCacheSize (int density, float splineLength, float maxPointsPerUnit)
 Gets the number of Cache Points needed for a certain part of a spline More...
 
static float CalculateSamplingPointsPerUnit (int density, float maxPointsPerUnit)
 Returns the (floating) number of sampling points per world distance unit. More...
 
static Vector3 CatmullRom (Vector3 T0, Vector3 P0, Vector3 P1, Vector3 T1, float f)
 Catmull-Rom Interpolation More...
 
static CurvySpline Create ()
 Creates an empty spline More...
 
static CurvySpline Create (CurvySpline takeOptionsFrom)
 Creates an empty spline with the same settings as another spline More...
 
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)
 Kochanek-Bartels/TCB-Interpolation More...
 

Constructor & Destructor Documentation

Member Function Documentation

Adds a Control Point and refreshes the spline

Returns
a Control Point
CurvySplineSegment [] Add ( params Vector3[]  controlPoints)

Adds several Control Points at once and refresh the spline

Parameters
controlPointsone or more positions
Returns
an array containing the new Control Points
static Vector3 Bezier ( Vector3  T0,
Vector3  P0,
Vector3  P1,
Vector3  T1,
float  f 
)
static

Cubic-Beziere Interpolation

Parameters
T0HandleIn
P0Pn
P1Pn+1
T1HandleOut
ff in the range 0..1
Returns
static float BezierTangent ( float  T0,
float  P0,
float  P1,
float  T1,
float  t 
)
static
static Vector3 BezierTangent ( Vector3  T0,
Vector3  P0,
Vector3  P1,
Vector3  T1,
float  f 
)
static
static int CalculateCacheSize ( int  density,
float  splineLength,
float  maxPointsPerUnit 
)
static

Gets the number of Cache Points needed for a certain part of a spline

Parameters
densityA value between 1 and 100 included. When equal to 100, the number of cache points per world distance unit is equal to maxPointsPerUnit
splineLengththe length of the spline segment
maxPointsPerUnitMaximum number of Cache Points per world distance unit
static float CalculateSamplingPointsPerUnit ( int  density,
float  maxPointsPerUnit 
)
static

Returns the (floating) number of sampling points per world distance unit.

Parameters
densityA value between 1 and 100 included. When equal to 100, the number of sampling points per world distance unit is equal to maxPointsPerUnit
maxPointsPerUnitMaximum number of sampling points per world distance unit
Returns
bool CanControlPointHaveFollowUp ( CurvySplineSegment  controlPoint)

Can this control point have a follow up? 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

Parameters
controlPoint
Returns
static Vector3 CatmullRom ( Vector3  T0,
Vector3  P0,
Vector3  P1,
Vector3  T1,
float  f 
)
static

Catmull-Rom Interpolation

Parameters
T0Pn-1 (In Tangent)
P0Pn
P1Pn+1
T1Pn+2 (Out Tangent)
ff in the range 0..1
Returns
the interpolated position
float ClampDistance ( float  distance,
CurvyClamping  clamping 
)

Clamps absolute position

float ClampDistance ( float  distance,
CurvyClamping  clamping,
float  min,
float  max 
)

Clamps absolute position

float ClampDistance ( float  distance,
ref int  dir,
CurvyClamping  clamping 
)

Clamps absolute position and sets new direction

float ClampDistance ( float  distance,
ref int  dir,
CurvyClamping  clamping,
float  min,
float  max 
)

Clamps absolute position and sets new direction

void Clear ( )

Removes all control points

static CurvySpline Create ( )
static

Creates an empty spline

static CurvySpline Create ( CurvySpline  takeOptionsFrom)
static

Creates an empty spline with the same settings as another spline

Parameters
takeOptionsFromanother spline
void Delete ( CurvySplineSegment  controlPoint,
bool  skipRefreshingAndEvents = false 
)

Deletes a Control Point

Parameters
controlPointa Control Point
skipRefreshingAndEventsIf true, the spline's Refresh method will not be called, and the relevant events will not be triggered
CurvySplineSegment DistanceToSegment ( float  distance,
CurvyClamping  clamping = CurvyClamping.Clamp 
)

Gets the segment a certain distance lies within

Parameters
distancea distance in the range 0..Length
clampingclamping to use
Returns
a spline segment or null
CurvySplineSegment DistanceToSegment ( float  distance,
out float  localDistance,
CurvyClamping  clamping = CurvyClamping.Clamp 
)

Gets the segment a certain distance lies within

Parameters
distancea distance in the range 0..Length
localDistancegets the remaining distance inside the segment
clampingclamping to use
Returns
a spline segment
float DistanceToTF ( float  distance,
CurvyClamping  clamping = CurvyClamping.Clamp 
)

Converts a distance to a TF value

Parameters
distancedistance
clampingClamping to use
Returns
a TF value in the range 0..1
void Equalize ( CurvySplineSegment  fromCP = null,
CurvySplineSegment  toCP = null 
)

Equalizes the segment length of a certain range

Parameters
fromCPstarting ControlPoint
toCPending ControlPoint
float ExtrapolateDistanceToTF ( float  tf,
float  distance,
float  stepSize 
)

Converts a unit distance into TF-distance by extrapolating the curvation at a given point on the curve

Parameters
tfthe current TF value
distancethe distance in world units
stepSizestepSize defines the accuracy
Returns
the distance in TF
float ExtrapolateDistanceToTFFast ( float  tf,
float  distance,
float  stepSize 
)

Converts a unit distance into TF-distance by extrapolating the curvation at a given point on the curve using a linear approximation

Parameters
tfthe current TF value
distancethe distance in world units
stepSizestepSize defines the accuracy
Returns
the distance in TF
void Flip ( )

Flips the direction of the spline, i.e. the first Control Point will become the last and vice versa.

Vector3 [] GetApproximation ( Space  space = Space.Self)

Gets an array containing all approximation points

Parameters
spaceWhether to use local or global space

This can be used to feed meshbuilders etc...

Returns
an array of world/local positions
Vector3 [] GetApproximationPoints ( float  fromTF,
float  toTF,
bool  includeEndPoint = true 
)

Gets all Approximation points for a given spline part

Parameters
fromTFstart TF
toTFend TF
includeEndPointWhether the end position should be included
Returns
an array of Approximation points
Vector3 [] GetApproximationT ( )

Gets an array containing all approximation tangents

This can be used to feed meshbuilders etc...

Returns
an array of tangents
Vector3 [] GetApproximationUpVectors ( )

Gets an array containing all approximation Up-Vectors

This can be used to feed meshbuilders etc...

Returns
an array of Up-Vectors
short GetControlPointIndex ( CurvySplineSegment  controlPoint)

Index of the control point

Parameters
controlPoint
Returns
short GetControlPointOrientationAnchorIndex ( CurvySplineSegment  controlPoint)

The index of the control point being the orientation anchor for the anchor group containing the controlPoint Is -1 for non visible control points

Vector3 GetExtrusionPoint ( float  tf,
float  radius,
float  angle 
)

Gets the point at a certain radius and angle on the plane defined by P and it's Tangent

Parameters
tfTF value identifying position on spline (0..1)
radiusradius in world units
angleangle in degrees
Returns
the extruded point
Vector3 GetExtrusionPointFast ( float  tf,
float  radius,
float  angle 
)

Gets the point at a certain radius and angle on the plane defined by P and it's Tangent, using a linear interpolation

Parameters
tfTF value identifying position on spline (0..1)
radiusradius in world units
angleangle in degrees
Returns
the extruded point
Component GetMetadata ( System.Type  type,
float  tf 
)

Gets metadata for a certain TF

Parameters
typeMetadata type interfacing ICurvyMetadata
tfTF value reflecting position on spline (0..1)
Returns
the metadata
T GetMetadata< T > ( float  tf)

Gets metadata for a certain TF

Template Parameters
TMetadata type interfacing ICurvyMetadata
Parameters
tfTF value reflecting position on spline (0..1)
Returns
the metadata
Type Constraints
T :Component 
T :ICurvyMetadata 
float GetNearestPointTF ( Vector3  localPosition)

Gets the TF value that is nearest to localPosition

Parameters
localPositiona point in spline's local space

The speed as well as the accuracy depends on the Granularity

Returns
a TF value in the range 0..1 or -1 on error
float GetNearestPointTF ( Vector3  localPosition,
out Vector3  nearest 
)

Gets the TF value that is nearest to localPosition

Parameters
localPositiona point in spline's local space
nearestreturns the nearest position

The speed as well as the accuracy depends on the Granularity

Returns
a TF value in the range 0..1 or -1 on error
float GetNearestPointTF ( Vector3  localPosition,
int  startSegmentIndex = 0,
int  stopSegmentIndex = -1 
)

Gets the TF value that is nearest to localPosition

Parameters
localPositiona point in spline's local space
startSegmentIndexthe segment index to start searching
stopSegmentIndexthe segment index to stop searching or -1 to search until end

The speed as well as the accuracy depends on the Granularity

Returns
a TF value in the range 0..1 or -1 on error
float GetNearestPointTF ( Vector3  localPosition,
out Vector3  nearest,
int  startSegmentIndex = 0,
int  stopSegmentIndex = -1 
)

Gets the TF value that is nearest to localPosition

Parameters
localPositiona point in spline's local space
nearestreturns the nearest position
startSegmentIndexthe segment index to start searching
stopSegmentIndexthe segment index to stop searching or -1 to search until end

The speed as well as the accuracy depends on the Granularity

Returns
a TF value in the range 0..1 or -1 on error
float GetNearestPointTF ( Vector3  localPosition,
out Vector3  nearestPoint,
[CanBeNull] out CurvySplineSegment  nearestSegment,
out float  nearestSegmentF,
int  startSegmentIndex = 0,
int  stopSegmentIndex = -1 
)

Gets the TF value that is nearest to localPosition

Parameters
localPositiona point in spline's local space
nearestPointreturns the nearest position
nearestSegmentreturns the nearest segment
nearestSegmentFLocalF of the nearest position on the nearest segment
startSegmentIndexthe segment index to start searching
stopSegmentIndexthe segment index to stop searching or -1 to search until end

The speed as well as the accuracy depends on the Granularity

Returns
a TF value in the range 0..1 or -1 on error
CurvySplineSegment GetNextControlPoint ( CurvySplineSegment  controlPoint)

The next control point on the spline. Is null if none. Follow up not considered

Parameters
controlPoint
Returns
short GetNextControlPointIndex ( CurvySplineSegment  controlPoint)

The index of the next control point on the spline. Is -1 if none. Follow up not considered

Parameters
controlPoint
Returns
CurvySplineSegment GetNextControlPointUsingFollowUp ( CurvySplineSegment  controlPoint)

The next control point. Is null if none. Follow up is considered

Parameters
controlPoint
Returns
CurvySplineSegment GetNextSegment ( CurvySplineSegment  segment)

The next control point on the spline if it starts a segment. Is null if none. Follow up not considered

Parameters
segment
Returns
Quaternion GetOrientationFast ( float  tf,
bool  inverse = false 
)

Gets a rotation looking to Tangent with the head upwards along the Up-Vector

Parameters
tfTF value reflecting position on spline (0..1)
inversewhether the orientation should be inversed or not
Returns
a rotation
Vector3 GetOrientationUpFast ( float  tf)

Gets the Up-Vector for a certain TF based on the splines' Orientation mode

Parameters
tfTF value reflecting position on spline (0..1)
Returns
the Up-Vector</returns
Vector3 [] GetPolygon ( float  fromTF,
float  toTF,
float  maxAngle,
float  minDistance,
float  maxDistance,
out List< float >  vertexTF,
out List< Vector3 >  vertexTangents,
bool  includeEndPoint = true,
float  stepSize = 0.01f 
)

Gets an array containing spline positions

Parameters
fromTFstart TF
toTFend TF
maxAnglemaximum angle in degrees
minDistanceminimum distance between two points
maxDistancemaximum distance between two points
vertexTFStores the TF of the resulting points
vertexTangentsStores the Tangents of the resulting points
includeEndPointWhether the end position should be included
stepSizethe stepsize to use
Returns
an array of interpolated positions
Vector3 [] GetPolygonByAngle ( float  angle,
float  minDistance 
)

Gets an array containing spline positions by angle difference

Parameters
anglemaximum angle in degrees
minDistanceminimum distance between two points
Returns
an array of interpolated positions
CurvySplineSegment GetPreviousControlPoint ( CurvySplineSegment  controlPoint)

The previous control point on the spline. Is null if none. Follow up not considered

Parameters
controlPoint
Returns
short GetPreviousControlPointIndex ( CurvySplineSegment  controlPoint)

The index of the previous control point on the spline. Is -1 if none. Follow up not considered

Parameters
controlPoint
Returns
CurvySplineSegment GetPreviousControlPointUsingFollowUp ( CurvySplineSegment  controlPoint)

The previous control point. Is null if none. Follow up is considered

Parameters
controlPoint
Returns
CurvySplineSegment GetPreviousSegment ( CurvySplineSegment  segment)

The previous control point on the spline if it starts a segment. Is null if none. Follow up not considered.

Parameters
segment
Returns
Vector3 GetRotatedUp ( float  tf,
float  angle 
)

Gets a rotated Up-Vector

Parameters
tfTF value identifying position on spline (0..1)
angleangle in degrees
Returns
the rotated Up-Vector
Vector3 GetRotatedUpFast ( float  tf,
float  angle 
)

Gets an rotated Up-Vector using cached values

Parameters
tfTF value identifying position on spline (0..1)
angleangle in degrees
Returns
the rotated Up-Vector
short GetSegementIndex ( CurvySplineSegment  segment)

Index of the segment that this control point starts. -1 if control point does not start a segment.

Parameters
segment
Returns
short GetSegmentIndex ( CurvySplineSegment  segment)

Index of the segment that this control point starts. -1 if control point does not start a segment.

Parameters
segment
Returns
Vector3 GetTangent ( float  tf)

Gets the normalized tangent for a certain TF

Parameters
tfTF value identifying position on spline (0..1)
Returns
a tangent vector
Vector3 GetTangent ( float  tf,
Vector3  localPosition 
)

Gets the normalized tangent for a certain TF with a known local position for TF

This saves one interpolation

Parameters
tfTF value identifying position on spline (0..1)
localPositionThe interpolated local position for TF
Returns
a tangent vector
Vector3 GetTangentByDistance ( float  distance)

Gets the normalized tangent by distance from the spline/group's start.

Parameters
distancedistance in the range of 0..Length
Returns
the tangent/direction
Vector3 GetTangentByDistanceFast ( float  distance)

Gets the normalized tangent by distance from the spline/group's start. Unlike TangentByDistance() this uses a linear approximation

Parameters
distancedistance in the range of 0..Length
Returns
the tangent/direction
Vector3 GetTangentFast ( float  tf)

Gets the normalized tangent for a certain TF using a linear approximation

Parameters
tfTF value identifying position on spline (0..1)
Returns
a tangent vector
CurvySplineSegment InsertAfter ( CurvySplineSegment  controlPoint,
bool  skipRefreshingAndEvents = false 
)

Inserts a Control Point after a given Control Point

If you add several Control Points in a row, using Add(Vector3[] controlPoints) will be more efficient

Parameters
controlPointA 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
skipRefreshingAndEventsIf true, the spline's Refresh method will not be called, and the relevant events will not be triggered
Returns
the new Control Point
CurvySplineSegment InsertAfter ( CurvySplineSegment  controlPoint,
Vector3  globalPosition,
bool  skipRefreshingAndEvents = false 
)

Inserts a Control Point after a given Control Point

If you add several Control Points in a row, using Add(Vector3[] controlPoints) will be more efficient

Parameters
controlPointA 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
globalPositionThe position of the control point at its creation
skipRefreshingAndEventsIf true, the spline's Refresh method will not be called, and the relevant events will not be triggered
Returns
the new Control Point
CurvySplineSegment InsertBefore ( CurvySplineSegment  controlPoint,
bool  skipRefreshingAndEvents = false 
)

Inserts a Control Point before a given Control Point

If you add several Control Points in a row, using Add(Vector3[] controlPoints) will be more efficient

Parameters
controlPointA 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
Returns
a Control Point
Parameters
skipRefreshingAndEventsIf true, the spline's Refresh method will not be called, and the relevant events will not be triggered
CurvySplineSegment InsertBefore ( CurvySplineSegment  controlPoint,
Vector3  globalPosition,
bool  skipRefreshingAndEvents = false 
)

Inserts a Control Point before a given Control Point

If you add several Control Points in a row, using Add(Vector3[] controlPoints) will be more efficient

Parameters
controlPointA 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
globalPositionThe position of the control point at its creation
skipRefreshingAndEventsIf true, the spline's Refresh method will not be called, and the relevant events will not be triggered
Returns
a Control Point
Vector3 Interpolate ( float  tf)

Gets the interpolated local position for a certain TF

TF (Total Fragment) relates to the total length of the spline

Parameters
tfTF value identifying position on spline (0..1)
Returns
the interpolated local position
Vector3 Interpolate ( float  tf,
CurvyInterpolation  interpolation 
)

Gets the interpolated local position for a certain TF

TF (Total Fragment) relates to the total length of the spline

Parameters
tfTF value identifying position on spline (0..1)
interpolationthe interpolation to use
Returns
the interpolated local position
Vector3 InterpolateByDistance ( float  distance)

Gets the interpolated local position by distance from the spline/group's start

Parameters
distancedistance in the range of 0..Length
Returns
the interpolated local position
Vector3 InterpolateByDistanceFast ( float  distance)

Gets the interpolated local position by distance from the spline/group's start. Unlike InterpolateByDistance() this uses a linear approximation

Parameters
distancedistance in the range of 0..Length
Returns
the interpolated local position
Vector3 InterpolateFast ( float  tf)

Gets the interpolated local position for a certain TF using a linear approximation

TF (Total Fragment) relates to the total length of the spline

Parameters
tfTF value reflecting position on spline (0..1)
Returns
the interpolated local position
object InterpolateMetadata ( System.Type  type,
float  tf 
)

Gets an interpolated Metadata value for a certain TF

Parameters
typeMetadata type interfacing ICurvyInterpolatableMetadata
tfTF value reflecting position on spline (0..1)
Returns
the interpolated value
U InterpolateMetadata< T, U > ( float  tf)

Gets an interpolated Metadata value for a certain TF

Template Parameters
TMetadata type interfacing ICurvyInterpolatableMetadata
UReturn Value type of T
Parameters
tfTF value reflecting position on spline (0..1)
Returns
the interpolated value
Type Constraints
T :Component 
T :ICurvyInterpolatableMetadata<U> 
Vector3 InterpolateScale ( float  tf)

Gets an interpolated Scale for a certain TF

TF (Total Fragment) relates to the total length of the spline

Parameters
tfTF value reflecting position on spline(0..1)
Returns
the interpolated value
bool IsControlPointAnOrientationAnchor ( CurvySplineSegment  controlPoint)

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.

Parameters
controlPoint
Returns
bool IsControlPointASegment ( CurvySplineSegment  controlPoint)

Is the control point the start of a segment?

Parameters
controlPoint
Returns
bool IsControlPointVisible ( CurvySplineSegment  controlPoint)

Is the control point part of a segment (whether starting it or ending it)

Parameters
controlPoint
Returns
bool IsPlanar ( out int  ignoreAxis)

Checks if the curve is planar

Parameters
ignoreAxisreturns the axis that can be ignored (0=x,1=y,2=z)
Returns
true if a planar axis was found
bool IsPlanar ( out bool  xplanar,
out bool  yplanar,
out bool  zplanar 
)

Checks if the curve is planar

Parameters
xplanarwhether the x-axis is planar
yplanarwhether the y-axis is planar
zplanarwhether the z-axis is planar
Returns
true if at least on axis is planar
bool IsPlanar ( CurvyPlane  plane)

Determines if the spline is at zero position on a certain plane

Parameters
planethe plane the spline should be tested against
Returns
true if the spline is on the plane
void JoinWith ( CurvySplineSegment  destCP)

Insert this spline after another spline's destination Control Point and delete this spline

Parameters
destCPthe Control Point of the destination spline
void MakePlanar ( CurvyPlane  plane)

Forces the spline to be at zero position on a certain plane

Parameters
planethe plane the should be on
void MakePlanar ( int  axis)

Equalize one axis of the spline to match the first control points's value

Parameters
axisthe axis to equalize (0=x,1=y,2=z)
Vector3 Move ( ref float  tf,
ref int  direction,
float  fDistance,
CurvyClamping  clamping 
)

Alter TF to reflect a movement over a certain portion of the spline/group

fDistance relates to the total spline, so longer splines will result in faster movement for constant fDistance

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
fDistancethe percentage of the spline/group to move
clampingclamping mode
Returns
the interpolated local position
Vector3 MoveBy ( ref float  tf,
ref int  direction,
float  distance,
CurvyClamping  clamping,
float  stepSize = 0.002f 
)

Alter TF to reflect a movement over a certain distance

MoveBy works by extrapolating current curvation, so results may be inaccurate for large distances

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
distancethe distance in world units to move
clampingclamping mode
stepSizestepSize defines the accuracy
Returns
the interpolated local position
Vector3 MoveByAngle ( ref float  tf,
ref int  direction,
float  angle,
CurvyClamping  clamping,
float  stepSize = 0.002f 
)

Alter TF to move until the curvation reached angle.

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
anglethe angle in degrees
clampingthe clamping mode. CurvyClamping.PingPong isn't supported!
stepSizestepSize defines the accuracy
Returns
the interpolated local position
Vector3 MoveByAngleFast ( ref float  tf,
ref int  direction,
float  angle,
CurvyClamping  clamping,
float  stepSize 
)

Alter TF to move until the curvation reached angle. Unlike MoveByAngle, a linear approximation will be used

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
anglethe angle in degrees
clampingthe clamping mode. CurvyClamping.PingPong isn't supported!
stepSizestepSize defines the accuracy
Returns
the interpolated local position
Vector3 MoveByFast ( ref float  tf,
ref int  direction,
float  distance,
CurvyClamping  clamping,
float  stepSize = 0.002f 
)

Alter TF to reflect a movement over a certain distance. Unlike MoveBy, a linear approximation will be used

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
distancethe distance in world units to move
clampingclamping mode
stepSizestepSize defines the accuracy
Returns
the interpolated local position
Vector3 MoveByLengthFast ( ref float  tf,
ref int  direction,
float  distance,
CurvyClamping  clamping 
)

Alter TF to reflect a movement over a certain distance.

MoveByLengthFast works by using actual lengths

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
distancethe distance in world units to move
clampingclamping mode
Returns
the interpolated local position
void MoveControlPoints ( int  startIndex,
int  count,
CurvySplineSegment  destCP 
)

Moves ControlPoints from this spline, inserting them after a destination ControlPoint of another spline

Parameters
startIndexControlPointIndex of the first CP to move
countnumber of ControlPoints to move
destCPControlPoint at the destination spline to insert after
Vector3 MoveFast ( ref float  tf,
ref int  direction,
float  fDistance,
CurvyClamping  clamping 
)

Alter TF to reflect a movement over a certain portion of the spline/group, respecting Clamping. Unlike Move() a linear approximation will be used

fDistance relates to the total spline, so longer splines will result in faster movement for constant fDistance

Parameters
tfthe current TF value
directionthe current direction, 1 or -1
fDistancethe percentage of the spline/group to move
clampingclamping mode
Returns
the interpolated local position
void Normalize ( )

Applies a spline's scale to it's Control Points and resets scale

void Refresh ( )

Refreshs the spline/group

This is called automatically on the next Update() if any changes are pending

float SegmentToTF ( CurvySplineSegment  segment)

Gets a TF value from a segment

Parameters
segmenta segment
Returns
a TF value in the range 0..1
float SegmentToTF ( CurvySplineSegment  segment,
float  localF 
)

Gets a TF value from a segment and a local F

Parameters
segmenta segment
localFF of this segment in the range 0..1
Returns
a TF value in the range 0..1
void SetDirty ( CurvySplineSegment  dirtyControlPoint,
SplineDirtyingType  dirtyingType 
)

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 Follow Up feature.

Parameters
dirtyControlPointthe Control Point to dirty
dirtyingTypeDefines what aspect should be dirtied
void SetDirtyAll ( )

Ensures the whole spline (curve & orientation) will be recalculated on next call to Refresh()

void SetDirtyAll ( SplineDirtyingType  dirtyingType,
bool  dirtyConnectedControlPoints 
)

Ensure the whole spline will be recalculated on next call to Refresh()

Parameters
dirtyingTypeDefines what aspect should be dirtied
dirtyConnectedControlPointswhether to set dirty other splines's control points connected to one of this spline's control points
void SetDirtyPartial ( CurvySplineSegment  dirtyControlPoint,
SplineDirtyingType  dirtyingType 
)

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 Follow Up feature. Be aware, this method, and unlike SetDirty, will not mark as dirty the control points connected to the "controlPoint" parameter

Parameters
dirtyControlPointthe Control Point to dirty
dirtyingTypeDefines what aspect should be dirtied
void SetFirstControlPoint ( CurvySplineSegment  controlPoint)

Defines the given Control Point to be the first Control Point of the spline

Parameters
controlPointOne of this spline's control points
void SetFromString ( string  fieldAndValue)

Event-friedly helper that sets a field or property value

Parameters
fieldAndValuee.g. "MyValue=42"
Vector3 SetPivot ( float  xRel = 0,
float  yRel = 0,
float  zRel = 0,
bool  preview = false 
)

Sets the pivot of the spline

Parameters
xRel-1 to 1
yRel-1 to 1
zRel-1 to 1
previewif true, only return the new pivot position
Returns
the new pivot position
void Simplify ( CurvySplineSegment  fromCP = null,
CurvySplineSegment  toCP = null 
)

Simplifies the spline, i.e. remove segments from a certain range

Parameters
fromCPstarting ControlPoint
toCPending ControlPoint
CurvySpline Split ( CurvySplineSegment  controlPoint)

Splits this spline with the parameter controlPoint becoming the first Control Point of the new spline

Returns
The new spline
void Subdivide ( CurvySplineSegment  fromCP = null,
CurvySplineSegment  toCP = null 
)

Subdivides the spline, i.e. adds additional segments to a certain range

Parameters
fromCPstarting ControlPoint
toCPending ControlPoint
void SyncSplineFromHierarchy ( )

Rebuilds the ControlPoints list from the hierarchy. It sets the spline as Dirty

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 
)
static

Kochanek-Bartels/TCB-Interpolation

Parameters
T0Pn-1 (In Tangent)
P0Pn
P1Pn+1
T1Pn+2 (Out Tangent)
ff in the range 0..1
FT0Start Tension
FC0Start Continuity
FB0Start Bias
FT1End Tension
FC1End Continuity
FB1End Bias
Returns
the interpolated position
float TFToDistance ( float  tf,
CurvyClamping  clamping = CurvyClamping.Clamp 
)

Converts a TF value to a distance

Parameters
tfa TF value
clampingClamping to use
Returns
distance from the first segment's Control Point
CurvySplineSegment TFToSegment ( float  tf,
out float  localF,
CurvyClamping  clamping 
)

Gets the segment and the local F for a certain TF

Parameters
tfthe TF value
localFgets the remaining localF in the range 0..1
clampingClamping to use
Returns
the segment the given TF is inside
CurvySplineSegment TFToSegment ( float  tf,
CurvyClamping  clamping 
)

Gets the segment for a certain TF

Parameters
tfthe TF value
clampingClamping to use
Returns
the segment the given TF is inside
CurvySplineSegment TFToSegment ( float  tf)

Gets the segment for a certain TF clamped to 0..1

Parameters
tfthe TF value
Returns
the segment the given TF is inside
CurvySplineSegment TFToSegment ( float  tf,
out float  localF 
)

Gets the segment and the local F for a certain TF clamped to 0..1

Parameters
tfthe TF value
localFgets the remaining localF in the range 0..1
Returns
the segment the given TF is inside
Vector3 ToWorldPosition ( Vector3  localPosition)

Shortcut to transform.TransformPoint(localPosition)

Member Data Documentation

bool ShowGizmos = true

Whether to show the Gizmos enabled in the view settings or not at all

Property Documentation

bool AutoEndTangents
getset

Whether the first/last Control Point should act as the end tangent, too.

Ignored by linear splines and Bezier ones

float AutoHandleDistance
getset

Gets or sets the default Handle distance for Bezier splines

float Bias
getset

Global Bias

This only applies to TCB interpolation

Bounds Bounds
get

The bounding box of the spline

int CacheDensity
getset

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

int CacheSize
get

Gets total Cache Size

bool CheckTransform
getset

Whether the spline should automatically refresh when a Control Point's position change

Enable this if you animate a Control Point's transform!

bool Closed
getset

Whether this spline is closed or not

AutoEndTangents's value can be updated depending on Close value

float Continuity
getset

Global Continuity

This only applies to TCB interpolation

int ControlPointCount
get

Gets the number of Control Points

ReadOnlyCollection<CurvySplineSegment> ControlPointsList
get

The list of control points

int Count
get

Gets the number of Segments

bool Dirty
get

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

CurvySplineSegment FirstSegment
get

Gets the first segment of the spline

CurvySplineSegment FirstVisibleControlPoint
get

Gets the first visible Control Point (equals the first segment or this[0])

Can be null, for example for a Catmull-Rom spline whith only two splines and AutoEndTangent set to false

Color GizmoColor
getset

Gets or sets Spline color

Color GizmoSelectionColor
getset

Gets or sets selected segment color

bool GlobalCoordinatesChangedThisFrame
get

Returns true if the global position, rotation or scale of the spline has changed this frame

CurvyInterpolation Interpolation
getset

The interpolation method used by this spline

AutoEndTangents's value can be updated depending on Interpolation value

bool IsClosed
get
bool IsInitialized
get

Whether the spline is fully initialized and all segments loaded

CurvySplineSegment LastSegment
get

Gets the last segment of the spline

CurvySplineSegment LastVisibleControlPoint
get

Gets the last visible Control Point (i.e. the end CP of the last segment)

Is null if spline has no segments

float Length
get

Gets the total length of the Spline or SplineGroup

The accuracy depends on the current Granularity (higher Granularity means more exact values)

float MaxPointsPerUnit
getset

The maximum number of sampling points per world distance unit. Sampling is used in caching or shape extrusion for example"

CurvySpline NextSpline
get

Gets the FollowUp spline of the last Control Point, i.e. the next fully connected spline

CurvyControlPointEvent OnAfterControlPointAdd
getset

Callback after a Control Point has been added and the spline was refreshed

CurvySplineEvent OnAfterControlPointChanges
getset

Callback after one or more Control Points have been added or deleted

This executes last, after individual add/delete events and OnRefresh

CurvyControlPointEvent OnBeforeControlPointAdd
getset

Callback before a Control Point is about to be added. Return false to cancel the execution

CurvyControlPointEvent OnBeforeControlPointDelete
getset

Callback before a Control Point is about to be deleted. Return false to cancel the execution.

CurvySplineEvent OnRefresh
getset
CurvyOrientation Orientation
getset

Orientation mode

CurvySpline PreviousSpline
get

Gets the FollowUp spline of the first Control Point, i.e. the previous fully connected spline

bool RestrictTo2D
getset

Whether to restrict Control Points to the local X/Y plane

float Tension
getset

Global Tension

This only applies to TCB interpolation

CurvySplineSegment this[int idx]
get

Gets the Segment at a certain index

Parameters
idxan index in the range 0..Count
Returns
the corresponding spline segment
CurvyUpdateMethod UpdateIn
getset
bool UsePooling
getset

Whether to use GameObject pooling for Control Points at runtime

bool UseThreading
getset

Whether to use threading where applicable or not. Threading is currently not supported when targetting WebGL and Universal Windows Platform


The documentation for this class was generated from the following files: