Class SplineUtility
A collection of methods for extracting information about Spline types.
Inherited Members
Namespace: UnityEngine .Splines
Assembly: solution.dll
Syntax
public static class SplineUtility
Remarks
SplineUtility
methods do not consider Transform values except where explicitly requested. To perform operations in world space, you can use the Spline
Fields
Name | Description |
---|---|
Catmull |
The tension value for a Catmull-Rom type spline.
Use with Set |
Default |
The default tension value used for Auto |
Draw |
The default resolution used when unrolling a curve to draw a preview in the Scene View. Pick resolution is used when determining how many segments are required to unroll a curve. Unrolling is the process of calculating a series of line segments to approximate a curve. Some functions in SplineUtility allow you to specify a resolution. Lower resolution means fewer segments, while higher resolutions result in more segments. Use lower resolutions where performance is critical and accuracy is not paramount. Use higher resolution where a fine degree of accuracy is necessary and performance is less important. |
Pick |
The default resolution used when unrolling a curve to hit test while picking (selecting a spline with a cursor). Pick resolution is used when determining how many segments are required to unroll a curve. Unrolling is the process of calculating a series of line segments to approximate a curve. Some functions in SplineUtility allow you to specify a resolution. Lower resolution means fewer segments, while higher resolutions result in more segments. Use lower resolutions where performance is critical and accuracy is not paramount. Use higher resolution where a fine degree of accuracy is necessary and performance is less important. |
Pick |
The maximum resolution allowed when unrolling a curve to hit test while picking (selecting a spline with a cursor). Pick resolution is used when determining how many segments are required to unroll a curve. Unrolling is the process of calculating a series of line segments to approximate a curve. Some functions in SplineUtility allow you to specify a resolution. Lower resolution means fewer segments, while higher resolutions result in more segments. Use lower resolutions where performance is critical and accuracy is not paramount. Use higher resolution where a fine degree of accuracy is necessary and performance is less important. |
Pick |
The minimum resolution allowable when unrolling a curve to hit test while picking (selecting a spline with a cursor). Pick resolution is used when determining how many segments are required to unroll a curve. Unrolling is the process of calculating a series of line segments to approximate a curve. Some functions in SplineUtility allow you to specify a resolution. Lower resolution means fewer segments, while higher resolutions result in more segments. Use lower resolutions where performance is critical and accuracy is not paramount. Use higher resolution where a fine degree of accuracy is necessary and performance is less important. |
Methods
Name | Description |
---|---|
Add |
Creates a new spline and adds it to the ISpline |
Add |
Add a new Spline to the ISpline |
Are |
Checks if two knots from an ISpline |
Calculate |
Calculate the length of a spline when transformed by a matrix. |
Calculate |
Calculate the normal (up) vector of a spline. This is a more accurate but more expensive operation
than Evaluate |
Convert |
Given a normalized interpolation ratio, calculate the associated interpolation value in another Path |
Convert |
Given an interpolation value using one of the various Path |
Copy |
Copies knot links between two splines of the same ISpline |
Curve |
Given an interpolation value for a curve, calculate the relative normalized spline interpolation. |
Duplicate |
Duplicate a spline between 2 knots of a source spline. |
Evaluate |
Return an interpolated acceleration at ratio t. |
Evaluate |
Return the curvature center at ratio t. The curvature center represents the center of the circle that is tangent to the curve at t. This circle is in the plane defined by the curve velocity (tangent) and the curve acceleration at that point. |
Evaluate |
Return an interpolated curvature at ratio t. |
Evaluate |
Computes the interpolated position for NURBS defined by order, controlPoints, and knotVector at ratio t. |
Evaluate |
Return an interpolated position at ratio t. |
Evaluate |
Return an interpolated direction at ratio t. |
Evaluate |
Evaluate the normal (up) vector of a spline. |
Evaluate<T>(T, float, out float3, out float3, out float3) | Compute interpolated position, direction and upDirection at ratio t. Calling this method to get the 3 vectors is faster than calling independently EvaluatePosition, EvaluateDirection and EvaluateUpVector for the same time t as it reduces some redundant computation. |
Fit |
Computes a Spline to approximate the curve formed by the list of provided points within the given error threshold. |
Get |
Gets a Bezier |
Get |
Gets a Bezier |
Get |
Gets a Bezier |
Get |
Calculates a tangent from the previous and next knot positions. |
Get |
Gets a tangent from the previous, current, and next knot positions. |
Get |
Calculate the bounding box of a Spline. |
Get |
Creates a bounding box for a spline. |
Get |
Calculates a tangent from the previous and next knot positions. |
Get |
Calculates the number of curves in a spline. |
Get |
Calculate the point on a spline nearest to a point. |
Get |
Calculate the point on a spline nearest to a ray. |
Get |
Given an interpolation value in any PathIndexUnit type, calculate the normalized interpolation ratio value relative to a Spline. |
Get |
Given a Spline and interpolation ratio, calculate the 3d point at a linear distance from point at spline.EvaluatePosition(t). Returns the corresponding time associated to this 3d position on the Spline. |
Get |
Gets the number of subdivisions for a spline length and resolution. |
Join |
Joins two splines together at the specified knots. The two splines must belong to the same container and the knots must be at an extremity of their respective splines. |
Link |
Links two knots in an ISpline |
Next |
Gets the index of a knot that follows a spline index. This method uses the Count and Closed properties to ensure that it returns the correct index of the knot. |
Next<T>(T, int) | Gets the Bezier |
Previous |
Gets the index of a knot that precedes a spline index. This method uses the Count and Closed properties to ensure that it returns the correct index of the knot. |
Previous<T>(T, int) | Gets the Bezier |
Reduce |
Removes redundant points in a poly line to form a similar shape with fewer points. |
Reduce |
Removes redundant points in a poly line to form a similar shape with fewer points. |
Remove |
Removes a spline from a ISpline |
Remove |
Removes a spline from a ISpline |
Reorder |
Reorders a spline in a ISpline |
Reverse |
Reverses the flow direction of a spline. |
Reverse |
Reverses the flow direction of a spline. Should only be used with Splines that aren't inside any container. |
Reverse |
Reverses the flow direction of a spline. |
Set |
Sets the position of all knots linked to the knot at |
Set |
Reset a transform position to a position while keeping knot positions in the same place. This modifies both knot positions and transform position. |
Spline |
Given a normalized interpolation (t) for a spline, calculate the curve index and curve-relative normalized interpolation. |
Split |
Splits a spline in a SplineContainer into two splines at a specified knot. |
Unlink |
Unlinks several knots from an ISpline |