All Classes Namespaces Functions Variables Enumerations Properties Pages
VRIK

VRIK is a high speed full body solver dedicated to animating VR avatars. The solver was originally developed for the game "Dead and Buried" by Oculus Studios.
A detailed description of the inner workings of VRIK can be found in this article originally published in Oculus Developer Blog.

Getting started:

Performance:

VRIK is about 2-3 times faster than FullBodyBipedIK. In Dead and Buried 2, it was used on 6 avatars simultaneously visible on screen and running on Oculus Quest hardware. Since Final IK v1.9 VRIK has a 3-level LOD system with level 1 providing roughly 30% gain and level 2 solver disabled with only the root position and rotation updated if the built-in locomotion solver was used.

Adding VRIK component in run-time:

void LateUpdate () {
var ik = gameObject.AddComponent<VRIK>();
ik.AutoDetectReferences();
}

Using VRIK with Rotation Limits:
VRIK has it's own set of built-in constraints and RotationLimits can not be used in the solving process. It is possible however to apply RotationLimits on top of VRIK for instance to make sure that the hand bones do not bend unnaturally beyond reasonable limits. To do this, we would have to disable the rotation limits in Start to take control of their updating, then update them after VRIK using the VRIK.solver.OnPostUpdate delegate::

public VRIK ik;
public RotationLimit[] rotationLimits;
void Start() {
foreach (RotationLimit limit in rotationLimits) {
limit.enabled = false;
}
ik.solver.OnPostUpdate += AfterVRIK;
}
private void AfterVRIK() {
foreach (RotationLimit limit in rotationLimits) {
limit.Apply();
}
}

Calibration:
Please take a look at the "VRIK (Calibration)" demo on how to use the VRIKCalibrator to help with calibrating avatars to head and hand controllers plus additional trackers on the body and feet. If you only need to calibrate the size of the avatar, it is easiest to do so by having the player stand up straight, then comparing the height of the head target to the height of the avatar's head bone:

float sizeF = (ik.solver.spine.headTarget.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y);
ik.references.root.localScale *= sizeF;

Locomotion:
The built-in procedural locomotion was developed in the early days of VR and designed for foot shuffling around a few square meters space. It does not work well for room-scale or thumbstick locomotion. For that it would be best to use an animated approach - make a simple 8-direction strafing animation blend tree and use that to make the character follow the horizontal direction towards the HMD by root motion or scripted transformation.

Component variables:

VRIKComponent.png

Solver variables:

VRIKSolver.png

Spine variables:

VRIKSpine.png

Arm variables:

VRIKArm.png

Leg variables:

VRIKLeg.png

Locomotion variables:

VRIKLocomotion.png

Script References: