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
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
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
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
SplineInfo
The SplineInfo that describes the spline.
Declaration
public readonly SplineInfo SplineInfo { get; }
Property Value
Type | Description |
---|---|
SplineInfo |
Implements
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 |
Overrides
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 |
Implements
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
GetHashCode()
Gets a hash code for this tangent.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for the SelectableTangent. |
Overrides
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. |