What is the VR Simulator?
The VR Simulator started as a “quick-and-dirty” tool we built to make working on the Immerseum SDK easier, but following conversations with many VR devs, we’ve decided to release it as its own editor extension for Unity.
Its purpose is to make developing virtual reality scenes easier when you don’t have (or feel like hooking up) a VR headset. As the name suggests, it simulates a VR experience for you by:
- Adjusting your scene’s camera position to simulate what it would look like if an HMD were controlling the camera,
- Moving and rotating your camera in response to keyboard, mouse, gamepad, etc. input to simulate walking and looking through an HMD,
- Simulating position-tracked controllers (even if they’re not hooked up or currently being tracked) in your scene,
- Moving your simulated position-tracked controllers to simulate hand movement in your scene, and;
- Simulating a play area around your user, applying pre-defined or calibrated dimensions.
That’s the the heart of it. However, the VR Simulator‘s real strength is its easy configurability and the ability to flexibly simulate your VR experience. Using the Unity Editor, you can adjust the VR experience you’re simulating in a variety of ways:
- Automatically detect headsets and controllers. The VR Simulator automatically detects the headset you’re using (and differentiates between SteamVR/Vive and Oculus Rift) and which inputs are currently connected to your development machine. Then, it only starts simulating if simulation is necessary: If you’re connected to an HMD, you’ll get the “real” experience and if not, you’ll get the simulation.
- Simulate different head heights. Out of the box, the VR Simulator can simulate a Seated, Standing, or Custom head height to let you playtest seated, standing, and room-scale VR experiences.
- Simulate controllers using primitives or prefabs. Position-tracked controllers can either be simulated using configurable Unity primitives (spheres, cubes, etc.) or using any prefab. If your VR experience uses a custom controller model, you can use the same model in your simulations.
- Configure simulated controllers’ starting positions. You can set one or both of your simulated controllers to any position you’d care to. Using default presets, you can put them at the player’s (simulated) waist, at desk-level, reaching forward, or in a classic boxer’s pose (put up your dukes!).
- Move simulated controllers independently of each other. Using simple scripting (seriously – it’s one method call!) you can move each controller to one of the position presets or to any set of coordinates you want.
- Test controller interaction with your scene. You can configure your simulated controllers the same way you would configure your standard controller models. That way, you can attach rigidbodies and colliders to them and test their interactions with the rest of your VR scene.
- Simulate a Play Area. You can easily simulate a calibrated room-scale play area using either SteamVR’s Chaperone system or Oculus’ Guardian system whether an HMD is connected or not.
- Capture player input using events. Easily test your existing interaction logic by subscribing to one of the VR Simulator’s events – when the player pulls a trigger, have your scene do whatever it would normally do.
- Easy C# scripting. The VR Simulator provides an easy-to-work with C# scripting API that lets you build on, integrate with, or react to anything that happens in the VR Simulator.
The VR Simulator is not designed to provide “true” locomotion support for your VR scenes. It is meant to provide a quick-and-dirty approximation of locomotion support. As a result, it does not do any of the following:
- It has no specialized logic for graceful handling of inclines or stairs.
- It has no support for teleportation-based locomotion.
- It has no support for gaze-based input capture (selection or interaction).
- It hasn’t been testing in zero-gravity scenes (though movement is gravity-adjusted in the configuration).
- It hasn’t been tested in any mobile VR systems (e.g. Samsung Gear or Google Cardboard).
The VR Simulator is designed to work with:
- any SteamVR plugin-compatible HMD (i.e. the HTC Vive), and;
- the Oculus Rift.
The VR Simulator recognizes and supports input from the following devices:
- Gamepad (XBox One Controller, specifically)
- HTC Wand (Vive Controllers)
- Oculus Remote
- Oculus Touch (theoretically! see note below)
Your VR scene must contain:
- The SteamVR:[CameraRig] prefab, and/or;
- The Oculus:OVRCameraRig prefab, and/or;
- The Oculus:OVRPlayerController prefab (which itself contains the Oculus:OVRCameraRig prefab), and/or;
- A custom Camera Rig gameobject.