Struct SelectableKnot
Implements the ISelectableElement interface. SelectableKnot is used by the spline selection and handles to use tools and handles to manipulate spline elements.
Inherited Members
Namespace: UnityEditor.Splines
Syntax
public struct SelectableKnot : ISelectableElement, IEquatable<ISelectableElement>, IEquatable<SelectableKnot>
Constructors
SelectableKnot(SplineInfo, Int32)
Creates a SelectableKnot from a SplineInfo and a knot index.
Declaration
public SelectableKnot(SplineInfo info, int index)
Parameters
Type | Name | Description |
---|---|---|
SplineInfo | info | The SplineInfo associated with the tangent. |
Int32 | index | The index of the knot. |
Properties
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
LocalPosition
The position of the spline element in local space.
Declaration
public float3 LocalPosition { get; set; }
Property Value
Type | Description |
---|---|
float3 |
Implements
LocalRotation
The rotation of the spline element in local space.
Declaration
public quaternion LocalRotation { get; set; }
Property Value
Type | Description |
---|---|
quaternion |
Mode
The TangentMode associated with a knot.
Declaration
public TangentMode Mode { get; set; }
Property Value
Type | Description |
---|---|
TangentMode |
Position
The position of the spline element in world space.
Declaration
public float3 Position { get; set; }
Property Value
Type | Description |
---|---|
float3 |
Implements
Rotation
The rotation of the spline element in world space.
Declaration
public quaternion Rotation { get; set; }
Property Value
Type | Description |
---|---|
quaternion |
SplineInfo
The SplineInfo that describes the spline.
Declaration
public readonly SplineInfo SplineInfo { get; }
Property Value
Type | Description |
---|---|
SplineInfo |
Implements
TangentIn
The In tangent associated with the knot. The In tangent defines the curvature of the segment that enters the knot.
Declaration
public readonly SelectableTangent TangentIn { get; }
Property Value
Type | Description |
---|---|
SelectableTangent |
TangentOut
The Out tangent associated with the knot. The Out tangent defines the curvature of the segment that exits the knot.
Declaration
public readonly SelectableTangent TangentOut { get; }
Property Value
Type | Description |
---|---|
SelectableTangent |
Tension
The tension associated with a knot. Tension
is only used if the tangent mode is Auto Smooth.
Declaration
public float Tension { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
Equals(Object)
Checks if two instances of an object 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 if |
Overrides
Equals(ISelectableElement)
Checks if two instances of 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(SelectableKnot)
Checks if two instances of SelectableKnot are equal.
Declaration
public bool Equals(SelectableKnot other)
Parameters
Type | Name | Description |
---|---|---|
SelectableKnot | other | The SelectableKnot to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the values of each instance of |
Implements
GetBezierKnot(Boolean)
Creates the BezierKnot representation associated with a SelectableKnot.
Declaration
public BezierKnot GetBezierKnot(bool worldSpace)
Parameters
Type | Name | Description |
---|---|---|
Boolean | worldSpace | Set to true for the BezierKnot to be in world space, or set to false for the Bezierknot to be in local space. |
Returns
Type | Description |
---|---|
BezierKnot | The BezierKnot associated with the knot. |
GetHashCode()
Gets a hash code for this knot.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for the SelectableKnot. |
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. |
Implements
SetTangentMode(TangentMode, BezierTangent)
Sets the tangent mode of the knot.
Declaration
public void SetTangentMode(TangentMode mode, BezierTangent main)
Parameters
Type | Name | Description |
---|---|---|
TangentMode | mode | The TangentMode to apply to the knot. |
BezierTangent | main | The tangent to use as the main tangent when the tangent is set to the Mirrored or Continuous tangent mode. The main tangent is not modified, but the other tangent attached to that knot is modified to adopt the new tangent mode. |