Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 59 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/Lumin
Submodule Lumin updated from bb5041 to e8bb65
2 changes: 1 addition & 1 deletion Submodules/Oculus
2 changes: 1 addition & 1 deletion Submodules/SDK
Submodule SDK updated from fb1c0d to b80ba4
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using XRTK.Definitions.Controllers.Simulation.Hands;
using XRTK.Definitions.Controllers.Hands;
using XRTK.Editor.Profiles;

namespace XRTK.Editor.Data.Controllers.Simulation.Hands
namespace XRTK.Editor.Data.Controllers.Hands
{
[CustomEditor(typeof(SimulatedHandControllerPoseData))]
public class SimulatedHandControllerPoseDataInspector : BaseMixedRealityProfileInspector
[CustomEditor(typeof(HandControllerPoseDefinition))]
public class HandControllerPoseDefinitionInspector : BaseMixedRealityProfileInspector
{
private SerializedProperty id;
private SerializedProperty description;
private SerializedProperty isDefault;
private SerializedProperty isSelectionPose;
private SerializedProperty keyCode;
private SerializedProperty data;

Expand All @@ -23,6 +24,7 @@ protected override void OnEnable()
id = serializedObject.FindProperty(nameof(id));
description = serializedObject.FindProperty(nameof(description));
isDefault = serializedObject.FindProperty(nameof(isDefault));
isSelectionPose = serializedObject.FindProperty(nameof(isSelectionPose));
keyCode = serializedObject.FindProperty(nameof(keyCode));
data = serializedObject.FindProperty(nameof(data));
}
Expand All @@ -36,6 +38,7 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(id);
EditorGUILayout.PropertyField(description);
EditorGUILayout.PropertyField(isDefault);
EditorGUILayout.PropertyField(isSelectionPose);
EditorGUILayout.PropertyField(keyCode);
EditorGUILayout.PropertyField(data);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class BaseMixedRealityHandControllerDataProviderProfileInspector : BaseMi
private SerializedProperty handPhysicsEnabled;
private SerializedProperty useTriggers;
private SerializedProperty boundsMode;
private SerializedProperty trackedPoses;

private bool showHandTrackingSettings = true;
private static readonly GUIContent handTrackingSettingsFoldoutHeader = new GUIContent("Hand Tracking Settings");
Expand All @@ -27,6 +28,7 @@ protected override void OnEnable()
handPhysicsEnabled = serializedObject.FindProperty(nameof(handPhysicsEnabled));
useTriggers = serializedObject.FindProperty(nameof(useTriggers));
boundsMode = serializedObject.FindProperty(nameof(boundsMode));
trackedPoses = serializedObject.FindProperty(nameof(trackedPoses));
}

