Curvy  4.0.0
CurvyUISpline Class Reference
+ Inheritance diagram for CurvyUISpline:
+ Collaboration diagram for CurvyUISpline:

Detailed Description

Spline component that fits perfectly to uGUI Canvas

Static Public Member Functions

static CurvyUISpline CreateUISpline (string gameObjectName="Curvy UI Spline")
 Creates a GameObject with a CurvyUISpline attached More...
 
- Static Public Member Functions inherited from CurvySpline
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...
 

Protected Member Functions

override void Reset ()
 

Additional Inherited Members

- Public Attributes inherited from CurvySpline
bool ShowGizmos = true
 Whether to show the Gizmos enabled in the view settings or not at all More...
 
- Properties inherited from CurvySpline
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 inherited from CurvySpline
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...
 

Member Function Documentation

static CurvyUISpline CreateUISpline ( string  gameObjectName = "Curvy UI Spline")
static

Creates a GameObject with a CurvyUISpline attached

Returns
the component
override void Reset ( )
protected

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