1. Install
Official documents are more detailed.
When "upgrading XR Interaction Toolkit", the package manager cannot be found, refer to the document Installation | XR Interaction Toolkit | 2.1.1 , my unity version is 2021.3.1f1, you need "Add package by name", search for "com.unity .xr.interaction.toolkit”
2. Scene Gradient
Check "Open Screen Fade" in the PXR_Manager of XR Origin, and the PXR_Screen Fade component will be automatically added in the Camera.
3. Static Foveated Rendering
Select "Foveation Level" in PXR_Manager
4. Screen refresh rate
Default 72fps
5. Focus perception
event | illustrate |
---|---|
PXR_Plugin.System.FocusStateLost Application lost input focus. | For example, if a user presses the Home button on the controller while the application is running, the system UI is displayed and the application loses input focus. At this point, the developer can pause the game, disable the user's input functionality (such as a gamepad), or notify other online users that the user is not currently focusing on the application. |
PXR_Plugin.System.FocusStateAcquired Application acquired input focus. | This event is triggered when the system UI is closed. At this point, the developer can resume the game or enable user input. |
6. Gamepad & headset input
button | Unity key-value |
---|---|
menu | CommonUsages.menuButton: Indicates the activation state of the menu button (that is, whether it is pressed). |
trigger button |
|
grab key |
|
joystick |
|
X/A | CommonUsages.primaryButton: Indicates the activation state of the X/A key. |
Y/B | CommonUsages.secondaryButton: Indicates the activation state of the Y/B key. |
The following helmets | |
return key | KeyCode.Escape |
Enter | KeyCode.JoystickButton0 |
home button | KeyCode.Home is occupied by the system and is not open by default. |
volume up key | VOLUME_UP Android standard button. Occupied by the system, it is not open by default. |
volume down key | VOLUME_DOWN Android standard button. Occupied by the system, it is not open by default. |
use:
rightController.inputDevice.TryGetFeatureValue(CommonUsages.grip, out float grip);
leftController.inputDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool isXPressed);
7. Tracking
model | illustrate |
---|---|
Device | That is the commonly understood Eye mode. When entering the application, the initial position of the device will be set as the origin by default, and the origin will not be calculated based on the height of the ground detected by the device. Tip: This mode is more suitable for sitting experience applications. |
Floor | When entering the application, the initial position of the device is combined with the height detected by the device on the ground to calculate the origin. This mode requires the device to support the ground detection function (for example: PICO Neo 3 series). Tip: This mode is more suitable for standing experience applications. |
Tracking Reference | That is, the commonly understood Stage mode, the positive direction of the scene will not be reset during calibration. Tip: This mode is more suitable for scenarios where you want the user to maintain a fixed space and orientation during the experience. |
set up:
- Head Tracking: XR Origin -> Tracking Origin Mode
- Eye Tracking: PXR_Manager -> Eye Tracking
- Gesture tracking: PXR_Manager -> Hand Tracking
test:
// 头部追踪,获取XR Origin中的Main Camera位姿
transform.position = mainCamera.position + new Vector3(0, 0, 1);
transform.rotation = mainCamera.rotation;
// 眼动追踪,只在Neo3 Pro Eye上运行,在Neo3上面不work。
bool b = PXR_EyeTracking.GetLeftEyePositionGuide(out Vector3 position);
// 手势追踪,返回false,看来目前neo3上面还没支持手势识别
bool b = PXR_HandTracking.GetSettingState();
8. Action-based input setting
The old version is Device-based input, and the new version is Action-based input, which is more flexible and officially recommended. Configure first:
the member variables of the XR Controller on the left and right handles are initially empty, and they are set to the preset XRI Default Left Controller and XRI Default Right Controller respectively, as shown in the figure below: the settings of Teleportation are the same as those of the old version, and the settings of SnapTurn
are The difference: