Curve

class Curve : System.Object

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

readonly bool IsConstant

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

CurveLoopType PreLoop

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

CurveLoopType PostLoop

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

readonly CurveKeyCollection Keys

The collection of curve keys.

public Curve Clone()

Creates a copy of this curve.

Returns:A copy of this curve.
public float Evaluate(float position)

Evaluate the value at a position of this T:Microsoft.Xna.Framework.Curve.

Parameters:
  • position (float) – The position on this T:Microsoft.Xna.Framework.Curve.
Returns:

Value at the position on this T:Microsoft.Xna.Framework.Curve.

public void ComputeTangents(CurveTangent tangentType)

Computes tangents for all keys in the collection.

Parameters:
  • tangentType (Microsoft.Xna.Framework.CurveTangent) – The tangent type for both in and out.
public void ComputeTangents(CurveTangent tangentInType, CurveTangent tangentOutType)

Computes tangents for all keys in the collection.

Parameters:
  • tangentInType (Microsoft.Xna.Framework.CurveTangent) – The tangent in-type. P:Microsoft.Xna.Framework.CurveKey.TangentIn for more details.
  • tangentOutType (Microsoft.Xna.Framework.CurveTangent) – The tangent out-type. P:Microsoft.Xna.Framework.CurveKey.TangentOut for more details.
public void ComputeTangent(int keyIndex, CurveTangent tangentType)

Computes tangent for the specific key in the collection.

Parameters:
  • keyIndex (int) – The index of a key in the collection.
  • tangentType (Microsoft.Xna.Framework.CurveTangent) – The tangent type for both in and out.
public void ComputeTangent(int keyIndex, CurveTangent tangentInType, CurveTangent tangentOutType)

Computes tangent for the specific key in the collection.

Parameters:
  • keyIndex (int) – The index of key in the collection.
  • tangentInType (Microsoft.Xna.Framework.CurveTangent) – The tangent in-type. P:Microsoft.Xna.Framework.CurveKey.TangentIn for more details.
  • tangentOutType (Microsoft.Xna.Framework.CurveTangent) – The tangent out-type. P:Microsoft.Xna.Framework.CurveKey.TangentOut for more details.