Class CinemachineSmoothPath
Defines a world-space path, consisting of an array of waypoints, each of which has position and roll settings. Bezier interpolation is performed between the waypoints, to get a smooth and continuous path. The path will pass through all waypoints, and (unlike CinemachinePath) first and second order continuity is guaranteed
Inherited Members
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
public class CinemachineSmoothPath : CinemachinePathBase
Fields
m_Looped
If checked, then the path ends are joined to form a continuous loop
Declaration
public bool m_Looped
Field Value
Type | Description |
---|---|
System.Boolean |
m_Waypoints
The waypoints that define the path. They will be interpolated using a bezier curve
Declaration
public CinemachineSmoothPath.Waypoint[] m_Waypoints
Field Value
Type | Description |
---|---|
CinemachineSmoothPath.Waypoint[] |
Properties
DistanceCacheSampleStepsPerSegment
When calculating the distance cache, sample the path this many times between points
Declaration
public override int DistanceCacheSampleStepsPerSegment { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Looped
True if the path ends are joined to form a continuous loop
Declaration
public override bool Looped { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
MaxPos
The maximum value for the path position
Declaration
public override float MaxPos { get; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
MinPos
The minimum value for the path position
Declaration
public override float MinPos { get; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Methods
EvaluateOrientation(Single)
Get the orientation the curve at a point along the path.
Declaration
public override Quaternion EvaluateOrientation(float pos)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pos | Postion along the path. Need not be normalized. |
Returns
Type | Description |
---|---|
Quaternion | World-space orientation of the path, as defined by tangent, up, and roll. |
Overrides
EvaluatePosition(Single)
Get a worldspace position of a point along the path
Declaration
public override Vector3 EvaluatePosition(float pos)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pos | Postion along the path. Need not be normalized. |
Returns
Type | Description |
---|---|
Vector3 | World-space position of the point along at path at pos |
Overrides
EvaluateTangent(Single)
Get the tangent of the curve at a point along the path.
Declaration
public override Vector3 EvaluateTangent(float pos)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pos | Postion along the path. Need not be normalized. |
Returns
Type | Description |
---|---|
Vector3 | World-space direction of the path tangent. Length of the vector represents the tangent strength |
Overrides
InvalidateDistanceCache()
Call this if the path changes in such a way as to affect distances or other cached path elements
Declaration
public override void InvalidateDistanceCache()