Class RootMotionData
Namespace: ValveResourceFormat.Animation
Assembly: ValveResourceFormat.dll
public class RootMotionDataInheritance
object ← RootMotionData
Constructors
RootMotionData(FrameBone[], int, RootMotionData?)
public RootMotionData(FrameBone[] transforms, int numFrames, RootMotionData? source = null)Parameters
transforms FrameBone[]
numFrames int
source RootMotionData?
RootMotionData(KVObject)
Reads the RootMotionData from its KeyValues3 data.
public RootMotionData(KVObject data)Parameters
data KVObject
Properties
AverageAngularVelocityRadians
public float AverageAngularVelocityRadians { get; }Property Value
float
AverageLinearVelocity
public float AverageLinearVelocity { get; }Property Value
float
Empty
public static RootMotionData Empty { get; }Property Value
IsStationary
public bool IsStationary { get; }Property Value
bool
IsValid
Valid data, which is distinct from having any actual motion.
public bool IsValid { get; }Property Value
bool
NumFrames
public int NumFrames { get; }Property Value
int
TotalDelta
public FrameBone TotalDelta { get; }Property Value
Transforms
public FrameBone[] Transforms { get; }Property Value
Methods
GetDelta(float, float)
The root motion delta for a time range; handles a single loop.
public FrameBone GetDelta(float fromTime, float toTime)Parameters
fromTime float
toTime float
Returns
GetDeltaNoLooping(float, float)
public FrameBone GetDeltaNoLooping(float fromTime, float toTime)Parameters
fromTime float
toTime float
Returns
GetIncomingMovementOrientation2DAtFrame(int)
The direction of movement into a frame from the previous one, or the facing when there is no movement.
public Quaternion GetIncomingMovementOrientation2DAtFrame(int frameIdx)Parameters
frameIdx int
Returns
GetTransform(FrameTime)
public FrameBone GetTransform(FrameTime frameTime)Parameters
frameTime FrameTime
Returns
GetTransform(float)
public FrameBone GetTransform(float percentageThrough)Parameters
percentageThrough float
Returns
SampleRootMotion(SamplingMode, FrameBone, float, float)
Samples either the plain delta, or the delta that moves the character to the expected world space root position.
public FrameBone SampleRootMotion(RootMotionData.SamplingMode mode, FrameBone currentWorldTransform, float startTime, float endTime)Parameters
mode RootMotionData.SamplingMode
currentWorldTransform FrameBone
startTime float
endTime float
Returns
SetFrom(int, RootMotionData?)
Reuses this buffer for root motion written into RootMotionData.Transforms by the caller.
public void SetFrom(int numFrames, RootMotionData? source)Parameters
numFrames int
source RootMotionData?

