使用 Windows Mixed Reality 模拟器Using the Windows Mixed Reality simulator

使用 Windows Mixed Reality 模拟器,无需 Windows Mixed Reality 沉浸式耳机即可在电脑上测试混合现实应用。The Windows Mixed Reality simulator allows you to test mixed reality apps on your PC without a Windows Mixed Reality immersive headset. Windows 10 创意者更新中提供了模拟器。The simulator is available with the Windows 10 Creators Update. 模拟器与 HoloLens 模拟器类似,但模拟器不使用虚拟机。The simulator is similar to the HoloLens Emulator, though the simulator doesn't use a virtual machine. 模拟应用在 Windows 10 桌面用户会话中运行,就像使用沉浸式耳机一样。Simulated apps run in your Windows 10 desktop user session, just like they would if you were using an immersive headset. 沉浸式耳机上传感器读取的人工和环境输入使用键盘、鼠标或 Xbox 控制器进行模拟。The human and environmental inputs read by the sensors on an immersive headset are instead simulated using your keyboard, mouse, or Xbox controller. 应用不需要任何修改即可在模拟器中运行,并且不知道它们不在沉浸式耳机上运行。Apps don't need any modification to run in the simulator, and don't know they aren't running on an immersive headset.

启用 Windows Mixed Reality 模拟器Enabling the Windows Mixed Reality simulator

  1. 启用 开发人员模式-> 更新和安全性-为开发人员 >Enable Developer mode from Settings -> Update and Security -> For developers
  2. 从桌面启动 混合现实门户Launch the Mixed Reality Portal from the desktop
  3. 如果这是你第一次启动门户,则需要完成安装体验If this is your first time launching the portal, you'll need to go through the setup experience
    1. 选择 入门Select Get started
    2. 选择 " 我同意 接受协议"Select I agree to accept the agreement
    3. 对于开发人员,请选择 " 设置" 进行模拟 () 在不使用物理设备的情况下继续进行安装Select Set up for simulation (for developers) to continue through setup without a physical device
    4. 选择 " 设置 " 以确认你的选择Select Set up to confirm your choice
  4. 选择混合现实门户左侧的 " 开发人员 " 按钮Select the For developers button on the left side of the Mixed Reality Portal
  5. 将模拟切换开关切换到 打开Turn the Simulation toggle switch to On
    • 默认情况下,启用模拟将安装并启用左模拟的 DOF 控制器。Enabling simulation installs and enables the left simulated 6-DOF controller by default. 在 Windows 10 可能2019更新之前,安装模拟 6 DOF 控制器需要管理员权限。Before the Windows 10 May 2019 update, installing a simulated 6-DOF controller requires administrator permissions. 接受 "用户帐户控制" 对话框(如果有)。Accept the User Account Control dialog if one appears.

现在,你应该已运行模拟!You should now be running with simulation!

如果要在 "设置" 中禁用开发人员模式,则应首先在混合现实门户的 "开发人员" 部分中将模拟切换开关设置为 "关闭"。If you want to disable Developer mode in Settings, you should first turn the Simulation toggle switch to Off in the For developers section of the Mixed Reality Portal.

将应用部署到混合现实模拟器Deploying apps to the Mixed Reality simulator

由于模拟器在没有虚拟机的情况下在本地 PC 上运行,因此你可以在调试时将通用 Windows 应用程序部署到 本地计算机Since the simulator runs on your local PC without a Virtual Machine, you can deploy your Universal Windows apps to the Local Machine when debugging.

基本模拟器输入Basic simulator input

控制模拟器类似于许多常见的3D 视频游戏和 HoloLens 模拟器Controlling the simulator is similar to many common 3D video games and the HoloLens emulator. 可以使用键盘、鼠标或 Xbox 控制器提供输入。There are input options available using the keyboard, mouse, or Xbox controller.

可以通过定向模拟用户的操作,戴上沉浸式耳机来控制模拟器。You control the simulator by directing the actions of a simulated user wearing an immersive headset. 你的操作将移动模拟用户,并与应用进行交互,使其与沉浸式耳机上的响应相同。Your actions move the simulated user and cause interactions with apps that respond as they would on an immersive headset.

  • 前后左右走动 - 使用键盘上的 WASD 键,或 Xbox 控制器上的左摇杆。Walk forward, back, left, and right - Use the W,A,S, and D keys on your keyboard, or the left stick on an Xbox controller.
  • 查找、向下、向左 、向右选择并拖动鼠标、使用键盘上的箭头键或 Xbox 控制器上的右摇杆。Look up, down, left, and right - Select and drag the mouse, use the arrow keys on your keyboard, or the right stick on an Xbox controller.
  • 操作按钮按下控制器 -右键单击鼠标,按键盘上的 enter 键,或使用 Xbox 控制器上的按钮。Action button press on controller - Right-click the mouse, press the Enter key on your keyboard, or use the A button on an Xbox controller.
  • "主页" 按钮按下控制器 -按键盘上的 Windows 键或 F2 键,或按 Xbox 控制器上的 B 按钮。Home button press on controller - Press the Windows key or F2 key on your keyboard, or press the B button on an Xbox controller.
  • 用于滚动的控制器移动 -按住 Alt 键和鼠标右键,然后向上或向下拖动鼠标。Controller movement for scrolling - Hold the Alt key and the right mouse button, then drag the mouse up / down. 在 Xbox 控制器中,按住右触发器和按钮,并将右摇杆向下和向下移动。In an Xbox controller, hold down the right trigger and A button and move the right stick up and down.

跟踪控制器Tracked controllers

混合现实模拟器最多可以模拟两个手持跟踪的运动控制器。The Mixed Reality simulator can simulate up to two hand-held tracked motion controllers. 在混合现实门户中使用切换开关启用它们。Enable them using the toggle switches in the Mixed Reality Portal. 每个模拟控制器都有:Each simulated controller has:

  • 位置和方向(空间)Position and orientation in space
  • “主页”按钮Home button
  • “菜单”按钮Menu button
  • 手柄按钮Grip button
  • 触摸板Touchpad
  • 控制Thumbstick
  • 电池电量水平Battery level

下一个开发检查点Next Development Checkpoint

如果你遵循我们规划的 Unity 开发检查点历程,则你就处于部署阶段之中。If you're following the Unity development checkpoint journey we've laid out, you're in the midst of the deployment stage. 在这里,你可以继续下一 主题 或直接跳转到添加高级服务。From here, you can continue to the next topic or jump directly to adding advanced services.

另请参阅See also