Curveclass

Describes a curve, which can have multiple key frames.

objectCurve
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public sealed struct Sandbox.Curve

Constructors4

Showing 4 constructors

Methods16

Showing 16 methods

public bool AddOrReplacePoint(Sandbox.Curve.Frame keyframe)PUBLIC

Add given keyframe to this curve.

ParameterTypeDescription
keyframeFrame
Returns:boolTrue if we added a new point. False if we just edited an existing point.

public void Fix()PUBLIC

If the curve is broken in some way, we can fix it here. Ensures correct time and value ranges, and that the curve has at least one point.

Returns:void

public void RemoveAtTime(float time, float within)PUBLIC

Remove all of the frames at the current time

ParameterTypeDescription
timefloat
withinfloat
Returns:void

public Sandbox.Curve Reverse()PUBLIC

Make a copy of this curve that is reversed (If input eases from 0 to 1 then output will ease from 1 to 0)

Returns:Curve

public void Sort()PUBLIC

Make sure we're all sorted by time

Returns:void

public void UpdateTimeRange(Vector2 newRange, bool retainTimes)PUBLICPER-FRAME

ParameterTypeDescription
newRangeVector2
retainTimesbool
Returns:void

public void UpdateValueRange(Vector2 newRange, bool retainValues)PUBLICPER-FRAME

ParameterTypeDescription
newRangeVector2
retainValuesbool
Returns:void

Properties4

Showing 4 properties

public int Sandbox.Curve.Length { get; set; }PUBLICGETSET

Amount of key frames or points on the curve.

Returns:int

public Vector2 Sandbox.Curve.TimeRange { get; set; }PUBLICGETSET

The range of this curve. This affects looping.

Returns:Vector2

public Vector2 Sandbox.Curve.ValueRange { get; set; }PUBLICGETSET

The value range. This should affect nothing but what it looks like in the editor.

Returns:Vector2

On this page

Constructorspublic Curve()public Curve(Sandbox.Curve.Frame[] frames)public Curve(System.Collections.Generic.IEnumerable`1<Sandbox.Curve.Frame> frames)public Curve(System.Collections.Immutable.ImmutableArray`1<Sandbox.Curve.Frame> frames)Methodspublic System.Boolean AddOrReplacePoint(Sandbox.Curve.Frame keyframe)public System.Int32 AddPoint(Sandbox.Curve.Frame keyframe)public System.Int32 AddPoint(System.Single x, System.Single y)public System.Single Evaluate(System.Single time, System.Boolean angles)public System.Single Evaluate(System.Single time)public System.Single EvaluateDelta(System.Single time, System.Boolean angles)public System.Single EvaluateDelta(System.Single time)public System.Void Fix()public System.Void RemoveAtTime(System.Single time, System.Single within)public Sandbox.Curve Reverse()public System.Void Sort()public System.Void UpdateTimeRange(Vector2 newRange, System.Boolean retainTimes)public System.Void UpdateValueRange(Vector2 newRange, System.Boolean retainValues)public Sandbox.Curve WithFrames(System.Collections.Generic.IEnumerable`1<Sandbox.Curve.Frame> frames)public Sandbox.Curve WithFrames(System.Collections.Immutable.ImmutableArray`1<Sandbox.Curve.Frame> frames)public Sandbox.Curve WithFrames(System.Collections.Immutable.ImmutableList`1<Sandbox.Curve.Frame> frames)Propertiespublic Sandbox.Curve.Frame Sandbox.Curve.Item { get; set; }public System.Int32 Sandbox.Curve.Length { get; set; }public Vector2 Sandbox.Curve.TimeRange { get; set; }public Vector2 Sandbox.Curve.ValueRange { get; set; }Metadata