Table of Contents

Struct FixedCurve

Namespace
FixedMathSharp
Assembly
FixedMathSharp.dll

A deterministic fixed-point curve that interpolates values between keyframes. Used for animations, physics calculations, and procedural data.

[MemoryPackable(GenerateType.Object)]
public struct FixedCurve : IEquatable<FixedCurve>, IMemoryPackable<FixedCurve>, IMemoryPackFormatterRegister
Implements
IMemoryPackable<FixedCurve>
IMemoryPackFormatterRegister
Inherited Members

Remarks

MemoryPack GenerateType: Object

FixedMathSharp.FixedCurveMode Mode
FixedMathSharp.FixedCurveKey[] Keyframes

Constructors

FixedCurve(params FixedCurveKey[])

Initializes a new instance of the FixedCurve with a default linear interpolation mode.

public FixedCurve(params FixedCurveKey[] keyframes)

Parameters

keyframes FixedCurveKey[]

The keyframes defining the curve.

FixedCurve(FixedCurveMode, params FixedCurveKey[])

Initializes a new instance of the FixedCurve with a specified interpolation mode.

[JsonConstructor]
[MemoryPackConstructor]
public FixedCurve(FixedCurveMode mode, params FixedCurveKey[] keyframes)

Parameters

mode FixedCurveMode

The interpolation method to use.

keyframes FixedCurveKey[]

The keyframes defining the curve.

Properties

Keyframes

Gets the collection of keyframes that define the curve.

[JsonInclude]
[MemoryPackOrder(1)]
public readonly FixedCurveKey[] Keyframes { get; }

Property Value

FixedCurveKey[]

Mode

Gets the mode used for the fixed curve calculation.

[JsonInclude]
[MemoryPackOrder(0)]
[MemoryPackAllowSerialize]
public readonly FixedCurveMode Mode { get; }

Property Value

FixedCurveMode

Methods

Equals(FixedCurve)

public bool Equals(FixedCurve other)

Parameters

other FixedCurve

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Evaluate(Fixed64)

Evaluates the curve at a given time using the specified interpolation mode.

public Fixed64 Evaluate(Fixed64 time)

Parameters

time Fixed64

The time at which to evaluate the curve.

Returns

Fixed64

The interpolated value at the given time.

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(FixedCurve, FixedCurve)

Determines whether two FixedCurve instances are equal.

public static bool operator ==(FixedCurve left, FixedCurve right)

Parameters

left FixedCurve
right FixedCurve

Returns

bool

operator !=(FixedCurve, FixedCurve)

Determines whether two FixedCurve instances are not equal.

public static bool operator !=(FixedCurve left, FixedCurve right)

Parameters

left FixedCurve
right FixedCurve

Returns

bool