s&box docs

public sealed struct Sandbox.Curve

Describes a curve, which can have multiple key frames.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 4 constructors

Methods

Showing 16 methods

public bool AddOrReplacePoint(Sandbox.Curve.Frame keyframe)

Add given keyframe to this curve.

Returns

True if we added a new point. False if we just edited an existing point.

public void Fix()

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.

public void RemoveAtTime(float time, float within)

Remove all of the frames at the current time

public Sandbox.Curve Reverse()

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

public void Sort()

Make sure we're all sorted by time

public void UpdateTimeRange(Vector2 newRange, bool retainTimes)

public void UpdateValueRange(Vector2 newRange, bool retainValues)

Properties

Showing 4 properties

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

Amount of key frames or points on the curve.

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

The range of this curve. This affects looping.

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

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

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.System
Doc IDT:Sandbox.Curve

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