public override void OnInspectorGUI()
Expand All @@ -39,18 +41,27 @@ public override void OnInspectorGUI()
if (showHandTrackingSettings)
{
EditorGUI.indentLevel++;

EditorGUILayout.LabelField("Hand Rendering Settings");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(handMeshingEnabled);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUI.indentLevel--;

EditorGUILayout.LabelField("Hand Physics Settings");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(handPhysicsEnabled);
EditorGUILayout.PropertyField(useTriggers);
EditorGUILayout.PropertyField(boundsMode);
EditorGUILayout.Space();
EditorGUI.indentLevel--;

EditorGUILayout.LabelField("Tracked Hand Poses");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(trackedPoses, true);
FejZa marked this conversation as resolved.
Show resolved Hide resolved
EditorGUILayout.Space();
EditorGUI.indentLevel--;

EditorGUI.indentLevel--;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using XRTK.Definitions.Controllers.Simulation.Hands;
using XRTK.Editor.Extensions;
Expand All @@ -13,17 +12,14 @@ namespace XRTK.Editor.Profiles.InputSystem.Controllers.Simulation
public class SimulatedHandControllerDataProviderProfileInspector : SimulatedControllerDataProviderProfileInspector
{
private static readonly GUIContent SimulatedHandSettingsFoldoutHeader = new GUIContent("Simulated Hand Tracking Settings");
private static readonly GUIContent handPoseAnimationSpeedLabel = new GUIContent("Hand Pose Animation Speed");

private SerializedProperty handMeshingEnabled;
private SerializedProperty handPhysicsEnabled;
private SerializedProperty useTriggers;
private SerializedProperty boundsMode;

private SerializedProperty trackedPoses;
private SerializedProperty handPoseAnimationSpeed;
private SerializedProperty poseDefinitions;

private ReorderableList poseList;
private int currentlySelectedPoseElement;

private bool showSimulatedHandTrackingSettings = true;

Expand All @@ -36,22 +32,9 @@ protected override void OnEnable()
useTriggers = serializedObject.FindProperty(nameof(useTriggers));
boundsMode = serializedObject.FindProperty(nameof(boundsMode));

poseDefinitions = serializedObject.FindProperty(nameof(poseDefinitions));
handPoseAnimationSpeed = serializedObject.FindProperty(nameof(handPoseAnimationSpeed));

poseList = new ReorderableList(serializedObject, poseDefinitions, true, false, true, true)
{
elementHeight = EditorGUIUtility.singleLineHeight * 1.5f
};
poseList.drawHeaderCallback += DrawHeaderCallback;
poseList.drawElementCallback += DrawConfigurationOptionElement;
poseList.onAddCallback += OnConfigurationOptionAdded;
poseList.onRemoveCallback += OnConfigurationOptionRemoved;
}
trackedPoses = serializedObject.FindProperty(nameof(trackedPoses));

private void DrawHeaderCallback(Rect rect)
{
EditorGUI.LabelField(rect, "Pose Definitions");
handPoseAnimationSpeed = serializedObject.FindProperty(nameof(handPoseAnimationSpeed));
}

public override void OnInspectorGUI()
Expand All @@ -66,67 +49,37 @@ public override void OnInspectorGUI()
if (showSimulatedHandTrackingSettings)
{
EditorGUI.indentLevel++;

EditorGUILayout.LabelField("Hand Rendering Settings");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(handMeshingEnabled);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUI.indentLevel--;

EditorGUILayout.LabelField("Hand Physics Settings");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(handPhysicsEnabled);
EditorGUILayout.PropertyField(useTriggers);
EditorGUILayout.PropertyField(boundsMode);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
EditorGUILayout.LabelField("Simulated Poses");

EditorGUILayout.LabelField("Tracked Hand Poses");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(handPoseAnimationSpeed);
poseList.DoLayoutList();
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(trackedPoses, true);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
}

serializedObject.ApplyModifiedProperties();
}

private void DrawConfigurationOptionElement(Rect rect, int index, bool isActive, bool isFocused)
FejZa marked this conversation as resolved.
Show resolved Hide resolved
{
if (isFocused)
{
currentlySelectedPoseElement = index;
}

rect.height = EditorGUIUtility.singleLineHeight;
rect.y += 3;
var poseDataProperty = poseDefinitions.GetArrayElementAtIndex(index);
var selectedPoseData = EditorGUI.ObjectField(rect, poseDataProperty.objectReferenceValue, typeof(SimulatedHandControllerPoseData), false) as SimulatedHandControllerPoseData;

if (selectedPoseData != null)
{
selectedPoseData.ParentProfile = ThisProfile;
}

poseDataProperty.objectReferenceValue = selectedPoseData;
}

private void OnConfigurationOptionAdded(ReorderableList list)
{
poseDefinitions.arraySize += 1;
var index = poseDefinitions.arraySize - 1;
EditorGUILayout.LabelField("Simulated Poses");
EditorGUI.indentLevel++;
handPoseAnimationSpeed.floatValue = EditorGUILayout.Slider(handPoseAnimationSpeedLabel, handPoseAnimationSpeed.floatValue, 1, 10);
EditorGUILayout.Space();
EditorGUI.indentLevel--;

var mappingProfileProperty = poseDefinitions.GetArrayElementAtIndex(index);
mappingProfileProperty.objectReferenceValue = null;
serializedObject.ApplyModifiedProperties();
}
EditorGUI.indentLevel--;

