figshare
Browse
pone.0293536.g004.tif (1.61 MB)

Structure of the “Pointing and Highlighting” module.

Download (1.61 MB)
figure
posted on 2023-11-09, 18:39 authored by Martin M. Müller, Jonas Scherer, Patrick Unterbrink, Olivier J. N. Bertrand, Martin Egelhaaf, Norbert Boeddeker

The module features several components, listed below. Pointing: The pointing system is centred around the IPointingController interface, for which we provide a default implementation called RaycastBasedPointingController. The SurfaceBasedPointingManager allows the user to define a list of objects which can be pointed at (using the raycasting system, see below) and handles the actual pointing process, including placement and movement of a customisable pointing-marker-object in the 3D scene. Highlighting: The highlighting system features flexible components for collecting and managing possible targets, as well as doing the actual highlighting of targeted objects in the scene at runtime. This ITargetingVisualiser interface simply defines the functionalities needed mark a GameObject as targeted or untargeted. We provide an implementation of the Interface called HighlightTargetVisualiser, which can change the rendering material of objects to show they are being targeted. The HighlightTargetVisualiser is then used to fill the requirement for a ITargetingVisualer in the SimpleObjectHighlighter. Raycasting: The raycasting system provides the necessary functionality to do raycasting and identifying targeted objects. It is built around the IRayCaster, ITargetCollector and IRayTargetFinder interfaces. The IRayCaster interface simply allows the casting of rays from a specified source. We provide the MouseRayCaster as a default implementation of this interface, which is also used in the example scene. Note that just by exchanging this component, a system using a completely different set of raycast inputs (such as an eye-tracking system) can be created and the different raycast input modes could even be exchanged on the fly in a given project. To check if a given ray has hit a target, we can use an implementation of the IRayTargetFinder interface. Here, we provide to implementations, which can be exchanged based on task requirements. The first implementation (DotProductBasedRayTargetFinder) determines targets based on the relative directions of the ray and the straight line between ray source and (potential) target objects. The second implementation (ColliderBasedRayTargetFinder) uses Unity’s Collider system to directly detect, whether a given object was hit. Finally, to manage which objects should be targetable, we can use an implementation of the ITargetCollector interface. We provide a simple default implementation (SimpleTargetCollector), which can be supplied with lists of GameObjects to track as being targetable.

History