HVRCameraRig
The camera rig component manages offsetting the HMD / Camera.
Height calibration is included and can be enabled by setting the SitStanding along with the EyeHeight field.
To assist with testing in edit mode, I have added logic that can quickly calibrate height after entering play mode.
- SaveCalibrationHeight: if enabled the last calibrated height is stored in player prefs.
- Enabling DebugCalibMode will force height calibration on start, if SaveCalibrationHeight is enabled it's stored value is used, otherwise the HMD height is used.
- HMDMoved: Calibrates when the HMD moves more than DebugCalibMovedThreshold from it's starting position.
- Immediately: Immediately calibrates.
- DebugKeyboardRecalibrate is enabled and RecalibrateKey pressed.
FloorOffset
This transform moves up and down based on a few variables.
- Height Calibration: Calibrating in sitting mode will offset based on the difference between device height and EyeHeight.
- PlayerControllerYOffset: Used by the player controller when a input driven crouch is activated.
- CameraYOffset: Users can adjust this on demand to raise or lower the camera. If DebugKeyboardOffset is enabled the Up/Down arrow keys will shift by DebugKeyboardIncrement amount.
Camera Scale
When the SitStanding mode is set to Standing, this transform will scale based on the device reported Y height and the EyeHeight field.
This will make the world look smaller for shorter players, and larger for taller players if their height is not close to the EyeHeight value.
Using this feature will let you build your world without worrying about how tall the player is. You can see this in action in games like Boneworks and Blade and Sorcery.
Left / Right Controller
Transforms that represent the tracked controller device positions and rotations.
Each transform has an Offset transform child used to shift the physics hand target.
The HVRControllerOffset component on the Offset transform manages the position and rotation offset based on the Unity XR plugin and device connected. The offsets are driven by the Controller Offsets field on the HVRInputManager component.