Struct FrameTime ​
Namespace: ValveResourceFormat.Animation
Assembly: ValveResourceFormat.dll
A time within a frame based range: a frame index plus the percentage through that frame.
public readonly struct FrameTimeConstructors ​
FrameTime(int, float) ​
Creates a frame time from a frame index and the percentage through it.
public FrameTime(int frameIndex, float percentageThrough = 0)Parameters ​
frameIndex int
percentageThrough float
FrameTime(float, int) ​
Creates a frame time from the percentage through a range of numFrames frames.
public FrameTime(float percent, int numFrames)Parameters ​
percent float
numFrames int
Fields ​
LargeEpsilon ​
The percentage through a frame below which a time counts as being on the frame.
public const float LargeEpsilon = 0.0001Field Value ​
float
Properties ​
FrameIndex ​
Gets the index of the frame.
public int FrameIndex { get; }Property Value ​
int
IsExactlyAtKeyFrame ​
Gets whether the time is on a frame, with nothing to interpolate.
public bool IsExactlyAtKeyFrame { get; }Property Value ​
bool
LowerBoundFrameIndex ​
Gets the frame at or before the time.
public int LowerBoundFrameIndex { get; }Property Value ​
int
NearestFrameIndex ​
The nearest frame index to the current time (a round).
public int NearestFrameIndex { get; }Property Value ​
int
PercentageThrough ​
Gets how far past the frame the time is, from 0 to 1.
public float PercentageThrough { get; }Property Value ​
float
UpperBoundFrameIndex ​
Gets the frame at or after the time.
public int UpperBoundFrameIndex { get; }Property Value ​
int
Methods ​
ClampPercentage(float, bool) ​
Wraps a percentage into [0, 1) when looping, otherwise clamps it into [0, 1].
public static float ClampPercentage(float value, bool allowLooping)Parameters ​
value float
allowLooping bool
Returns ​
float
ToFloat() ​
Gets the time as a fractional frame number.
public float ToFloat()Returns ​
float

