# Using Game Engines for Visuo-Haptic Learning Simulations
## 1 Introduction  
Significant changes in education have occurred through the years thanks to the evolution of technology. New technological advances focused on education have emerged, such as E-learning and technology enhanced learning, and simulators have been one of the most practical solution to enhance learning [1]. Moreover, visual and auditory channels usually are mostly considered in their development. Tactile sensations have been considered in these simulators by the use of input devices such as mouse devices, keyboards and touch screens. These are considered to be primary input sources. However, recent advances in the development of input devices also consider haptic feedback [2; 3; 4; 5] (Figure 1). They enable users to experience the sense of touch and collaborate with sight to interact with virtual environments. Users can feel, palpate, and experience feedback forces in virtual environments. In addition, some haptic devices provide a low-cost solutions that can enhance realism of the virtual simulations [6]. Haptic devices have been used in many fields such as navigation, e-commerce, game, and even arts [3]. The areas with the most applications are medical training and education in general [4; 5; 7; 8]. There have been studies to evaluate user acceptance of virtual simulators [9]suggesting that virtual environments help users to experience scenarios in multi-sensory approaches. Consequently, simulators that incorporate haptic devices pose an important educational alternative to gain knowledge and skills. Moreover, learning and training are usually associated as a trial-error process and these provide interactive security and comfort conditions to let users practice without any danger [10]. Nevertheless, simulators that pair them have to provide proper interaction between the haptic device and the virtual objects since people use visuo-motor reflexes to acquire knowledge. Visuo-haptic interactive simulators are often built in C++ by using OpenGL and/or using physics engines, such as NVIDIA PhysX (NVIDIA Corporation, California, U.S.). In order to add haptic connectivity, virtual simulators use a haptic rendering framework to control the haptic device. While the haptic interaction is commonly provided by the underlying haptics framework, new tools to develop 3D interactive applications have appeared. Among them, game engines are frameworks enabling developers to create high-quality applications quickly and easily. Game engines are environments designed to develop video-games. They provide built-in components, such as a rendering engine and a physics engine for collision detection and response, that facilitate the development of 2D or 3D applications. Nevertheless, game engines do not consider haptic rendering features in their functionality, so that must be outsourced. We introduce a novel architecture that facilitates the development of visuo-haptic interactive simulations. It combines the use of game engines and haptic devices by different manufacturers. Unity was chosen as the testing game engine for this study (Unity Technologies, California, U.S.). A key challenge, and the contribution of our work, is the way we incorporate several and different brand haptic devices into Unity by using third-party solutions that are dependent on the CPU's architecture or do not consider multi-device operability. Our approach was planned to allow any interactive application developed in game engines to incorporate multi-device connectivity. These functionalities were implemented in two different modules: (1) Haptic Connectivity (HC) and (2) Haptic Manager (HM). The proposed architecture is capable of incorporating multiple devices in the same application, either the same or different brand, without the need of performing additional adjustments. To validate the proposed architecture, the Haptic Device Integration for Unity (HaDIU) plugin was created. HaDIU is a C# and C++ plugin and it enables interconnectivity and functionality of multiple devices, as well as the generation of haptic rendering in game engines.