Struct SplineSettings
This structure holds the spline reference and the position and position units.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[Serializable]
public struct SplineSettings
Fields
Position
The position along the spline. The actual value corresponding to a given point on the spline will depend on the unity type.
Declaration
[Tooltip("The position along the spline. The actual value corresponding to a given point on the spline will depend on the unity type.")]
public float Position
Field Value
Type | Description |
---|---|
float |
Spline
The Spline container to which the the position will apply.
Declaration
[Tooltip("The Spline container to which the position will apply.")]
public SplineContainer Spline
Field Value
Type | Description |
---|---|
SplineContainer |
Units
How to interpret the Spline Position: - Distance: Values range from 0 (start of Spline) to Length of the Spline (end of Spline). - Normalized: Values range from 0 (start of Spline) to 1 (end of Spline). - Knot: Values are defined by knot indices and a fractional value representing the normalized interpolation between the specific knot index and the next knot."
Declaration
[Tooltip("How to interpret the Spline Position:\n- <b>Distance</b>: Values range from 0 (start of Spline) to Length of the Spline (end of Spline).\n- <b>Normalized</b>: Values range from 0 (start of Spline) to 1 (end of Spline).\n- <b>Knot</b>: Values are defined by knot indices and a fractional value representing the normalized interpolation between the specific knot index and the next knot.\n")]
public PathIndexUnit Units
Field Value
Type | Description |
---|---|
PathIndexUnit |
Methods
ChangeUnitPreservePosition(PathIndexUnit)
Change the units of the position, preserving the position on the spline.
The value of Position may change in order to preserve the position on the spline.
Declaration
public void ChangeUnitPreservePosition(PathIndexUnit newUnits)
Parameters
Type | Name | Description |
---|---|---|
PathIndexUnit | newUnits | The new units to use |
InvalidateCache()
While we can auto-detect changes to the transform and some changes to the spline's knots, it would be too costly to continually check for subtle changes to the spline's control points. Therefore, if such subtle changes are made to the spline's control points at runtime, client is responsible for calling InvalidateCache().
Declaration
public void InvalidateCache()