private void OnConfigurationOptionRemoved(ReorderableList list)
{
if (currentlySelectedPoseElement >= 0)
{
poseDefinitions.DeleteArrayElementAtIndex(currentlySelectedPoseElement);
serializedObject.ApplyModifiedProperties();
}

serializedObject.ApplyModifiedProperties();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class MixedRealityInputSystemProfileInspector : MixedRealityServiceProfil
private SerializedProperty handPhysicsEnabled;
private SerializedProperty useTriggers;
private SerializedProperty boundsMode;
private SerializedProperty trackedPoses;

private SerializedProperty inputActionsProfile;
private SerializedProperty speechCommandsProfile;
Expand Down Expand Up @@ -63,6 +64,7 @@ protected override void OnEnable()
handPhysicsEnabled = serializedObject.FindProperty(nameof(handPhysicsEnabled));
useTriggers = serializedObject.FindProperty(nameof(useTriggers));
boundsMode = serializedObject.FindProperty(nameof(boundsMode));
trackedPoses = serializedObject.FindProperty(nameof(trackedPoses));

inputActionsProfile = serializedObject.FindProperty(nameof(inputActionsProfile));
gesturesProfile = serializedObject.FindProperty(nameof(gesturesProfile));
Expand Down Expand Up @@ -154,6 +156,7 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(handPhysicsEnabled);
EditorGUILayout.PropertyField(useTriggers);
EditorGUILayout.PropertyField(boundsMode);
EditorGUILayout.PropertyField(trackedPoses, true);
EditorGUI.indentLevel--;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Collections.Generic;
using UnityEngine;
using XRTK.Definitions.Controllers.Simulation.Hands;
using XRTK.Definitions.Utilities;
using XRTK.Providers.Controllers.Hands;

Expand Down Expand Up @@ -48,6 +50,15 @@ public abstract class BaseHandControllerDataProviderProfile : BaseMixedRealityCo
/// </summary>
public HandBoundsMode BoundsMode => boundsMode;

[SerializeField]
[Tooltip("Tracked hand poses for pose detection.")]
private List<HandControllerPoseDefinition> trackedPoses = new List<HandControllerPoseDefinition>();

/// <summary>
/// Tracked hand poses for pose detection.
/// </summary>
public IReadOnlyList<HandControllerPoseDefinition> TrackedPoses => trackedPoses;

public override ControllerDefinition[] GetDefaultControllerOptions()
{
return new[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
using UnityEngine;
using XRTK.Definitions.Utilities;

namespace XRTK.Definitions.Controllers.Simulation.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// A hand pose definition with recorded hand joint data.
/// Assign a collection of these poses to the data provider's profile to simulate the pose.
/// A hand controller pose definition with recorded hand joint data.
/// Defined hand poses can be recognized and trigger input actions.
/// </summary>
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Simulated Hand Controller Pose Data", fileName = "SimulatedHandControllerPoseData", order = (int)CreateProfileMenuItemIndices.Input)]
public class SimulatedHandControllerPoseData : BaseMixedRealityProfile
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Hand Controller Pose Definition", fileName = "HandControllerPoseDefinition", order = (int)CreateProfileMenuItemIndices.Input)]
public class HandControllerPoseDefinition : BaseMixedRealityProfile
FejZa marked this conversation as resolved.
Show resolved Hide resolved
{
[SerializeField]
[Tooltip("Assign a unique ID to the pose. Can be used as a descriptive name, but must be unique!")]
[Tooltip("A unique ID to the pose. Can be a descriptive name, but must be unique!")]
private string id = string.Empty;

/// <summary>
/// A unique identifier for the hand pose.
/// A unique ID to the pose.
/// </summary>
public string Id => id;

[SerializeField]
[Tooltip("Describe the hand pose.")]
[Tooltip("Describes the hand pose.")]
private string description = string.Empty;

/// <summary>
/// Gets the gesture's description.
/// Describes the hand pose.
/// </summary>
public string Description => description;

Expand All @@ -36,10 +36,19 @@ public class SimulatedHandControllerPoseData : BaseMixedRealityProfile
private bool isDefault = false;

/// <summary>
/// Gets whether this hand pose is the hand's idle pose.
/// Is this the default (idle) hand pose?
/// </summary>
public bool IsDefault => isDefault;

[SerializeField]
[Tooltip("Is this a selection pose used to select things?")]
private bool isSelectionPose = false;

/// <summary>
/// Is this a selection pose used to select things?
/// </summary>
public bool IsSelectionPose => isSelectionPose;

[SerializeField]
[Tooltip("Key used to trigger the gesture simulation.")]
private KeyCode keyCode = KeyCode.None;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@ public class HandData
/// </summary>
public bool IsTracked { get; set; } = false;

/// <summary>
/// Is the hand currently in a pinch pose?
/// </summary>
public bool IsPinching { get; set; } = false;

/// <summary>
/// Is the hand currently in a pointing pose?
/// </summary>
public bool IsPointing { get; set; } = false;

/// <summary>
/// Is the hand currently in a grabbing pose?
/// </summary>
public bool IsGrabbing { get; set; } = false;

/// <summary>
/// The hand's pointer pose.
/// </summary>
public MixedRealityPose PointerPose { get; set; } = MixedRealityPose.ZeroIdentity;

/// <summary>
/// Recognized hand pose, if any.
/// Recognizable hand poses are defined in <see cref="BaseHandControllerDataProviderProfile.TrackedPoses"/>.
/// </summary>
public HandControllerPoseDefinition TrackedPose { get; set; } = null;

/// <summary>
/// Pose information for each hand joint.
/// </summary>
Expand Down
Loading