Class SplineContainer
A Component that holds a Spline object.
Inherited Members
Namespace: UnityEngine.Splines
Syntax
public sealed class SplineContainer : MonoBehaviour, ISplineProvider
Properties
Spline
The instantiated Spline object attached to this component.
Declaration
public Spline Spline { get; set; }
Property Value
Type | Description |
---|---|
Spline |
Methods
CalculateCurveLength(Int32)
Calculate the length of a BezierCurve in world space.
Declaration
public float CalculateCurveLength(int curveIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | curveIndex | The index of the curve to fetch length for. |
Returns
Type | Description |
---|---|
Single | The length of a BezierCurve in world space. |
CalculateSplineLength()
Calculate the length of Spline in world space.
Declaration
public float CalculateSplineLength()
Returns
Type | Description |
---|---|
Single | The length of Spline in world space |
EvaluateCurvePosition(Int32, Single)
Evaluate the position on a curve at a specific t in world space. Use SplineToCurveInterpolation<T>(T, Single, out Single) to convert a time value from spline to curve space.
Declaration
public float3 EvaluateCurvePosition(int curveIndex, float t)
Parameters
Type | Name | Description |
---|---|---|
Int32 | curveIndex | The index of the BezierCurve to evaluate. |
Single | t | A value between 0 and 1 representing a percentage of the curve. |
Returns
Type | Description |
---|---|
float3 | A position in world space. |
EvaluateCurveTangent(Int32, Single)
Evaluate a tangent vector on a curve at a specific t in world space. Use SplineToCurveInterpolation<T>(T, Single, out Single) to convert a time value from spline to curve space.
Declaration
public float3 EvaluateCurveTangent(int curveIndex, float t)
Parameters
Type | Name | Description |
---|---|---|
Int32 | curveIndex | The index of the BezierCurve to evaluate. |
Single | t | A value between 0 and 1 representing a percentage of the curve. |
Returns
Type | Description |
---|---|
float3 | A tangent vector in world space. |
EvaluateSplinePosition(Single)
Evaluate a tangent vector on a curve at a specific t in world space.
Declaration
public float3 EvaluateSplinePosition(float t)
Parameters
Type | Name | Description |
---|---|---|
Single | t | A value between 0 and 1 representing a percentage of the curve. |
Returns
Type | Description |
---|---|
float3 | A tangent vector. |
EvaluateSplineTangent(Single)
Evaluate a tangent vector at a specific t in world space.
Declaration
public float3 EvaluateSplineTangent(float t)
Parameters
Type | Name | Description |
---|---|---|
Single | t | A value between 0 and 1 representing a percentage of entire spline |
Returns
Type | Description |
---|---|
float3 | A tangent vector |
EvaluateSplineUpVector(Single)
Evaluate an up vector at a specific t
Declaration
public float3 EvaluateSplineUpVector(float t)
Parameters
Type | Name | Description |
---|---|---|
Single | t | A value between 0 and 1 representing a percentage of entire spline |
Returns
Type | Description |
---|---|
float3 | An up vector |
Explicit Interface Implementations
ISplineProvider.Splines
Declaration
IEnumerable<Spline> ISplineProvider.Splines { get; }
Returns
Type | Description |
---|---|
IEnumerable<Spline> |