Skip to content

Commit 9cc3453

Browse files
authored
Merge pull request #3731 from cre8ivepark/mrtk_development_hl2_README
Adding new README files
2 parents aab6808 + 05b4bc8 commit 9cc3453

File tree

108 files changed

+905
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+905
-193
lines changed

Documentation/GettingStartedWithTheMRTK.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,20 @@ For more information on the rest of the toolkit, please check the following guid
162162
* [Creating interactions between the player and your project]() (Coming Soon)
163163
* [Configuration Profile Usage Guide]() (Coming Soon)
164164
* [Guide to building Registered Services]() (Coming Soon)
165-
* [Guide to Pointers documentation]() (Coming Soon)
165+
* [Guide to Pointers documentation]() (Coming Soon)
166+
167+
## Building blocks for UI and Interactions
168+
| [![Button](/External/ReadMeImages/Button/MRTK_Button_Main.png)](/Documentation/README_Button.md) [Button](/Documentation/README_Button.md) | [![Bounding Box](/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Main.png)](/Documentation/README_BoundingBox.md) [Bounding Box](/Documentation/README_BoundingBox.md) | [![Manipulation Handler](/External/ReadMeImages/ManipulationHandler/MRTK_Manipulation_Main.png)](/Documentation/README_ManipulationHandler.md) [Manipulation Handler](/Documentation/README_ManipulationHandler.md) |
169+
|:--- | :--- | :--- |
170+
| A button control which supports various input methods including HoloLens2's articulated hand | Standard UI for manipulating objects in 3D space | Script for manipulating objects with one or two hands |
171+
| [![Slate](/External/ReadMeImages/Slate/MRTK_Slate_Main.png)](/Documentation/README_Slate.md) [Slate](/Documentation/README_Slate.md) | [![System Keyboard](/External/ReadMeImages/SystemKeyboard/MRTK_SystemKeyboard_Main.png)](/Documentation/README_SystemKeyboard.md) [System Keyboard](/Documentation/README_SystemKeyboard.md) | [![Interactable](/External/ReadMeImages/Interactable/InteractableExamples.png)](/Documentation/README_Interactable.md) [Interactable](/Documentation/README_Interactable.md) |
172+
| 2D style plane which supports scrolling with articulated hand input | Example script of using the system keyboard in Unity | A script for making objects interactable with visual states and theme support |
173+
| [![Solver](/External/ReadMeImages/Solver/MRTK_Solver_Main.png)](/Documentation/README_Solver.md) [Solver](/Documentation/README_Solver.md) | [![Object Collection](/External/ReadMeImages/ObjectCollection/MRTK_ObjectCollection_Main.png)](/Documentation/README_ObjectCollection.md) [Object Collection](/Documentation/README_ObjectCollection.md) | [![Tooltip](/External/ReadMeImages/Tooltip/MRTK_Tooltip_Main.png)](/Documentation/README_Tooltip.md) [Tooltip](/Documentation/README_Tooltip.md) |
174+
| Various object positioning behaviors such as tag-along, body-lock, constant view size and surface magnetism | Script for lay out an array of objects in a three-dimensional shape | Annotation UI with flexible anchor/pivot system which can be used for labeling motion controllers and object. |
175+
| [![App Bar](/External/ReadMeImages/AppBar/MRTK_AppBar_Main.png)](/Documentation/README_AppBar.md) [App Bar](/Documentation/README_AppBar.md) | [![Pointers](/External/ReadMeImages/Pointers/MRTK_Pointer_Main.png)](/Documentation/README_Pointers.md) [Pointers](/Documentation/README_Pointers.md) | [![Fingertip Visualization](/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_Main.png)](/Documentation/README_FingertipVisualization.md) [Fingertip Visualization](/Documentation/README_FingertipVisualization.md) |
176+
| UI for Bounding Box's manual activation | Learn about various types of pointers | Visual affordance on the fingertip which improves the confidence for the direct interaction |
177+
178+
## Example Scene
179+
You can find various types of interactions and UI controls in this example scene.
180+
181+
[![Button](/External/ReadMeImages/MRTK_Examples.png)](/Documentation/README_HandInteractionExamples.md)

