Skip to content

Simulator

Lawrence Wong edited this page Jun 12, 2018 · 12 revisions

  • Simulator is a mock VRModule that spawns and removes simulated devices which simulate tracking and input events.
  • Simulator allows developers to test scenes using mouse and keyboard without the need for VR devices.
  • Requires checking the Simulator support toggle in Edit > Preferences... > VIU Settings.
  • Simulator can only be enabled when no VR device is detected.

  • There are 2 ways to manipulate the simulated devices
  1. Handle events by script manually

    • HTC.UnityPlugin.VRModuleManagement.VRModule.Simulator.onUpdateDeviceState
      • Invoked each frame when VRModule performs a device state update
      • Write device state into currState argument to manipulate devices
      • Read-only argument prefState preserved device state in last frame
  2. Use Keyboard-Mouse control (can be disabled in VIU Settings)

    • Add/Remove/Select devices
      • [0~9] Add and select device N if device N is not selected
      • [` + 0~5] Add and select device 10+N if device 10+N is not selected
      • [Shift + 0~9] Remove and deselect device N
      • [Shift + ` + 0~5] Remove and deselect device 10+N
      • [ESC] When a device is selected, deselect it
    • Control selected device
      • [W] Move selected device forward
      • [S] Move selected device backward
      • [D] Move selected device right
      • [A] Move selected device left
      • [E] Move selected device up
      • [Q] Move selected device down
      • [C] Roll+ selected device
      • [Z] Roll- selected device
      • [X ] Reset selected device roll
      • [ArrowUp] Pitch+ selected device
      • [ArrowDown] Pitch- selected device
      • [ArrowRight] Yaw+ selected device
      • [ArrowLeft] Yaw- selected device
      • [MouseMove] Pitch/Yaw selected device
      • [MouseLeft] Press Trigger on selected device
      • [MouseRight] Press Trackpad on selected device
      • [MouseMiddle] Press Grip on selected device
      • [M] Press Menu button on selected device
      • [Hold Shift + MouseMove] Touch Trackpad on selected device
    • Control HMD
      • [T] Move forward
      • [G] Move backward
      • [H] Move right
      • [F] Move left
      • [Y] Move up
      • [R] Move down
      • [N] Roll+
      • [V] Roll-
      • [B] Reset roll
      • [I] Pitch+
      • [K] Pitch-
      • [L] Yaw+
      • [J] Yaw-
    • Others
      • [ESC] When no device is selected, pause Simulator
      • [F1] Toggle instructions
      • [F2] Align devices with HMD
      • [F3] Reset all devices to initial state

  • When no simulated device is selected, use WASD / QE keys and Mouse to control all connected devices as a group
  • Device index color indicates the device status
    • [White] Connected
    • [Green] Selected
    • [Grey] Not connected

  • When Simulator is enabled, it is always started with 3 simulated devices
    • [0] HMD
    • [1] Right Controller
    • [2] Left Controller