Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Add support for input and gestures for hand controllers #552

Merged
merged 314 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
cbb887f
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 4, 2020
36d761e
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 5, 2020
b8e9bc3
Merge branch 'feature/pointer-near-interaction-collision' of https://…
FejZa May 5, 2020
8f62717
Delete baked lighting settings for base
FejZa May 5, 2020
31302ef
Fix ControllerPopupWindow NRE
FejZa May 5, 2020
c31c4eb
Implement internal is grabbing update
FejZa May 5, 2020
f725394
Disable hand meshing by default and assign tracked poses to test profile
FejZa May 5, 2020
ae2ddb3
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 7, 2020
30db7ea
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 7, 2020
b7f020a
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 7, 2020
b4fac99
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 7, 2020
d1bd9c3
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 8, 2020
2a07d5b
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 8, 2020
e2b49a4
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 8, 2020
e01c8e9
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 9, 2020
1a03f9e
Add IsValidCollision extension to colliders
FejZa May 9, 2020
97e18fc
Merge branch 'feature/pointer-near-interaction-collision' of https://…
FejZa May 9, 2020
e9e58bf
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 9, 2020
6ad1edd
Feature/pni change requests (#577)
FejZa May 9, 2020
ec5d0f9
updated submodules
StephenHodgson May 9, 2020
1120e04
Merge branch 'feature/pointer-near-interaction-collision' of https://…
FejZa May 9, 2020
340a91b
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 9, 2020
546e0c1
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 9, 2020
d081bb2
Merge branch 'feature/pointer-near-interaction-collision' of https://…
FejZa May 9, 2020
6bc0911
Merge branch 'feature/temp-hand-input' into feature/hand-input-and-poses
FejZa May 9, 2020
dbd04a3
updated sdk
StephenHodgson May 9, 2020
85f5955
updated sdk
StephenHodgson May 9, 2020
7bcdf1a
Cleanup namespace
FejZa May 9, 2020
0a168ab
Better fallback pointer pose calculation
FejZa May 10, 2020
ce37623
Introduce hand rendering mode
FejZa May 10, 2020
8b722c0
Implement runtime rendering mode switch
FejZa May 10, 2020
2808a18
Update submodules
FejZa May 10, 2020
0f85694
Merge branch 'feature/pointer-near-interaction-collision' of https://…
FejZa May 10, 2020
08a1ece
Start new hands examples room
FejZa May 10, 2020
95917bf
Add canvas UI and 3D Buttons station
FejZa May 10, 2020
b7b6629
Show button stations result
FejZa May 10, 2020
63d88fb
Implement set rendering mode station
FejZa May 10, 2020
863a96a
Added more stations
FejZa May 10, 2020
ffb2e80
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 12, 2020
1feec13
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 12, 2020
9fc4ef7
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 13, 2020
0f3655b
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 13, 2020
164f172
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 13, 2020
16774ce
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 13, 2020
fde1db8
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 13, 2020
91361d6
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 13, 2020
f432a63
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 13, 2020
31c2553
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 13, 2020
2f57b9d
Update submodules
FejZa May 13, 2020
271147c
Merge branch 'development' into feature/pointer-near-interaction-coll…
StephenHodgson May 13, 2020
edaa241
Merge branch 'feature/pointer-near-interaction-collision' into featur…
StephenHodgson May 13, 2020
ccb99fd
updated wmr checkout
StephenHodgson May 14, 2020
1b8ee4f
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 14, 2020
f8c1cab
updated sdk
StephenHodgson May 14, 2020
eadb9af
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 17, 2020
1c6f00d
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 17, 2020
d95ea31
Update submodules
FejZa May 18, 2020
fd6a954
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 18, 2020
b09d988
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 18, 2020
038326e
Add additive scene loader for hands demo scene
FejZa May 18, 2020
886040d
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 18, 2020
04b0da6
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
7162c39
Restore base scene
FejZa May 19, 2020
224fe46
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
05552e1
Add simple physics demo station
FejZa May 19, 2020
34e47d5
Cleanup namespace
FejZa May 19, 2020
2fa676f
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 19, 2020
01bbda4
Cleanup hand examples a bit
FejZa May 19, 2020
b4bd9f6
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
4b4dbb9
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
699867b
Update stations
FejZa May 19, 2020
d07d429
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 19, 2020
26286cf
Implement runtime bounds mode selection
FejZa May 19, 2020
901555c
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
20e6097
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 19, 2020
53030bd
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 20, 2020
61b6421
Update submodules
FejZa May 20, 2020
f29c9b2
Update Ultraleap checkout
FejZa May 20, 2020
bf3d584
Update physics station
FejZa May 20, 2020
f3f4268
Update submodule
FejZa May 21, 2020
b789d45
Update submodule
FejZa May 21, 2020
63b4e89
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 21, 2020
6f9e33f
Fix UWP certficate error
FejZa May 21, 2020
3e4ff3f
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 21, 2020
88efe54
Moved examples to examples repo
FejZa May 21, 2020
cda3019
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 21, 2020
a1c42e1
reset editor window options for hands
StephenHodgson May 21, 2020
82fe3a2
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
StephenHodgson May 21, 2020
0c3514a
Implement pinch strength
FejZa May 22, 2020
34accdc
Add pinch strength to hand controller interface
FejZa May 22, 2020
bf44709
Update submoduules
FejZa May 22, 2020
f991789
Update SDK
FejZa May 22, 2020
b133a14
Use array instead of list for tracked poses
FejZa May 22, 2020
c627179
Restructure pose recognition code
FejZa May 23, 2020
7d53092
Improved variable naming
FejZa May 23, 2020
d7c2e45
Add root pose to hand data
FejZa May 23, 2020
bb66481
Set root pose for simulation
FejZa May 23, 2020
ba6735d
Fix joint rotations
FejZa May 24, 2020
1ca85fb
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 25, 2020
96932d4
Update SDK
FejZa May 25, 2020
c45adef
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 25, 2020
515c92a
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 26, 2020
d249eb1
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 26, 2020
233b1f1
Remove base converter and introduce Post Processor
FejZa May 26, 2020
a5eac65
Update data provider to use post processor
FejZa May 26, 2020
cd96cd3
Optimize recognition
FejZa May 26, 2020
777db57
Introduce grip strength
FejZa May 26, 2020
2fa6542
Enable setters for post processor
FejZa May 26, 2020
78a63f4
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 26, 2020
2644634
Minor refactoring in post processor
FejZa May 26, 2020
3c04753
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa May 26, 2020
e56ce16
Removed NONE joint
FejZa May 26, 2020
9af8a20
Rename joints
FejZa May 27, 2020
4b1a247
Update submodules
FejZa May 27, 2020
530c562
Extend default hand mappings
FejZa May 27, 2020
3e5e9e2
Sync simulation profiles
FejZa May 27, 2020
02945e5
Reset popup window options for hands
FejZa May 27, 2020
97c8933
Hand input and poses change request (#616)
StephenHodgson May 27, 2020
53cdff3
updated sdk checkout
StephenHodgson May 27, 2020
05e69ba
Implement grip pose
FejZa May 27, 2020
1d2f102
Adjust processor to joint enum renamings
FejZa May 27, 2020
01646cb
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 27, 2020
eeaaece
updated sdk checkout
StephenHodgson May 27, 2020
961e539
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 28, 2020
55b3217
Introduce hand finger enum
FejZa May 28, 2020
7ca3f59
Rename pose recognizer and implement frame throttle
FejZa May 28, 2020
2b5de99
Minor docs update
FejZa May 28, 2020
cc05db6
Implement finger curls
FejZa May 28, 2020
425e23d
Add Oculus (Desktop) package back in for now
FejZa May 28, 2020
bb7be66
Disable debug log for grip calculations
FejZa May 28, 2020
6ce815a
updated tracked pose processor compare (#617)
StephenHodgson May 28, 2020
d9f9e1e
Implement IMixedRealityHandController.TryGetFingerCurlStrength
FejZa May 28, 2020
c461f6d
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 28, 2020
6a8cf39
Update SDK
FejZa May 28, 2020
b9382fd
Disable recognition for now
FejZa May 28, 2020
0f790ab
Add index curl constraint to isgripping detection
FejZa May 28, 2020
1d38a83
updated sdk checkout
StephenHodgson May 29, 2020
3828156
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 29, 2020
ab4c107
updated SDK
StephenHodgson May 29, 2020
d97b63f
updated sdk checkout
StephenHodgson May 29, 2020
12eb3c9
Implement recorded pose baking and update inspector
FejZa May 29, 2020
d42c3b0
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 29, 2020
09a1e4f
Update SDK
FejZa May 29, 2020
db81624
Remove handedness from hand data
FejZa May 29, 2020
2dcbf9e
Update Oculus
FejZa May 29, 2020
450e3a9
Fix baked data not persisted
FejZa May 29, 2020
19bcb47
Update SDK
FejZa May 29, 2020
f01aade
Fix pose recognizer handedness issue
FejZa May 29, 2020
6e2a249
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson May 29, 2020
eb12b24
Improve pose processor
FejZa May 29, 2020
b0c4aee
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa May 29, 2020
cb1e563
Fix IsPointing set to false when pinching
FejZa May 31, 2020
d2aa8e0
Update submodules
FejZa Jun 1, 2020
083b0a5
Update examples checkout
FejZa Jun 1, 2020
41b9eac
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa Jun 2, 2020
fc30b95
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 2, 2020
014617a
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 2, 2020
ba3799c
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 2, 2020
3e016a0
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 2, 2020
4a40866
Do not pass tracked pose scriptable object outside of data provider
FejZa Jun 3, 2020
8014d22
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Jun 3, 2020
c5264f9
Update examples
FejZa Jun 4, 2020
42a0114
Update examples
FejZa Jun 4, 2020
52466fc
Fix potential NRE
FejZa Jun 5, 2020
da86368
Fix potential casting error
FejZa Jun 5, 2020
3b9ba8f
Fix formatting
FejZa Jun 5, 2020
ac2bf82
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Jun 5, 2020
a38c580
Use for instead of foreach
FejZa Jun 5, 2020
e7885b0
Revert metro package version
FejZa Jun 5, 2020
343afea
Rename HandControllerPoseDefinition to HandControllerPoseProfile
FejZa Jun 5, 2020
361d113
Revert to ReordableList for tracked poses
FejZa Jun 5, 2020
1afbbf5
Change HandData to be a struct
FejZa Jun 6, 2020
9a7ccf8
Update submodule
FejZa Jun 6, 2020
ad982f4
Update example module
FejZa Jun 6, 2020
6ee2f75
Fix invalid simulated hand position when camera rotation is changed
FejZa Jun 7, 2020
a18598f
Fix generic pointer pose invalid when camera rotated
FejZa Jun 7, 2020
efbe9ef
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 8, 2020
65f795d
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa Jun 8, 2020
46df3ec
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 8, 2020
980af24
Remove redundant properties in hand mesh data
FejZa Jun 8, 2020
4192bca
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Jun 8, 2020
f40f088
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 8, 2020
adb5468
Update submodules
FejZa Jun 9, 2020
64d6aa3
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa Jun 10, 2020
138ac0c
Only update hand state if hand is tracked
FejZa Jun 11, 2020
dcd61c9
Remove obsolete pose extensions
FejZa Jun 11, 2020
58feb29
Introduce hand utilities for pose estimation
FejZa Jun 11, 2020
3d02385
Update submodules
FejZa Jun 11, 2020
af855f8
Implement TryGetHandMeshData
FejZa Jun 11, 2020
036a14e
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 12, 2020
7b44997
Remove HandData input event
FejZa Jun 12, 2020
280f15c
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Jun 12, 2020
d940ac8
Update submodule
FejZa Jun 12, 2020
68d768f
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 12, 2020
3171e90
Update submodules
FejZa Jun 13, 2020
977ba83
Implement relativeTo paramter for TryGetJointPose
FejZa Jun 14, 2020
6ddc976
Fix IsPointing
FejZa Jun 14, 2020
4d3ddbf
Use TrackingState instead of bool for tracking state
FejZa Jun 14, 2020
124b550
Fix missed occurence of IsTracked
FejZa Jun 14, 2020
103cfa4
Update Oculus
FejZa Jun 14, 2020
44d0b4e
Fix pointer pose
FejZa Jun 14, 2020
4999993
Update Oculus
FejZa Jun 14, 2020
066d1cd
Fix fallback pointer pose
FejZa Jun 14, 2020
5c2afc8
Fix pose recognizer left/right issue
FejZa Jun 14, 2020
c5d6488
Update submodules
FejZa Jun 14, 2020
b360b0f
Remove tracked pose mapping (coming back later)
FejZa Jun 15, 2020
927ce48
Fix hand velocity calculation
FejZa Jun 15, 2020
b9a1778
Fix local to world joint translation
FejZa Jun 15, 2020
73493ed
Fix simulation mappings
FejZa Jun 15, 2020
d67c4ee
Fix IsPointing after teleport
FejZa Jun 15, 2020
4655e2d
Update submodule
FejZa Jun 15, 2020
d240485
Fix simulated hand not reset on tracking loss
FejZa Jun 15, 2020
9005e2c
Fix simulated hand position after teleport
FejZa Jun 15, 2020
222cb82
Update SDK
FejZa Jun 15, 2020
7a09750
Update SDK
FejZa Jun 15, 2020
7b17ba3
Update examples module
FejZa Jun 15, 2020
8e58ac9
fixed some typos
StephenHodgson Jun 16, 2020
3959b06
updated oculus checkout
StephenHodgson Jun 16, 2020
f0c6087
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 16, 2020
d9cb9f1
Update example checkout
FejZa Jun 16, 2020
5f699dc
Reset hand controller options window
FejZa Jun 17, 2020
28bee18
Update submodules
FejZa Jun 17, 2020
5ff2641
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 17, 2020
fd5dbe3
fixed submodule checkouts
StephenHodgson Jun 17, 2020
7e6cebb
Remove tracked poses from hand data provider interface
FejZa Jun 17, 2020
25929e8
Cache bounds arrays
FejZa Jun 17, 2020
5b3518e
Allow a bit more tolerance wit IsPointing
FejZa Jun 17, 2020
86c481c
Update submodules
FejZa Jun 17, 2020
e6cf423
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Jun 17, 2020
99fa9d9
Update example
FejZa Jun 18, 2020
2f84f2c
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa Jun 19, 2020
8b3b654
Update modules
FejZa Jun 19, 2020
dd5874f
Update submodules
FejZa Jun 20, 2020
8e939ae
Update oculus
FejZa Jun 21, 2020
98acc0d
Update WMR
FejZa Jun 21, 2020
9f81ba3
Clean up gizmo meshes
FejZa Jul 1, 2020
f0e00ab
Remove duplicate vertices in gizmo meshes
FejZa Jul 1, 2020
cae2c34
Update submodules and wmr package
FejZa Jul 15, 2020
fb08d63
Only apply default head height if not managed by device
FejZa Jul 30, 2020
10d9f72
Merge branch 'fix/656-head-height' of https://github.com/XRTK/XRTK-Co…
FejZa Aug 1, 2020
e02a8ac
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Aug 28, 2020
e6101c6
Merge branch 'development' into feature/hand-input-and-poses
StephenHodgson Aug 29, 2020
3720091
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
FejZa Sep 4, 2020
86953d1
Update submodules
FejZa Sep 17, 2020
f0f52e0
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Sep 17, 2020
1af6cfd
Introduce IHandDataPostProcessor
FejZa Sep 18, 2020
3deb025
Update submodules
FejZa Sep 20, 2020
1b29d25
Merge branch 'development' into feature/hand-input-and-poses
SimonDarksideJ Sep 21, 2020
91923b4
Update WMR submodule
FejZa Sep 21, 2020
6762d50
Merge branch 'feature/hand-input-and-poses' of https://github.com/XRT…
FejZa Sep 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Submodules/Examples
Submodule Examples updated 172 files
2 changes: 1 addition & 1 deletion Submodules/Lumin
Submodule Lumin updated from dbd3a9 to 070709
2 changes: 1 addition & 1 deletion Submodules/Oculus
2 changes: 1 addition & 1 deletion Submodules/SDK
Submodule SDK updated from e05429 to 1ab7f0
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public static void Show(MixedRealityControllerMappingProfile profile, Serialized
}

window = (ControllerPopupWindow)CreateInstance(typeof(ControllerPopupWindow));
window.currentControllerName = profile.ControllerType?.Type?.Name;
FejZa marked this conversation as resolved.
Show resolved Hide resolved

window.currentControllerName = profile.ControllerType?.Type?.Name;
window.titleContent = new GUIContent($"{window.currentControllerName} {handednessTitleText}Input Action Assignment");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using UnityEngine;
using XRTK.Definitions.Controllers.Hands;
using XRTK.Definitions.Utilities;
using XRTK.Editor.Extensions;
using XRTK.Editor.Profiles;
using XRTK.Extensions;
using XRTK.Providers.Controllers.Hands;

namespace XRTK.Editor.Data.Controllers.Hands
{
[CustomEditor(typeof(HandControllerPoseProfile))]
public class HandControllerPoseProfileInspector : BaseMixedRealityProfileInspector
{
private SerializedProperty id;
private SerializedProperty description;
private SerializedProperty isDefault;
private SerializedProperty keyCode;
private SerializedProperty data;

// Baked data.
private SerializedProperty didBake;
private SerializedProperty isGripping;
private SerializedProperty fingerCurlStrengths;
private SerializedProperty gripStrength;

private static readonly GUIContent generalSettingsHeader = new GUIContent("General Settings");
private static readonly GUIContent simulationSettingsHeader = new GUIContent("Simulation Settings");
private static readonly GUIContent bakeSettingsHeader = new GUIContent("Bake Settings");
private static readonly GUIContent infoHeader = new GUIContent("Info");
private static readonly GUIContent bakeButtonContent = new GUIContent("Generate Baked Data");
private static readonly GUIContent updateBakeButtonContent = new GUIContent("Update Baked Data");
private bool infoExpanded = false;

protected override void OnEnable()
{
base.OnEnable();

id = serializedObject.FindProperty(nameof(id));
description = serializedObject.FindProperty(nameof(description));
isDefault = serializedObject.FindProperty(nameof(isDefault));
keyCode = serializedObject.FindProperty(nameof(keyCode));
data = serializedObject.FindProperty(nameof(data));

// Baked data.
didBake = serializedObject.FindProperty(nameof(didBake));
isGripping = serializedObject.FindProperty(nameof(isGripping));
fingerCurlStrengths = serializedObject.FindProperty(nameof(fingerCurlStrengths));
gripStrength = serializedObject.FindProperty(nameof(gripStrength));
}

public override void OnInspectorGUI()
{
RenderHeader("This profile defines a hand pose that can be recognized at runtime and trigger input events.");

serializedObject.Update();

description.isExpanded = EditorGUILayoutExtensions.FoldoutWithBoldLabel(description.isExpanded, generalSettingsHeader);
if (description.isExpanded)
{
EditorGUI.indentLevel++;

EditorGUILayout.PropertyField(id);
EditorGUILayout.PropertyField(description);
EditorGUILayout.PropertyField(data);

EditorGUI.indentLevel--;
}

EditorGUILayout.Space();

isDefault.isExpanded = EditorGUILayoutExtensions.FoldoutWithBoldLabel(isDefault.isExpanded, simulationSettingsHeader);
if (isDefault.isExpanded)
{
EditorGUI.indentLevel++;

EditorGUILayout.PropertyField(isDefault);
EditorGUILayout.PropertyField(keyCode);

EditorGUI.indentLevel--;
}

EditorGUILayout.Space();

didBake.isExpanded = EditorGUILayoutExtensions.FoldoutWithBoldLabel(didBake.isExpanded, bakeSettingsHeader);
if (didBake.isExpanded)
{
if (!didBake.boolValue)
{
EditorGUILayout.HelpBox($"This hand pose hasn't been baked yet. In order for the pose to be recognized when running your application you need to bake it," +
$" which will precompute important data and save performance.", MessageType.Warning);
}

if (GUILayout.Button(didBake.boolValue ? updateBakeButtonContent : bakeButtonContent))
{
BakePoseData();
}
}

EditorGUILayout.Space();

infoExpanded = EditorGUILayoutExtensions.FoldoutWithBoldLabel(infoExpanded, infoHeader);
if (infoExpanded)
{
EditorGUI.indentLevel++;

if (didBake.boolValue)
{
EditorGUILayout.LabelField($"Baked Is Gripping:\t\t{isGripping.boolValue}");
EditorGUILayout.LabelField($"Baked Grip Strength:\t\t{gripStrength.floatValue}");
EditorGUILayout.LabelField($"Baked Thumb Curl:\t\t{fingerCurlStrengths.GetArrayElementAtIndex((int)HandFinger.Thumb).floatValue}");
EditorGUILayout.LabelField($"Baked Index Curl:\t\t{fingerCurlStrengths.GetArrayElementAtIndex((int)HandFinger.Index).floatValue}");
EditorGUILayout.LabelField($"Baked Middle Curl:\t\t{fingerCurlStrengths.GetArrayElementAtIndex((int)HandFinger.Middle).floatValue}");
EditorGUILayout.LabelField($"Baked Ring Curl:\t\t{fingerCurlStrengths.GetArrayElementAtIndex((int)HandFinger.Ring).floatValue}");
EditorGUILayout.LabelField($"Baked Little Curl:\t\t{fingerCurlStrengths.GetArrayElementAtIndex((int)HandFinger.Little).floatValue}");
}
else
{
EditorGUILayout.HelpBox("Bake the hand pose to see baked information here.", MessageType.Info);
}

EditorGUI.indentLevel--;
}

serializedObject.ApplyModifiedProperties();
}

private void BakePoseData()
{
// Initialize the hand data using the joint information from the recorded pose.
var poseDefinition = target as HandControllerPoseProfile;
var handData = poseDefinition.ToHandData();

// Intialize processors needed.
var gripPostProcessor = new HandGripPostProcessor();

// Process the hand data, most hand data processors
// will ignore the hand data if it is not tracked, so we
// have to temporarily fake it's tracking state and then reset it.
handData.TrackingState = Definitions.Devices.TrackingState.Tracked;
gripPostProcessor.PostProcess(Handedness.Right, handData);
handData.TrackingState = Definitions.Devices.TrackingState.NotTracked;

isGripping.boolValue = handData.IsGripping;
gripStrength.floatValue = handData.GripStrength;
fingerCurlStrengths.ClearArray();
fingerCurlStrengths.arraySize = handData.FingerCurlStrengths.Length;
for (int i = 0; i < handData.FingerCurlStrengths.Length; i++)
{
fingerCurlStrengths.GetArrayElementAtIndex(i).floatValue = handData.FingerCurlStrengths[i];
}

didBake.boolValue = true;
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -484,32 +484,6 @@
true
]
},
{
"Controller": "MixedRealityHandController",
"Handedness": 1,
"InputLabelPositions": [
{
"x": 413.0,
"y": 125.0
}
],
"IsLabelFlipped": [
false
]
},
{
"Controller": "MixedRealityHandController",
"Handedness": 2,
"InputLabelPositions": [
{
"x": 3.0,
"y": 125.0
}
],
"IsLabelFlipped": [
true
]
},
{
"Controller": "OculusTouchController",
"Handedness": 1,
Expand Down Expand Up @@ -711,102 +685,6 @@
false
]
},
{
"Controller": "SimulatedMixedRealityHandController",
"Handedness": 1,
"InputLabelPositions": [
{
"x": 480.0,
"y": 80.0
},
{
"x": 480.0,
"y": 100.0
},
{
"x": 480.0,
"y": 120.0
},
{
"x": 480.0,
"y": 140.0
},
{
"x": 480.0,
"y": 160.0
},
{
"x": 480.0,
"y": 180.0
},
{
"x": 480.0,
"y": 200.0
},
{
"x": 480.0,
"y": 220.0
}
],
"IsLabelFlipped": [
false,
false,
false,
false,
false,
false,
false,
false
]
},
{
"Controller": "SimulatedMixedRealityHandController",
"Handedness": 2,
"InputLabelPositions": [
{
"x": -55.0,
"y": 80.0
},
{
"x": -55.0,
"y": 100.0
},
{
"x": -55.0,
"y": 120.0
},
{
"x": -55.0,
"y": 140.0
},
{
"x": -55.0,
"y": 160.0
},
{
"x": -55.0,
"y": 180.0
},
{
"x": -55.0,
"y": 200.0
},
{
"x": -55.0,
"y": 220.0
}
],
"IsLabelFlipped": [
true,
true,
true,
true,
true,
true,
true,
true
]
},
{
"Controller": "OculusTouchOpenVRController",
"Handedness": 2,
Expand Down
Loading