Documentation/README_AppBar.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# App Bar
2+
![App Bar](/External/ReadMeImages/AppBar/MRTK_AppBar_Main.png)
3+
4+
App Bar is a UI component used with Bounding Box. Using the 'Adjust' button, you can turn on/off the Bounding Box interface for manipulating object.
5+
6+
## How to use App Bar
7+
Drog and drop **AppBar** prefab into the scene hierarchy. In the inspector panel of the AppBar, you will see **Bounding Box** under **Target Bounding Box** section. Assign any objects that has Bounding Box. **Important: Target object's Bounding Box activation option should be 'Activate Manually'**
8+
9+
<img src="/External/ReadMeImages/AppBar/MRTK_AppBar_Setup1.png" width="450">
10+
11+
<img src="/External/ReadMeImages/AppBar/MRTK_AppBar_Setup2.png" width="450">
12+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Bounding Box #
2+
![Bounding Box](/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Main.png)
3+
4+
The `BoundingBox` script provides basic functionality for transforming objects in Windows Mixed Reality. Using handles on the corners and edges, you can scale or rotate the object. On HoloLens 2, the bounding box responds to your finger's proximity. It shows visual feedback to help perceive the distance from the object. MRTK's bounding box provides various options which allow you to easily customize the interactions and visuals. 
5+
6+
For more information please see [App Bar and Bounding Box](https://docs.microsoft.com/en-us/windows/mixed-reality/app-bar-and-bounding-box) on Windows Dev Center.
7+
8+
### How to use Bounding Box ###
9+
You can enable Bounding Box by simply assigning the `BoundingBox` script to any GameObject.
10+
11+
![Bounding Box](/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Assign.png)
12+
13+
### Example Scene ###
14+
You can find bounding box examples in the *HandInteractionExamples.unity* scene:
15+
16+
<img src="/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Examples.png" width="550">
17+
18+
### Inspector Properties ###
19+
![Bounding Box](/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Structure.png)
20+
21+
#### Target Object ####
22+
This specifies which object will get transformed by the bounding box manipulation. If no object is set, the bounding box defaults to the owner object.
23+
24+
#### Bounds Override ####
25+
Allows to alternatively set a box collider from another object for bounds computation.
26+
27+
#### Activation Behavior ####
28+
There are several options to activate the bounding box interface.
29+
30+
- **Activate On Start** : Bounding Box becomes visible once the scene is started.
31+
- **Activate By Proximity** : Bounding Box becomes visible when an articulated hand is close to the object.
32+
- **Activate By Pointer** : Bounding Box becomes visible when it is targeted by a hand-ray pointer.
33+
- **Activate Manually** : Bounding Box does not become visible automatically. You can manually activate it through a script by accessing the boundingBox.Active property.
34+
35+
#### Scale Minimum ####
36+
The minimum allowed scale.
37+
38+
#### Scale Maximum ####
39+
The maximum allowed scale.
40+
41+
#### Box Display ####
42+
Various bounding box visualization options.
43+
44+
If Flatten Axis is set to *Flatten Auto*, the script will disallow manipulation along the axis with the smallest extent. This results in a 2D bounding box, which is usually used for thin objects.
45+
46+
#### Handles ####
47+
You can assign the material and prefab to override the handle style. If no handles are assigned, they will be displayed in the default style.
48+
49+
#### Events ####
50+
Bounding Box provides the following events. The example uses these events to play audio feedback.
51+
52+
- **Rotate Started**
53+
- **Rotate Ended**
54+
- **Scale Started**
55+
- **Scale Ended**
56+
57+
<img src="/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_Events.png" width="450">
58+
59+
### Make an object movable with Manipulation Handler ###
60+
If you want to make the object movable using far interaction, you can combine [`ManipulationHandler.cs`](README_ManipulationHandler.md) with `BoundingBox.cs`. [ManipulationHandler](README_ManipulationHandler.md) supports both one and two-handed interactions. To make [`ManipulationHandler.cs`](README_ManipulationHandler.md) work with near interaction, you should add `NearInteractionGrabbable.cs` too.
61+
62+
<img src="/External/ReadMeImages/BoundingBox/MRTK_BoundingBox_ManipulationHandler.png" width="450">
63+
64+
In order for the bounding box edges to be highlighted the same way when moving it using [`ManipulationHandler`](README_ManipulationHandler.md)'s far interaction, it is advised to connect its events for **On Manipulation Started** / **On Manipulation Ended** to `BoundingBox.HightlightWires` / `BoundingBox.UnhighlightWires` respectively, as shown in the screenshot above.

Documentation/README_Button.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Button #
2+
![Button](/External/ReadMeImages/Button/MRTK_Button_Main.png)
3+
The button supports all available input methods including articulated hand input for the near interactions and gaze + air-tap for the far interactions. You can also use voice command to trigger the button.
4+
5+
## How to use the Pressable Button prefab
6+
Simply drag [PressableButton.prefab](/Assets/MixedRealityToolkit.SDK/Features/UX/Interactable/Prefabs/PressableButton.prefab) or [PressableButtonPlated.prefab](/Assets/MixedRealityToolkit.SDK/Features/UX/Interactable/Prefabs/PressableButtonPlated.prefab) into the scene. These button prefabs are already configured to have audio-visual feedback for the various types of inputs, including articulated hand input and gaze. The events exposed in the `PressableButton` and the [`Interactable`](README_Interactable.md) component can be used to trigger additional actions. 
7+
8+
The Pressable Buttons in the HandInteractionExamples scene use [`Interactable`](README_Interactable.md)'s *OnClick* event to trigger a change in the color of a cube. This event gets triggered for different types of input methods such as gaze, air-tap, hand-ray, as well as physical button presses through the `PressableButton` script.
9+
10+
<img src="/External/ReadMeImages/Button/MRTK_Button_HowToUse_Interactable.png" width="450">
11+
12+
You can configure when the `PressableButton` fires the [`Interactable`](README_Interactable.md)'s *OnClick* event via the `PhysicalPressEventRouter` on the button. For example, you can set *OnClick* to fire when the button is first pressed, as opposed to be pressed, and then released, by setting *Interactable On Click* to *Event On Press*.
13+
14+
<img src="/External/ReadMeImages/Button/MRTK_Button_HowTo_Events.png" width="450">
15+
16+
To leverage specific articulated hand input state information, you can use `PressableButton`'s events - *Touch Begin*, *Touch End*, *Button Pressed*, *Button Released*. These events will not fire in response to air-tap, hand-ray, or eye inputs, however.
17+
18+
<img src="/External/ReadMeImages/Button/MRTK_Button_HowTo_PressableButton.png" width="450">
19+
20+
## Interaction States
21+
In the idle state, the button's front plate is not visible. As a finger approaches or a cursor from gaze input targets the surface, the front plate's glowing border becomes visible. There is additional highlighting of the fingertip position on the front plate surface. When pushed with a finger, the front plate moves with the fingertip. When the fingertip touches the surface of the front plate, it shows a subtle pulse effect to give visual feedback of the touch point.
22+
23+
<img src="/External/ReadMeImages/Button/MRTK_Button_InteractionStates.png" width="600">
24+
25+
The subtle pulse effect is triggerd by the `PressableButton.` The `PressableButton` looks for `ProximityLight(s)` that live on the currently interacting pointer. If any `ProximityLight(s)` are found, the ProximityLight.Pulse method is called which automatically animates shader parameters to display a pulse.
26+
27+
## Property Inspector of PressableButton
28+
![Button](/External/ReadMeImages/Button/MRTK_Button_Structure.png)
29+
30+
The Pressable Button prefab is consists of the following elements:
31+
32+
#### Box Collider
33+
`Box Collider` for the button's front plate.
34+
35+
#### Pressable Button
36+
The logic for the button movement with hand press interaction.
37+
38+
#### Physical Press Event Router
39+
This script sends events from hand press interaction to [`Interactable`](README_Interactable.md).
40+
41+
#### Interactable
42+
[`Interactable`](README_Interactable.md) handles various types of interaction states and events. HoloLens gaze, gesture, and voice input and immersive headset motion controller input are directly handled by this script.
43+
44+
#### Audio Source
45+
Unity `Audio Source` for the audio feedback clips
46+
47+
#### NearInteractionTouchable.cs
48+
Required to make any object touchable with articulated hand input.
49+
50+
### Prefab Layout
51+
![Button](/External/ReadMeImages/Button/MRTK_Button_Layout.png)
52+
53+
The *ButtonContent* object contains front plate, text label and icon. The *FrontPlate* responds to the proximity of the index fingertip using the *Button_Box* shader. It shows glowing borders, proximity light, and a pulse effect on touch. The text label is made with TextMesh Pro. *SeeItSayItLabel*'s visibility is controlled by [`Interactable`](README_Interactable.md)'s theme.
54+
55+
## Voice command ('See-it, Say-it')
56+
57+
#### Speech Input Handler
58+
The [`Interactable`](README_Interactable.md) script in Pressable Button already implements IMixedRealitySpeechHandler. A voice command keyword can be set here. 
59+
60+
<img src="/External/ReadMeImages/Button/MRTK_Button_Speech1.png" width="450">
61+
62+
#### Speech Input Profile
63+
Additionally, you need to register the voice command keyword in the global `Speech Commands Profile`
64+
65+
<img src="/External/ReadMeImages/Button/MRTK_Button_Speech2.png" width="450">
66+
67+
#### See-it, Say-it label
68+
The Pressable Button prefab has a placeholder TextMesh Pro label under the *SeeItSayItLabel* object. You can use this label to communicate the voice command keyword for the button to the user.
69+
70+
<img src="/External/ReadMeImages/Button/MRTK_Button_Speech3.png" width="450">
71+
72+
## Using PressableButton on other types of objects
73+
74+
You can use the `PressableButton`s script to configure an object to react to finger pushes.
75+
76+
In the HandInteractionExamples scene, you can take a look at the piano and round button examples which are both using `PressableButton`
77+
78+
<img src="/External/ReadMeImages/Button/MRTK_Button_Custom1.png" width="450">
79+
80+
<img src="/External/ReadMeImages/Button/MRTK_Button_Custom2.png" width="450">
81+
82+
Each piano key has a `PressableButton` and a `NearInteractionTouchable` script assigned. It is important to verify that the *Local Forward* direction of `NearInteractionTouchable` is correct. It is represented by a white arrow in the editor. Make sure the arrow points away from the button's front face:
83+
84+
<img src="/External/ReadMeImages/Button/MRTK_Button_Custom3.png" width="450">
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fingertip Visualization
2+
![Fingertip Visualization](/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_Main.png)
3+
4+
The fingertip affordance helps the user recognize the distance from the target object. The ring shape visual adjusts its size based on the distance from the fingertip to the object. The fingertip visualization is primarily controlled by the `FingerCursor` prefab (and script) which is spawned as the cursor prefab of the `PokePointer`. Other components of the visualization include the `ProximityLight` script, and `MixedRealityStandard` shader.
5+
6+
### How to use the Fingertip Visualization ###
7+
8+
By default the fingertip visualization will work in any Unity scene that is configured to spawn a FingerCursor. Spawning of the FingerCursor occurs in the `DefaultMixedRealityToolkitConfigurationProfile` under:
9+
10+
- DefaultMixedRealityInputSystemProfile
11+
- DefaultMixedRealityInputPointerProfile
12+
- PokePointer
13+
- FingerCursor
14+
15+
At a high level the fingertip visualization works by using a proximity light to project a colored gradient on any nearby surfaces that accept proximity lights. The finger cursor then looks for any nearby interactible surfaces, which are determined by parent IMixedRealityNearPointer(s), to align the finger ring with a surface as the finger moves towards a surface. As a finger approaches a surface the finger ring is also dynamically animated using the round corner properties of the MixedRealityStandard shader.
16+
17+
### Example Scene ###
18+
19+
You can find fingertip visualization examples in almost any scene that works with articulated hands, but is prominent in the HandInteractionExamples.unity scene.
20+
21+
![Fingertip Visualization](/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_States.png)
22+
23+
### Inspector Properties ###
24+
25+
#### FingerCursor ####
26+
<img src="/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_Finger_Cursor_Inspector.png" width="600">
27+
28+
Many of the FingerCursor properties are inherited from the BaseCursor class. Important properties include the far/near surface margins and widths which drive the finger ring animation in the MixedRealityStandard shader. For other properties please hover over the inspector tool tips.
29+
30+
#### ProximityLight ####
31+
![Fingertip Visualization](/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_Proximity_Light_Inspector.png)
32+
33+
The proximity light settings control how the light looks when near and far from a surface. The center, middle, and outer colors control the gradient look of the light and can be custom tailored for the color palette of your application. Note, the colors are HDR (High Dynamic Range) to allow users to brighten the proximity light to values above one. For other properties please hover over the inspector tool tips.
34+
35+
#### MixedRealityStandard Shader ####
36+
<img src="/External/ReadMeImages/Fingertip/MRTK_FingertipVisualization_Mixed_Reality_Standard_Shader_Inspector.png" width="600">
37+
38+
The MixedRealityStandard shader is used for many effects in the MRTK. The two settings important for fingertip visualization are "Near Fade" and "Proximity Light." Near Fade allows objects to fade in/out as a camera or light nears them. Make sure to check "Light" to allow proximity lights to drive the fade (rather than the camera). You can reverse the values of "Fade Begin" and "Fade Complete" to reverse a fade. Check "Proximity Light" for any surface you would like the proximity light to brighten. For other properties please hover over the inspector tool tips.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Hand Interaction Examples scene
2+
![Hand Interaction Examples](/External/ReadMeImages/MRTK_Examples.png)
3+
4+
In this example scene, you can find various types of interactions and UI controls that supports HoloLens2's articulated hand input.
5+
You can find the **HandInteractionExamples.unity** scene under **Assets\MixedRealityToolkit.Examples\Demos\HandTracking\Scenes**
6+
7+
*This example scene uses **TextMesh Pro**. Please click **'Import TMP Essentials'** button when you see this prompt. Unity will import TextMesh Pro packages*
8+
9+
<img src="/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_TMP2.png" width="450">
10+
11+
*If you see big text after TextMesh Pro import, please open other Unity scene and open this scene again.*
12+
13+
<img src="/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_TMP1.png" width="350">
14+
15+
16+
## Pressable Button
17+
See [Button](README_Button.md) page for the details.
18+
![Hand Interaction Examples](/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_PressTouch.png)
19+
20+
## Bounding Box
21+
See [Bounding Box](README_BoundingBox.md) page for the details.
22+
![Hand Interaction Examples](/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_BoundingBox.png)
23+
24+
## Manipulation Handler
25+
See [Manipulation Handler](README_ManipulationHandler.md) page for the details.
26+
![Hand Interaction Examples](/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_Manipulation.png)
27+
28+
## Slate
29+
See [Slate](README_Slate.md) page for the details.
30+
![Hand Interaction Examples](/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_Slate.png)
31+
32+
## System Keyboard
33+
See [System Keyboard](README_SystemKeyboard.md) page for the details.
34+
![Hand Interaction Examples](/External/ReadMeImages/HandInteractionExamples/MRTK_Examples_Keyboard.png)

0 commit comments

Comments
 (0)