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
keyframesFixedCurveKey[]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
modeFixedCurveModeThe interpolation method to use.
keyframesFixedCurveKey[]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
Mode
Gets the mode used for the fixed curve calculation.
[JsonInclude]
[MemoryPackOrder(0)]
[MemoryPackAllowSerialize]
public readonly FixedCurveMode Mode { get; }
Property Value
Methods
Equals(FixedCurve)
public bool Equals(FixedCurve other)
Parameters
otherFixedCurve
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Evaluate(Fixed64)
Evaluates the curve at a given time using the specified interpolation mode.
public Fixed64 Evaluate(Fixed64 time)
Parameters
timeFixed64The time at which to evaluate the curve.
Returns
- Fixed64
The interpolated value at the given time.
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(FixedCurve, FixedCurve)
Determines whether two FixedCurve instances are equal.
public static bool operator ==(FixedCurve left, FixedCurve right)
Parameters
leftFixedCurverightFixedCurve
Returns
operator !=(FixedCurve, FixedCurve)
Determines whether two FixedCurve instances are not equal.
public static bool operator !=(FixedCurve left, FixedCurve right)
Parameters
leftFixedCurverightFixedCurve