Class CurveKey
Key point on the Curve.
[DataContract]
public class CurveKey : IEquatable<CurveKey>, IComparable<CurveKey>
- Inheritance
-
CurveKey
- Implements
- Inherited Members
Constructors
CurveKey()
Creates a new instance of CurveKey class with position: 0 and value: 0.
public CurveKey()
CurveKey(float, float)
Creates a new instance of CurveKey class.
public CurveKey(float position, float value)
Parameters
CurveKey(float, float, float, float)
Creates a new instance of CurveKey class.
public CurveKey(float position, float value, float tangentIn, float tangentOut)
Parameters
position
floatPosition on the curve.
value
floatValue of the control point.
tangentIn
floatTangent approaching point from the previous point on the curve.
tangentOut
floatTangent leaving point toward next point on the curve.
CurveKey(float, float, float, float, CurveContinuity)
Creates a new instance of CurveKey class.
public CurveKey(float position, float value, float tangentIn, float tangentOut, CurveContinuity continuity)
Parameters
position
floatPosition on the curve.
value
floatValue of the control point.
tangentIn
floatTangent approaching point from the previous point on the curve.
tangentOut
floatTangent leaving point toward next point on the curve.
continuity
CurveContinuityIndicates whether the curve is discrete or continuous.
Properties
Continuity
Gets or sets the indicator whether the segment between this point and the next point on the curve is discrete or continuous.
[DataMember]
public CurveContinuity Continuity { get; set; }
Property Value
Position
Gets a position of the key on the curve.
[DataMember]
public float Position { get; }
Property Value
TangentIn
Gets or sets a tangent when approaching this point from the previous point on the curve.
[DataMember]
public float TangentIn { get; set; }
Property Value
TangentOut
Gets or sets a tangent when leaving this point to the next point on the curve.
[DataMember]
public float TangentOut { get; set; }
Property Value
Value
Gets a value of this point.
[DataMember]
public float Value { get; set; }
Property Value
Methods
Clone()
Creates a copy of this key.
public CurveKey Clone()
Returns
- CurveKey
A copy of this key.
CompareTo(CurveKey)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(CurveKey other)
Parameters
other
CurveKeyAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Equals(CurveKey)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CurveKey other)
Parameters
other
CurveKeyAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Operators
operator ==(CurveKey, CurveKey)
Compares whether two CurveKey instances are equal.
public static bool operator ==(CurveKey value1, CurveKey value2)
Parameters
value1
CurveKeyCurveKey instance on the left of the equal sign.
value2
CurveKeyCurveKey instance on the right of the equal sign.
Returns
- bool
true
if the instances are equal;false
otherwise.
operator !=(CurveKey, CurveKey)
Compares whether two CurveKey instances are not equal.
public static bool operator !=(CurveKey value1, CurveKey value2)
Parameters
value1
CurveKeyCurveKey instance on the left of the not equal sign.
value2
CurveKeyCurveKey instance on the right of the not equal sign.
Returns
- bool
true
if the instances are not equal;false
otherwise.