Skip to content

Flashlight

Ian edited this page Nov 2, 2018 · 17 revisions

Overview

The flashlight technique allows a user to select objects with less precision required by a ray-cast. Like a real flashlight a cone volume is projected out of the controller. A user can then select an object by hovering over it with the flashlight.

There are two ways to select between objects if multiple are encompassed by the flashlight:

  1. If multiple objects are in the volume the one that is closer to the centre line of the cone is selected.
  2. If the distance between the objects to the centre line are the same then the object closest to the controller is selected.

Source paper of the technique

Liang, J., and M. Green (1994). “JDCAD: A Highly Interactive 3D Modeling System.” Computers and Graphics 18(4): 499–506.


Use by manually attaching

To manually attach the Flashlight to the Camerarig VR components if the auto-attach fails for each hand:

  • Drag onto Flashlight script:
    • Relevant controller onto ObjectAttachedTo and Tracked Obj
  • Drag onto Flashlight Selection
    • Relevant controller onto TheController
  • Drag Left and Right controller in the flashlight controller script to the Left and Right VR controllers

Inspector parameters

For Flashlight Script:

Parameter Default Description
Transparency 0.5 The level of transparency the cone volume is
The Colour Black The colour of the cone volume

For Flashlight Selection Script:

Parameter Default Description
Interaction Layers PickableObject The layers that the technique can interact with
Interaction Type Manipulation When set to manipulation Flashlight can move objects via fixed joints. When pure selection it will just send an event that it has selected and place the object into a public variable.
Selection None The currently selected object
Object Hovered Over None The object currently hovered over
Selected Object() Empty Event Invoked when an object is selected
Hovered() Empty Event Invoked when an object is hovered over
UnHovered() Empty Event Invoked when an object ceases being hovered over

Test/Example scenes

Major example scene under:

  • Assets/Technique Example Scenes/Scenes/FlashlightExample

Clone this wiki locally