docs.unity3d.com
    Show / Hide Table of Contents

    Struct BezierKnot

    This struct contains position and tangent data for a knot. The Spline class stores a collection of BezierKnot that form a series of connected BezierCurve. Each knot contains a Position, Tangent In, and Tangent Out. When a Spline is not closed, the first and last knots will contain an extraneous tangent (in and out, respectively).

    Namespace: UnityEngine.Splines
    Syntax
    public struct BezierKnot : ISerializationCallbackReceiver

    Constructors

    BezierKnot(float3)

    Create a new BezierKnot struct.

    Declaration
    public BezierKnot(float3 position)
    Parameters
    Type Name Description
    float3 position

    The position of the knot relative to the spline.

    BezierKnot(float3, float3, float3, quaternion)

    Create a new BezierKnot struct.

    Declaration
    public BezierKnot(float3 position, float3 tangentIn, float3 tangentOut, quaternion rotation)
    Parameters
    Type Name Description
    float3 position

    The position of the knot relative to the spline.

    float3 tangentIn

    The leading tangent to this knot.

    float3 tangentOut

    The following tangent to this knot.

    quaternion rotation

    The rotation of the knot relative to the spline.

    Fields

    Position

    The position of the knot. On a cubic bezier curve, this is equivalent to P0 or P3, depending on whether this knot is forming the first or second control point of the curve.

    Declaration
    public float3 Position
    Field Value
    Type Description
    float3

    Rotation

    Rotation of the knot.

    Declaration
    public quaternion Rotation
    Field Value
    Type Description
    quaternion

    TangentIn

    The tangent leading into this knot. On a cubic bezier curve, this value is used to calculate P2 when used as the second knot in a curve.

    Declaration
    public float3 TangentIn
    Field Value
    Type Description
    float3

    TangentOut

    The tangent following this knot. On a cubic bezier curve, this value is used to calculate P1 when used as the first knot in a curve.

    Declaration
    public float3 TangentOut
    Field Value
    Type Description
    float3

    Methods

    OnAfterDeserialize()

    See ISerializationCallbackReceiver.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    See ISerializationCallbackReceiver.

    Declaration
    public void OnBeforeSerialize()

    Transform(float4x4)

    Multiply the position and tangents by a matrix.

    Declaration
    public BezierKnot Transform(float4x4 matrix)
    Parameters
    Type Name Description
    float4x4 matrix

    The matrix to multiply.

    Returns
    Type Description
    BezierKnot

    A new BezierKnot multiplied by matrix.

    Operators

    Addition(BezierKnot, float3)

    Knot position addition. This operation only applies to the position, tangents and rotation are unmodified.

    Declaration
    public static BezierKnot operator +(BezierKnot knot, float3 rhs)
    Parameters
    Type Name Description
    BezierKnot knot

    The target knot.

    float3 rhs

    The value to add.

    Returns
    Type Description
    BezierKnot

    A new BezierKnot where position is the sum of knot.position and rhs.

    Subtraction(BezierKnot, float3)

    Knot position subtraction. This operation only applies to the position, tangents and rotation are unmodified.

    Declaration
    public static BezierKnot operator -(BezierKnot knot, float3 rhs)
    Parameters
    Type Name Description
    BezierKnot knot

    The target knot.

    float3 rhs

    The value to subtract.

    Returns
    Type Description
    BezierKnot

    A new BezierKnot where position is the sum of knot.position minus rhs.

    In This Article
    • Constructors
      • BezierKnot(float3)
      • BezierKnot(float3, float3, float3, quaternion)
    • Fields
      • Position
      • Rotation
      • TangentIn
      • TangentOut
    • Methods
      • OnAfterDeserialize()
      • OnBeforeSerialize()
      • Transform(float4x4)
    • Operators
      • Addition(BezierKnot, float3)
      • Subtraction(BezierKnot, float3)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023