Table of Contents

Class CurveKey

Namespace
Microsoft.Xna.Framework
Assembly
MonoGame.Framework.dll

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

position float

Position on the curve.

value float

Value of the control point.

CurveKey(float, float, float, float)

Creates a new instance of CurveKey class.

public CurveKey(float position, float value, float tangentIn, float tangentOut)

Parameters

position float

Position on the curve.

value float

Value of the control point.

tangentIn float

Tangent approaching point from the previous point on the curve.

tangentOut float

Tangent 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 float

Position on the curve.

value float

Value of the control point.

tangentIn float

Tangent approaching point from the previous point on the curve.

tangentOut float

Tangent leaving point toward next point on the curve.

continuity CurveContinuity

Indicates 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

CurveContinuity

Position

Gets a position of the key on the curve.

[DataMember]
public float Position { get; }

Property Value

float

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

float

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

float

Value

Gets a value of this point.

[DataMember]
public float Value { get; set; }

Property Value

float

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 CurveKey

An 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 CurveKey

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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 CurveKey

CurveKey instance on the left of the equal sign.

value2 CurveKey

CurveKey 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 CurveKey

CurveKey instance on the left of the not equal sign.

value2 CurveKey

CurveKey instance on the right of the not equal sign.

Returns

bool

true if the instances are not equal; false otherwise.