Table of Contents

Class Curve

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

Contains a collection of CurveKey points in 2D space and provides methods for evaluating features of the curve they define.

[DataContract]
public class Curve : ICurveEvaluator<float>
Inheritance
Curve
Implements
Inherited Members

Constructors

Curve()

Constructs a curve.

public Curve()

Properties

IsConstant

Returns true if this curve is constant (has zero or one points); false otherwise.

[DataMember]
public bool IsConstant { get; }

Property Value

bool

Keys

The collection of curve keys.

[DataMember]
public CurveKeyCollection Keys { get; }

Property Value

CurveKeyCollection

PostLoop

Defines how to handle weighting values that are greater than the last control point in the curve.

[DataMember]
public CurveLoopType PostLoop { get; set; }

Property Value

CurveLoopType

PreLoop

Defines how to handle weighting values that are less than the first control point in the curve.

[DataMember]
public CurveLoopType PreLoop { get; set; }

Property Value

CurveLoopType

Methods

Clone()

Creates a copy of this curve.

public Curve Clone()

Returns

Curve

A copy of this curve.

ComputeTangent(int, CurveTangent)

Computes tangent for the specific key in the collection.

public void ComputeTangent(int keyIndex, CurveTangent tangentType)

Parameters

keyIndex int

The index of a key in the collection.

tangentType CurveTangent

The tangent type for both in and out.

ComputeTangent(int, CurveTangent, CurveTangent)

Computes tangent for the specific key in the collection.

public void ComputeTangent(int keyIndex, CurveTangent tangentInType, CurveTangent tangentOutType)

Parameters

keyIndex int

The index of key in the collection.

tangentInType CurveTangent

The tangent in-type. TangentIn for more details.

tangentOutType CurveTangent

The tangent out-type. TangentOut for more details.

ComputeTangents(CurveTangent)

Computes tangents for all keys in the collection.

public void ComputeTangents(CurveTangent tangentType)

Parameters

tangentType CurveTangent

The tangent type for both in and out.

ComputeTangents(CurveTangent, CurveTangent)

Computes tangents for all keys in the collection.

public void ComputeTangents(CurveTangent tangentInType, CurveTangent tangentOutType)

Parameters

tangentInType CurveTangent

The tangent in-type. TangentIn for more details.

tangentOutType CurveTangent

The tangent out-type. TangentOut for more details.

Evaluate(float)

Evaluate the value at a position of this Curve.

public float Evaluate(float position)

Parameters

position float

The position on this Curve.

Returns

float

Value at the position on this Curve.