Class Spline
The Spline class is a collection of Bezier
Implements
Inherited Members
Namespace: UnityEngine .Splines
Assembly: solution.dll
Syntax
[Serializable]
public class Spline : ISpline, IReadOnlyList<BezierKnot>, IReadOnlyCollection<BezierKnot>, IList<BezierKnot>, ICollection<BezierKnot>, IEnumerable<BezierKnot>, IEnumerable
Constructors
Name | Description |
---|---|
Spline() | Default constructor creates a spline with no knots, not closed. |
Spline(IEnumerable<Bezier |
Create a spline from a collection of Bezier |
Spline(int, bool) | Create a spline with a pre-allocated knot capacity. |
Spline(Spline) | Create a copy of a spline. |
Properties
Name | Description |
---|---|
Closed | Whether the spline is open (has a start and end point) or closed (forms an unbroken loop). |
Count | Return the number of knots. |
Is |
Returns true if this Spline is read-only, false if it is mutable. |
this[int] | Get or set the knot at |
Knots | A collection of Bezier |
Methods
Name | Description |
---|---|
Add(Bezier |
Adds a knot to the spline. |
Add(Bezier |
Adds a knot to the spline. |
Add(Bezier |
Adds a knot to the spline. |
Clear() | Remove all knots from the spline. |
Contains(Bezier |
Return true if a knot is present in the spline. |
Copy(Spline) | Copy the values from |
Copy |
Copies the contents of the knot list to an array starting at an index. |
Enforce |
Ensure that a Bezier |
Enforce |
Ensure that a Bezier |
Get |
Gets the tension value for the requested index. |
Get |
Get a Bezier |
Get |
Return the normalized interpolation (t) corresponding to a distance on a Bezier |
Get |
Return the length of a curve. |
Get |
Return the up vector for a t ratio on the curve. |
Get |
Get an enumerator that iterates through the Bezier |
Get |
Get a collection of the keys of embedded Spline |
Get |
Get a collection of the Spline |
Get |
Get a collection of the keys of embedded Spline |
Get |
Get a collection of the Spline |
Get |
Get a collection of the keys of embedded Spline |
Get |
Get a collection of the Spline |
Get |
Return the sum of all curve lengths, accounting for Closed state. Note that this value is not accounting for transform hierarchy. If you require length in world space use |
Get |
Get a collection of the keys of embedded Spline |
Get |
Get a collection of the Spline |
Get |
Returns a Spline |
Get |
Returns a Spline |
Get |
Returns a Spline |
Get |
Returns a Spline |
Get |
Get a collection of the keys of embedded Spline |
Get |
Gets the Tangent |
Index |
Return the first index of an element matching item. |
Insert(int, Bezier |
Insert a Bezier |
Insert(int, Bezier |
Inserts a Bezier |
Insert(int, Bezier |
Adds a Bezier |
On |
Invoked any time a spline property is modified. |
Remove(Bezier |
Removes the first matching knot. |
Remove |
Removes the knot at the specified index. |
Remove |
Remove a Spline |
Remove |
Remove a Spline |
Remove |
Remove a Spline |
Remove |
Remove a Spline |
Resize(int) | Change the size of the Bezier |
Set |
Sets the tension that is used to calculate the magnitude of tangents when the Tangent |
Set |
Sets the tension that is used to calculate the magnitude of tangents when the Tangent |
Set |
Sets the tension that is used to calculate the magnitude of tangents when the Tangent |
Set |
Set the tension that is used to calculate the magnitude of tangents when the Tangent |
Set |
Set the Spline |
Set |
Set the Spline |
Set |
Set the Spline |
Set |
Sets the value of a knot at index. |
Set |
Sets the value of a knot index without invoking any change callbacks. |
Set |
Set the Spline |
Set |
Sets the Tangent |
Set |
Sets the Tangent |
Set |
Sets the Tangent |
Set |
Sets the Tangent |
To |
Create an array of spline knots. |
Try |
Retrieve a Spline |
Try |
Retrieve a Spline |
Try |
Retrieve a Spline |
Try |
Retrieve a Spline |
Warmup() | Ensure that all caches contain valid data. Call this to avoid unexpected performance costs when accessing spline data. Caches remain valid until any part of the spline state is modified. |
Events
Name | Description |
---|---|
Changed | Invoked any time a spline is modified. |