FullBodyVrSolver

csharp
public sealed class FullBodyVrSolver

Namespace NodeWorld.Avatar.IK.

Full-body IK for VR: places the avatar's head, hands, pelvis and feet on the player's headset, controllers and trackers, and steps the feet when no foot is tracked.

Fields

weight

csharp
public float weight

How much the IK is applied (0 to 1); 0 skips it.

quality

csharp
public int quality

Solver quality (0 to 2): 0 is the cheapest, 2 reads the animated pose each frame.

avatarScale

csharp
public float avatarScale

The avatar's scale relative to the player, set by calibration.

plantFeet

csharp
public bool plantFeet

The feet stay where they stepped while the body moves.

headTarget

csharp
public Transform headTarget

The head target (the headset).

leftHandTarget

csharp
public Transform leftHandTarget

The left hand target (the left controller).

rightHandTarget

csharp
public Transform rightHandTarget

The right hand target (the right controller).

pelvisTarget

csharp
public Transform pelvisTarget

The pelvis target (a tracker), or null.

leftFootTarget

csharp
public Transform leftFootTarget

The left foot target (a tracker), or null for procedural steps.

rightFootTarget

csharp
public Transform rightFootTarget

The right foot target (a tracker), or null for procedural steps.

animator

csharp
public Animator animator

The avatar's Animator.

spine

csharp
public SpineSettings spine

Settings of the spine.

leftArm

csharp
public ArmSettings leftArm

Settings of the left arm.

rightArm

csharp
public ArmSettings rightArm

Settings of the right arm.

leftLeg

csharp
public LegSettings leftLeg

Settings of the left leg.

rightLeg

csharp
public LegSettings rightLeg

Settings of the right leg.

locomotion

csharp
public LocomotionSettings locomotion

Settings of the procedural steps.

Properties

Initialized

csharp
public bool Initialized { get; }

Initialize was called and Dispose was not.

RootBone

csharp
public VirtualBone RootBone { get; }

The root bone of the solver.

SpinePart

csharp
public SkeletonPart SpinePart { get; }

The spine part of the solver.

ReadRootRotation

csharp
public Quaternion ReadRootRotation { get; }

The root's rotation read from the avatar this frame.

Methods

Initialize

csharp
public void Initialize(HumanoidReferences references)

Prepares the solver for the bones of references; throws if they are not valid.

Dispose

csharp
public void Dispose()

Stops the solver and clears its events.

Update

csharp
public void Update(float deltaTime)

Solves the body for this frame.

ResetRuntimeState

csharp
public void ResetRuntimeState()

Reads the avatar's current pose and restarts the solver from it (after a teleport).

AddPositionOffset

csharp
public void AddPositionOffset(BodyPositionOffset target, Vector3 value)

Adds value to the position offset of a body part for this frame.

AddRotationOffset

csharp
public void AddRotationOffset(BodyRotationOffset target, Quaternion value)

Adds value to the rotation offset of a body part for this frame.

AddPlatformMotion

csharp
public void AddPlatformMotion(Vector3 deltaPosition, Quaternion deltaRotation, Vector3 pivot)

Moves the planted feet with a moving platform the player stands on.

FixTransformsToDefaultLocalState

csharp
public void FixTransformsToDefaultLocalState()

Puts the bones back to their default local pose before the animator runs (quality below 2).

Events

BeforeSolve

csharp
public event Action BeforeSolve

Raised before each solve.

AfterSolve

csharp
public event Action AfterSolve

Raised after each solve.