NodeWorld

FullBodyVrCalibration

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

csharp
public static class FullBodyVrCalibration

Namespace NodeWorld.Avatar.IK.

Places the IK targets of the head, hands and feet on the player's trackers and scales the avatar to the player.

Methods

GuessWristToPalmAxis

csharp
public static Vector3 GuessWristToPalmAxis(Transform hand, Transform forearm)

Guesses the hand's local axis from the wrist to the palm, from the forearm-to-hand direction.

GuessPalmToThumbAxis

csharp
public static Vector3 GuessPalmToThumbAxis(Transform hand, Transform forearm, Transform thumb = null)

The axis of the hand bone that points from the palm to the thumb. From the thumb's own bone when the humanoid avatar maps one (thumb), otherwise from the child of the hand closest to it (a guess: on some rigs the closest child is a finger of the other side, and the axis comes out reversed, the elbows then bend outward).

AssignHeadTarget

csharp
public static void AssignHeadTarget(FullBodyVrSolver solver, Transform root, Transform headTracker, Transform headBone, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset)

Creates the head target if needed and parents it to headTracker, so the head bone lands where the headset is (with the anchor offsets).

AssignHandTarget

csharp
public static void AssignHandTarget(Transform target, Transform tracker, Transform hand, Transform forearm, bool isLeft, Vector3 wristToPalmAxis, Vector3 palmToThumbAxis, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset)

Parents target to the hand's tracker so the hand bone lands where the controller is (offsets mirrored for the left hand).

MatchRotation

csharp
public static Quaternion MatchRotation(Quaternion targetRotation, Vector3 targetAxis1, Vector3 targetAxis2, Vector3 axis1, Vector3 axis2)

The rotation that brings axis1 and axis2 onto targetAxis1 and targetAxis2 of targetRotation.

ConfigureFullTrackerHead

csharp
public static void ConfigureFullTrackerHead(Transform root, Transform headBone, Transform headTarget, Transform headTracker, FullBodyVrCalibrationSettings settings)

Full-body tracking: turns the root toward the headset and puts the head target on the head tracker.

ConfigureFullTrackerHand

csharp
public static void ConfigureFullTrackerHand(Transform handTarget, Transform handTracker, Transform handBone, Vector3 wristToPalmAxis, Vector3 palmToThumbAxis, bool isLeft, FullBodyVrCalibrationSettings settings)

Full-body tracking: puts a hand target on its tracker, aligned with the hand's axes.

ConfigureFullTrackerFoot

csharp
public static void ConfigureFullTrackerFoot(Transform footTarget, Transform kneeGoal, Transform footTracker, Transform lastFootBone, Vector3 rootForward, bool isLeft, FullBodyVrCalibrationSettings settings)

Full-body tracking: puts a foot target and its knee goal on a foot tracker, at the foot's height and heading.

ComputeScale

csharp
public static float ComputeScale(Transform root, Transform headBone, Transform headTarget, float multiplier)

The avatar scale that makes its head height match the tracked one, times multiplier.