Struct SelectableKnot
Implements the ISelectable
Inherited Members
Namespace: UnityEditor .Splines
Assembly: Unity.Splines.Editor.dll
Syntax
public struct SelectableKnot : ISelectableElement, IEquatable<ISelectableElement>, IEquatable<SelectableKnot>
Constructors
SelectableKnot(SplineInfo, int)
Creates a Selectable
Declaration
public SelectableKnot(SplineInfo info, int index)
Parameters
Type | Name | Description |
---|---|---|
Spline |
info | The Spline |
int | 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 |
---|---|
int |
LocalPosition
The position of the spline element in local space.
Declaration
public float3 LocalPosition { get; set; }
Property Value
Type | Description |
---|---|
float3 |
LocalRotation
The rotation of the spline element in local space.
Declaration
public quaternion LocalRotation { get; set; }
Property Value
Type | Description |
---|---|
quaternion |
Mode
The Tangent
Declaration
public TangentMode Mode { get; set; }
Property Value
Type | Description |
---|---|
Tangent |
Position
The position of the spline element in world space.
Declaration
public float3 Position { get; set; }
Property Value
Type | Description |
---|---|
float3 |
Rotation
The rotation of the spline element in world space.
Declaration
public quaternion Rotation { get; set; }
Property Value
Type | Description |
---|---|
quaternion |
SplineInfo
The Spline
Declaration
public readonly SplineInfo SplineInfo { get; }
Property Value
Type | Description |
---|---|
Spline |
TangentIn
The In tangent associated with the knot. The In tangent defines the curvature of the segment that enters the knot.
Declaration
public SelectableTangent TangentIn { get; }
Property Value
Type | Description |
---|---|
Selectable |
TangentOut
The Out tangent associated with the knot. The Out tangent defines the curvature of the segment that exits the knot.
Declaration
public SelectableTangent TangentOut { get; }
Property Value
Type | Description |
---|---|
Selectable |
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 |
---|---|
float |
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 |
---|---|
bool | Returns true if |
Overrides
Equals(ISelectableElement)
Checks if two instances of SplineElement
are equal.
Declaration
public bool Equals(ISelectableElement other)
Parameters
Type | Name | Description |
---|---|---|
ISelectable |
other | The ISelectable |
Returns
Type | Description |
---|---|
bool | Returns true when |
Equals(SelectableKnot)
Checks if two instances of SelectableKnot are equal.
Declaration
public bool Equals(SelectableKnot other)
Parameters
Type | Name | Description |
---|---|---|
Selectable |
other | The Selectable |
Returns
Type | Description |
---|---|
bool | Returns true if the values of each instance of |
GetBezierKnot(bool)
Creates the BezierKnot representation associated with a SelectableKnot.
Declaration
public BezierKnot GetBezierKnot(bool worldSpace)
Parameters
Type | Name | Description |
---|---|---|
bool | 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 |
---|---|
Bezier |
The Bezier |
GetHashCode()
Gets a hash code for this knot.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the Selectable |
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. |
SetTangentMode(TangentMode, BezierTangent)
Sets the tangent mode of the knot.
Declaration
public void SetTangentMode(TangentMode mode, BezierTangent main)
Parameters
Type | Name | Description |
---|---|---|
Tangent |
mode | The Tangent |
Bezier |
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. |