NodeWorld

LocomotionAnimator

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public sealed class LocomotionAnimator : IDisposable

Namespace NodeWorld.Avatar.Locomotion.

Plays the locomotion clips on the local humanoid avatar from the velocity of its body: idle when still, walk or run blended by direction and speed, backward being the forward walk in reverse. The graph is evaluated by hand, right before the IK reads the pose. The moving clips share one phase, which advances with the distance covered: at a clip's own speed the planted foot stays still on the ground. Seated by the world, the sitting pose replaces them.

Constructors

LocomotionAnimator

csharp
public LocomotionAnimator(Animator animator, LocomotionClipSet clips)

Plays clips on animator's avatar.

Properties

MovingWeight

csharp
public float MovingWeight { get; }

How much of the pose walks or runs: 0 standing, 1 moving.

SittingWeight

csharp
public float SittingWeight { get; }

How much of the pose sits: 0 standing or moving, 1 sitting.

Methods

Dispose

csharp
public void Dispose()

Destroys the playable graph.

Evaluate

csharp
public void Evaluate(Vector3 localVelocity, bool grounded, bool sitting, float deltaTime)

Poses the avatar for this frame. localVelocity: of the body, in the avatar's space, in m/s. sitting: the world seats the player. Called every frame: the IK resets the bones before, so the pose must be written each time.

EvaluateSitting

csharp
public void EvaluateSitting()

Poses the avatar in the sitting pose alone, now, to measure it. The next Evaluate writes the blended pose again.