Skip to content

Simulator

ChengNan Yang edited this page Mar 22, 2018 · 12 revisions
  • Simulator is a fake VRModule that spawn/remove fake devices, create fake tracking and fake input events.
  • Requires checking the Simulator support toggle in Edit > Preferences... > VIUSettings.
  • Simulator can only be enabled when no VR device detected.

  • There are 2 ways to manipulate the fake devices
  1. Handle events by script manually
    1. HTC.UnityPlugin.VRModuleManagement.VRModule.Simulator.onUpdateDeviceState
      1. Invoked each frame when VRModule performs a device state update
      2. Write device state into currState argument to manipulate devices
      3. Read-only argument prefState preserved device state in last frame
  2. Use Keyboard-Mouse control (can be disabled in VIU Settings)
    1. Add/Remove/Select devices
      1. [0~9] Add and select device N if device N is not selected, otherwise, deselect it
      2. [` + 0~5] Add and select device 10+N if device 10+N is not selected, otherwise, deselect it
      3. [Shift + 0~9] Remove and deselect device N
      4. [Shift + ` + 0~5] Remove and deselect device 10+N
    2. Control selected device
      1. [W] Move selected device forward
      2. [S] Move selected device backward
      3. [D] Move selected device right
      4. [A] Move selected device left
      5. [E] Move selected device up
      6. [Q] Move selected device down
      7. [C] Roll+ selected device
      8. [Z] Roll- selected device
      9. [X ] Reset selected device roll
      10. [ArrowUp] Pitch+ selected device
      11. [ArrowDown] Pitch- selected device
      12. [ArrowRight] Yaw+ selected device
      13. [ArrowLeft] Yaw- selected device
      14. [MouseMove] Pitch/Yaw selected device
      15. [MouseLeft] Press Trigger on selected device
      16. [MouseRight] Press Trackpad on selected device
      17. [MouseMiddle] Press Grip on selected device
      18. [Hold Shift + MouseMove] Touch Trackpad on selected device
    3. Control HMD
      1. [T] Move forward
      2. [G] Move backward
      3. [H] Move right
      4. [F] Move left
      5. [Y] Move up
      6. [R] Move down
      7. [N] Roll+
      8. [V] Roll-
      9. [B] Reset roll
      10. [I] Pitch+
      11. [K] Pitch-
      12. [L] Yaw+
      13. [J] Yaw-

  • Note: When the simulator is enabled, it is always started with 3 fake devices
  1. [0] HMD (selected)
  2. [1] Right Controller
  3. [2] Left Controller