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
Assembly: Unity.Splines.Editor.dll
Syntax
public struct SelectableTangent : ISelectableElement, IEquatable<ISelectableElement>, IEquatable<SelectableTangent>
Constructors
SelectableTangent(SplineInfo, int, int)
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. |
| int | knotIndex | The index of the knot that the tangent is attached to. |
| int | tangentIndex | The index of the tangent. A value of 0 represents an In tangent. A value of 1 represents an Out tangent. |
SelectableTangent(SplineInfo, int, 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. |
| int | 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 |
|---|---|
| int |
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 |
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 SelectableTangent OppositeTangent { get; }
Property Value
| Type | Description |
|---|---|
| SelectableTangent |
Owner
The knot associated with this tangent.
Declaration
public 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 |
SplineInfo
The SplineInfo that describes the spline.
Declaration
public readonly SplineInfo SplineInfo { get; }
Property Value
| Type | Description |
|---|---|
| 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 |
|---|---|
| int |
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 |
|---|---|
| bool | 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 |
|---|---|
| bool | Returns true when |
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 |
|---|---|
| bool | Returns true if the values of each instance are identical. |
GetHashCode()
Gets a hash code for this tangent.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | 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 |
|---|---|
| bool | Returns true if all fields from the element have valid values. |