docs.unity3d.com
    Show / Hide Table of Contents

    Struct SelectableTangent

    Represents a struct that implements the ISelectableElement interface. Spline selection uses SelectableTangent and handles to easily manipulate spline elements with tools and handles.

    Inherited Members
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEditor.Splines
    Syntax
    public struct SelectableTangent : ISelectableElement, IEquatable<ISelectableElement>, IEquatable<SelectableTangent>

    Constructors

    SelectableTangent(SplineInfo, Int32, Int32)

    Creates a new SelectableTangent object.

    Declaration
    public SelectableTangent(SplineInfo info, int knotIndex, int tangentIndex)
    Parameters
    Type Name Description
    SplineInfo info

    The SplineInfo associated with the tangent.

    Int32 knotIndex

    The index of the knot that the tangent is attached to.

    Int32 tangentIndex

    The index of the tangent. A value of 0 represents an In tangent. A value of 1 represents an Out tangent.

    SelectableTangent(SplineInfo, Int32, BezierTangent)

    Creates a new SelectableTangent object.

    Declaration
    public SelectableTangent(SplineInfo info, int knotIndex, BezierTangent tangent)
    Parameters
    Type Name Description
    SplineInfo info

    The SplineInfo associated with the tangent.

    Int32 knotIndex

    The index of the knot that the tangent is attached to.

    BezierTangent tangent

    The BezierTangent that represents this tangent.

    Properties

    Direction

    The direction of the tangent in world space.

    Declaration
    public float3 Direction { get; set; }
    Property Value
    Type Description
    float3

    KnotIndex

    The index of the knot in the spline. If the spline element is a tangent, this is the index of the knot that the tangent is attached to.

    Declaration
    public readonly int KnotIndex { get; }
    Property Value
    Type Description
    Int32
    Implements
    ISelectableElement.KnotIndex

    LocalDirection

    The direction of the tangent in local space.

    Declaration
    public float3 LocalDirection { get; set; }
    Property Value
    Type Description
    float3

    LocalPosition

    The position of the spline element in local space.

    Declaration
    public float3 LocalPosition { get; set; }
    Property Value
    Type Description
    float3
    Implements
    ISelectableElement.LocalPosition

    OppositeTangent

    The opposite tangent on the knot. If this tangent is the In tangent, then the opposite tangent is the Out tangent. If this tangent is the Out tangent, then the opposite tangent is the In tangent.

    Declaration
    public readonly SelectableTangent OppositeTangent { get; }
    Property Value
    Type Description
    SelectableTangent

    Owner

    The knot associated with this tangent.

    Declaration
    public readonly SelectableKnot Owner { get; }
    Property Value
    Type Description
    SelectableKnot

    Position

    The position of the spline element in world space.

    Declaration
    public float3 Position { get; set; }
    Property Value
    Type Description
    float3
    Implements
    ISelectableElement.Position

    SplineInfo

    The SplineInfo that describes the spline.

    Declaration
    public readonly SplineInfo SplineInfo { get; }
    Property Value
    Type Description
    SplineInfo
    Implements
    ISelectableElement.SplineInfo

    TangentIndex

    The index of the tangent. A value of 0 represents an In tangent. A value of 1 represents an Out tangent.

    Declaration
    public readonly int TangentIndex { get; }
    Property Value
    Type Description
    Int32

    Methods

    Equals(Object)

    Checks if two objects are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare against.

    Returns
    Type Description
    Boolean

    Returns true when obj is a SelectableTangent and the values of each instance are identical.

    Overrides
    ValueType.Equals(Object)

    Equals(ISelectableElement)

    Checks if two instances of a SplineElement are equal.

    Declaration
    public bool Equals(ISelectableElement other)
    Parameters
    Type Name Description
    ISelectableElement other

    The ISelectableElement to compare against.

    Returns
    Type Description
    Boolean

    Returns true when other is a SelectableTangent and the values of each instance are identical.

    Implements
    IEquatable<T>.Equals(T)

    Equals(SelectableTangent)

    Checks if two instances of SelectableTangent are equal.

    Declaration
    public bool Equals(SelectableTangent other)
    Parameters
    Type Name Description
    SelectableTangent other

    The SelectableTangent to compare against.

    Returns
    Type Description
    Boolean

    Returns true if the values of each instance are identical.

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Gets a hash code for this tangent.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for the SelectableTangent.

    Overrides
    ValueType.GetHashCode()

    IsValid()

    Checks if the element is valid. For example, checks if the spline is not null and the index is valid.

    Declaration
    public bool IsValid()
    Returns
    Type Description
    Boolean

    Returns true if all fields from the element have valid values.

    Implements
    ISelectableElement.IsValid()
    Back to top
    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