## [Input]()
## Table of Contents
- [Overview](#overview)
- [Input System Diagrams](#input-system-diagrams)
- [Input Module Design](#input-module-design)
- [Prefabs](#prefabs)
- [Scripts](#scripts)
- [Test Prefabs](#test-prefabs)
- [Test Scripts](#test-scripts)
- [Tests](#tests)
## Overview
This contains a fully-featured **input system**, which allows you to handle various types of input and send them to any game object being currently gazed at, or any fallback object. It also includes a few example cursors, similar to the HoloLens shell cursor, that fully leverages the Unity's animation system. This input system uses Unity's default **EventSystem** and there's no need for a custom **input module**. The default **Standalone Input Module** works with this input system.
## Input System Diagrams:
![alt text](/External/ReadMeImages/InputSystemDiagram.png)
![alt text](/External/ReadMeImages/CursorSystemDiagram.PNG)
### Input Module Design
The input module is designed to be extensible: it could support various input mechanisms and various types of gazers.
Each input source (hands, gestures, others) implement a **IInputSource** interface. The interface defines various events that the input sources can trigger. The input sources register themselves with the InputManager, whose role it is to forward input to the appropriate game objects. Input sources can be dynamically enabled / disabled as necessary, and new input sources can be created to support different input devices.
Game objects that want to consume input events can implement one or many **input interfaces**, such as:
- **IFocusable** for focus enter and exit. The focus can be triggered by the user's gaze or any other gaze source.
- **IHoldHandle** for the Windows hold gesture.
- **IInputHandler** for source up and down. The source can be a hand that tapped, a clicker that was pressed, etc.
- **IInputClickHandler** for source clicked. The source can be a hand that tapped, a clicker that was pressed, etc.
- **IManipulationHandler** for the Windows manipulation gesture.
- **INavigationHandler** for the Windows navigation gesture.
- **ISourceStateHandler** for the source detected and source lost events.
- **ISpeechHandler** for voice commands.
- **IDictationHandler** for speech to text dictation.
- **IGamePadHandler** for generic gamepad events.
- **IXboxControllerHandler** for Xbox One Controller events.
The **input manager** listens to the various events coming from the input sources, and also takes into account the gaze. Currently, that gaze is always coming from the GazeManager class, but this could be extended to support multiple gaze sources if the need arises.
By default, input events are sent to the currently focused game object, if that object implements the appropriate interface. Modals input handlers can also be added to the input manager: these modal handlers will take priority over the currently focused object Fallback handlers can also be defined, so that the application can react to global inputs that aren't targeting a specific element. Any event sent by the input manager always bubbles up from the object to its ancestors.
In recap, the **input manager** forwards the various input sources events to the appropriate game object, using the following order:
1. The registered modal input handlers, in LIFO (Last-In First-Out) order of registration
2. The currently focused object
3. The fallback input handlers, in LIFO order of registration
### [Prefabs](Prefabs)
Prefabs related to the input features.
#### BasicCursor.prefab
Torus shaped basic cursor that follows the user's gaze around.
#### Cursor.prefab
Torus shaped CursorOnHolograms when user is gazing at holograms and point light CursorOffHolograms when user is gazing away from holograms.
#### CursorWithFeedback.prefab
Torus shaped cursor that follows the user's gaze and HandDetectedFeedback asset to give feedback to user when their hand is detected in the ready state.
#### DefaultCursor.prefab
3D animated cursor that follows the user's gaze and uses the Unity animation system to handle its various states. This cursor imitates the HoloLens Shell cursor.
#### HoloLensCamera.prefab
Unity camera that has been customized for Holographic development.
1. Camera.Transform set to 0,0,0
2. 'Clear Flags' changed to 'Solid Color'
3. Color set to R:0, G:0, B:0, A:0 as black renders transparent in HoloLens.
4. Set the recommended near clipping plane.
5. Allows manual movement of the camera when in editor
#### InputManager.prefab
Input system that manages gaze and various input sources currently supported by HoloLens, such as hands and gestures.
This also includes a fake input source that allows you to simulate input when in the editor. By default, this can be done by holding Shift (left input source) or Space (right input source), moving the mouse to move the source and using the left mouse button to tap.
#### MixedRealityCamera.prefab
Camera capabale of rendering for HoloLens and occluded Windows Mixed Reality enabled devices.
MixedRealityCameraManager.cs exposes some defaults for occluded aka opaque displays Vs HoloLens.
You can either use the defaults that have been set or customize them to match your application requirements.
**For HoloLens:**
1. 'Clear Flags' is set to 'Solid Color' and Color to 'Clear' as black renders transparent in HoloLens.
2. Near clip plane is set to 0.85 per comfort recommendations.
3. Quality Settings to be Fastest.
**For occluded aka opaque devices:**
1. 'Clear Flags' is set to Skybox
2. Near clip plane is set to 0.3 which is typical for VR applications.
3. Quality Settings to be Fantastic as it uses the PC GPU to render content.
#### MixedRealityCameraParent.prefab
This prefab is used when you want to enable teleporting on mixed reality enabled occluded devices.
In order to prevent the MainCamera position from being overwritten in the next update we use a parent GameObject.
#### MixedRealityCameraParentWithControllers.prefab
This prefab is used when you want to enable teleporting on mixed reality enabled occluded devices, as well as motion controller visualization.
In order to prevent the MainCamera position from being overwritten in the next update we use a parent GameObject.
### [Scripts](Scripts)
Scripts related to the input features.
##### ControllerVisualizer.cs
Use this to visualize a 6DoF controller in your application. Add this script to a GameObject as a child of the MainCamera, or use the MixedRealityCameraParentWithControllers prefab. Either specify a shader to use for the [glTF](https://www.khronos.org/gltf) model or add GameObject overrides to represent the controllers.
- **leftControllerOverride** [Optional] A prefab to spawn to represent the left controller. This will automatically move and reorient when the controller is moved.
- **rightControllerOverride** [Optional] A prefab to spawn to represent the right controller. This will automatically move and reorient when the controller is moved.
- **touchpadTouchedOverride** [Optional] A prefab to spawn to represent the user's touch location on the touchpad. This will automatically move when the user moves their touch location. Default is a sphere.
- **GLTFShader** [Optional, if using overrides] If using the controller's built-in [glTF](https://www.khronos.org/gltf) model, this will be the shader applied to the resulting GameObject.
##### ControllerDebug.cs
This can be used to load a [glTF](https://www.khronos.org/gltf) file in the editor, as well as displaying input and source data from motion controllers on a text panel for debugging purposes on the device.
- **LoadGLTFFile** A boolean to specify if a glTF file should be loaded from StreamingAssets.
- **GLTFName** The name of the GLTF file to be loaded from StreamingAssets.
- **touchpadTouchedOverride** [Optional] A prefab to spawn on the touchpad of the glTF fil
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Hololens 集成百度语音识别API (2000个子文件)
00000000000000001000000000000000 4KB
00000000000000002000000000000000 4KB
00000000000000003000000000000000 4KB
00000000000000004000000000000000 4KB
00000000000000004100000000000000 4KB
00000000000000005000000000000000 4KB
00000000000000005100000000000000 4KB
00000000000000006000000000000000 4KB
00000000000000006100000000000000 4KB
00000000000000007000000000000000 4KB
00000000000000007100000000000000 4KB
00000000000000008000000000000000 4KB
00000000000000009000000000000000 4KB
0000000000000000a000000000000000 4KB
0000000000000000a100000000000000 4KB
0000000000000000b000000000000000 4KB
0000000000000000c000000000000000 4KB
0000000000000000e100000000000000 4KB
007c74dfb2f47d54cb03722769c30a83 4KB
00eb2a0ee0d6a9f4ea1f7897e23e1589 4KB
0118fa4f1c88b4640b193eca2c181644 1.9MB
012e902635965e648a446fdb85fbc0bc 4KB
01394e03387aef842ad30a41fb78b312 3.01MB
019bc2c61963f164f881b0dfbb4c4862 8KB
022450106439a8946ae18a9e20cc92d8 4KB
026247228427a694eae4fa19eb6ae09f 4KB
029ac67c65e8d7d428e72c96a230fe63 7KB
02a7240a07c6149409b42274987c904a 12KB
02ef53b3a93625840aa0bdadd41119c4 5KB
03314f8008ae1ed4fbd45c95a7ed5182 20KB
03fe91f227bf8af44afc939d2303cbb0 10KB
0402aea3ed774414b87137eb8848b5f8 5KB
04160e0c231a5714c982df6de2d09433 4KB
0420a07554966fc43ac95909b984ff94 6KB
04428b85e80f24744866d700e45435e6 13KB
04ad9e97f7517eb438617674589293fc 9KB
04c537c71d256594a951d2b914a48746 9KB
057493d169444074387c9a5ca1c99e92 10KB
05c4367217d78d741a8dc9a92553e85a 62KB
05d1324a6d6a0d248848b4042ad6d6bf 11KB
05ef969da1d2a5e43b55fd70c58d8909 6KB
0624081163014824eb575250d78c791e 4KB
066461858c98cfa4f84fadee8ef21431 6KB
06790e211e4a6df409b1e04bc91c4810 42KB
0733b0d4a112f34408f3ec5df4021a8a 10KB
075e3abbbf0bde044bb4bf8382bb45ac 4KB
07ae3de54e484bf46a26fc8f28d3fff7 31KB
0803619fdf239e145a93a8523d180b3a 4KB
084b4f8c431905d4cac0e4b5f2a3b6db 12KB
088ad37b7824ce1449ef005936680709 15KB
08d25ccfbbc595b4a820c7edd551d095 4KB
09695ea2dad045941b91889068b9d837 9KB
09ea77b2be8b62b4a9c86c123cd5ddbe 22KB
0a4602295e47e6b46a5eb031473bb6e0 6KB
0b08288019c3f0540a624e2c82302702 6KB
0b1722d59347f304f9691015045d7895 4KB
0b4cbbdfb189a034facbfa3dc27d25cb 4KB
0ba440176c08a3c4ebeb59f52a092c89 7KB
0c043c1caff935c4ab375545540e6f89 5KB
0c7446f1018a0e34fbf50d7ef2098a9d 162KB
0cbee55793114a1449428c2e4e1b857c 4KB
0d08dd59087697b44a68a02cc9a7c3a2 123KB
0d196d9b016a4f1f894c4def80c5fb4d 12KB
0d24e90a445079545850f6654903acb3 13KB
0d3bb855445e36e479c85976fc88383a 5KB
0decd33ba8702954885a62b5bc1a778e 9KB
0df4832d89bd70c48b288941e8182067 7KB
0e5fab096886797478a02d8021f8ee03 4KB
0e8512d51bf9aa144a036c6305dd66c0 10KB
0f5805aa1626bf74eac450bb9c04b44e 7KB
0fc614944e525ec4e9d20d19bf6c3f53 5KB
0fe38ed55fd84d548aadc453d4485300 5KB
0ff07ad2c7f9337489d2f7559b172d5d 4KB
0ff5d5ee9ce34c18a0df4ea5495be19b 9KB
1017ef825d041c749bab30bf03aca0d3 4KB
10974ed8f27211246b27dadc31bbed46 267KB
10bf81265ad87424d946598c575f45a0 1.34MB
10d95b99055c6ad40b735cc8b3593745 4KB
110c179e1fb277a409f2f398b4c4c677 5KB
11e4524f21fc6434abbbba83d70d0040 272KB
11f25bddcb4fa2849ab8e795ecb63578 5KB
121fc200dbaa05949a6b3d21bdfbbf8b 6KB
1240e6ed74b88ff4fa549db17c4a7078 4KB
128255248c91cb141a6d3c07f93ef90c 4KB
12c91ca558f50a14aac6b7157c71d2f4 4KB
12e2218b44bb5d046b63543ecbec9320 4KB
12fd8a0055b84bb59e84c9835a37e333 6KB
1322fd896bbb15bb6e335591b766ae62 4KB
1350e83623c005741ad0d1b09834ed62 11KB
13d883c0118351e4890753200e0ac916 8KB
15655e3f3fc30264ba12c386eab77790 4KB
15be9c691b85a41a39c18bee2f87e21b 4KB
15e327f750b786c46a9ec3995f60c81f 4KB
1609394dd4b2b524b9bc218ecb053679 4KB
161fc5872226601449a8143014ece469 272KB
169d15588dbd2704b827c111916f5be1 10KB
16b59cb69ca786648b130bf725a3bc0d 7KB
16bf5915a91480743bf9630434f28c4a 5KB
17173c08a15a85a4ca42fe8d17e9c94f 4KB
17aa48f2d64d22c4d8a6c63e08a13cd4 9KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- Qb188130637352018-01-16不错的一个资源
jingyuansuifeng
- 粉丝: 20
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功