Class CinemachinePath
Defines a world-space path, consisting of an array of waypoints, each of which has position, tangent, and roll settings. Bezier interpolation is performed between the waypoints, to get a smooth and continuous path.
Inherited Members
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[AddComponentMenu("Cinemachine/CinemachinePath")]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity.cn/Packages/com.unity.cinemachine@2.8/manual/CinemachinePath.html")]
public class CinemachinePath : CinemachinePathBase
Fields
m_Looped
If checked, then the path ends are joined to form a continuous loop
Declaration
[Tooltip("If checked, then the path ends are joined to form a continuous loop.")]
public bool m_Looped
Field Value
Type | Description |
---|---|
Boolean |
m_Waypoints
The waypoints that define the path. They will be interpolated using a bezier curve
Declaration
[Tooltip("The waypoints that define the path. They will be interpolated using a bezier curve.")]
public CinemachinePath.Waypoint[] m_Waypoints
Field Value
Type | Description |
---|---|
CinemachinePath.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 |
---|---|
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 |
---|---|
Boolean |
Overrides
MaxPos
The maximum value for the path position
Declaration
public override float MaxPos { get; }
Property Value
Type | Description |
---|---|
Single |
Overrides
MinPos
The minimum value for the path position
Declaration
public override float MinPos { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|---|
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 |
---|---|---|
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 |
---|---|---|
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 |