Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Add support for input and gestures for hand controllers #72

Merged
merged 99 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
a42ff77
updated wmr controller data provider
StephenHodgson Apr 6, 2020
23ba2a0
removed commented out class
StephenHodgson Apr 6, 2020
bb9e1a4
added controller data provider reference to the controller
StephenHodgson Apr 7, 2020
b2d22ba
Merge branch 'dev/controller-data-provier' into feature/controller-ma…
StephenHodgson Apr 7, 2020
9bc7dab
updated references
StephenHodgson Apr 7, 2020
a69a5bc
Merge branch 'development' into feature/controller-mapping-refactor
StephenHodgson Apr 7, 2020
e7eab33
fixed references
StephenHodgson Apr 7, 2020
91d54fe
Added default controller definitions
StephenHodgson Apr 7, 2020
c2e679f
updated the controller data provider inspector
StephenHodgson Apr 8, 2020
f78cbf2
updated hand data provider profile inspector
StephenHodgson Apr 8, 2020
4b0f594
removed redundant inspector
StephenHodgson Apr 9, 2020
9f68cdb
cleaned up the controller interaction mappings a bit
StephenHodgson Apr 9, 2020
4fbd33f
updated references
StephenHodgson Apr 9, 2020
7be68b5
updated controller instance creation
StephenHodgson Apr 9, 2020
f75eda4
added default constructor
StephenHodgson Apr 9, 2020
d5dc53b
updated TryRenderController method
StephenHodgson Apr 10, 2020
c216223
removed asset menu
StephenHodgson Apr 11, 2020
7898966
fixed compiler error
StephenHodgson Apr 11, 2020
32c8e4e
Remove obsolete SetupDefaultIntreactions (#65)
FejZa Apr 11, 2020
42c1ef4
updated reference
StephenHodgson Apr 12, 2020
d48bf92
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 12, 2020
5266b48
added WMR Camera Data Provider
StephenHodgson Apr 12, 2020
2222a71
updated WMR Camera Data Provider
StephenHodgson Apr 12, 2020
846c22d
updated camera rig reference
StephenHodgson Apr 12, 2020
9f7d676
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 13, 2020
1ab3842
updated icon
StephenHodgson Apr 13, 2020
57c2443
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 13, 2020
45ae978
moved WMR Camera data provider into correct file location
StephenHodgson Apr 13, 2020
d1ea209
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 13, 2020
f7e95a8
updated data provider constructors
StephenHodgson Apr 14, 2020
3bbaa07
Merge branch 'dev/data-providers' into dev/camera-system
StephenHodgson Apr 14, 2020
2ec0286
added service parent reference
StephenHodgson Apr 14, 2020
e91e950
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 14, 2020
ba21642
Change requests for controller provider inspectors (#67)
FejZa Apr 15, 2020
0bb662b
Adjust WMR to recent core changes
FejZa Apr 16, 2020
35d5220
Update due to rename
FejZa Apr 16, 2020
2da3841
Cleanup usings
FejZa Apr 16, 2020
fcbe402
Added rig reset override
StephenHodgson Apr 16, 2020
dfedf2b
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 16, 2020
8b79481
Merge branch 'feature/controller-mapping-refactor' of https://github.…
FejZa Apr 17, 2020
205d8f9
reverted changes
StephenHodgson Apr 18, 2020
628386c
removed unused reference
StephenHodgson Apr 19, 2020
0a4a317
added camera profile
StephenHodgson Apr 19, 2020
37708a4
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 19, 2020
245e5bd
Merge branch 'development' into dev/camera-system
StephenHodgson Apr 19, 2020
60c3585
Merge branch 'development' into feature/controller-mapping-refactor
StephenHodgson Apr 19, 2020
b6f0f44
Merge branch 'dev/camera-system' into feature/controller-mapping-refa…
StephenHodgson Apr 19, 2020
4bbc8af
Updated windows controller type name to get the controller textures t…
StephenHodgson Apr 19, 2020
6a10bf4
Merge branch 'feature/controller-mapping-refactor' of https://github.…
FejZa Apr 20, 2020
8ea5417
fixed reference to renamed controller class
StephenHodgson Apr 20, 2020
6b5c79b
fixed more type references
StephenHodgson Apr 20, 2020
5a6ae23
Merge branch 'feature/controller-mapping-refactor' of https://github.…
FejZa Apr 21, 2020
c013cb2
Merge branch 'development' into feature/controller-mapping-refactor
StephenHodgson Apr 23, 2020
a665d45
Merge branch 'development' into feature/controller-mapping-refactor
StephenHodgson Apr 24, 2020
9cc9b31
Merge branch 'feature/controller-mapping-refactor' into feature/hand-…
FejZa Apr 24, 2020
03bf169
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa Apr 27, 2020
ac9676c
Resolve merge issues
FejZa Apr 27, 2020
de697a6
Reset some unrelated file changes
FejZa Apr 27, 2020
1331ae7
Fix namespace
FejZa Apr 27, 2020
0a73eb4
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa Apr 28, 2020
b9848a5
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 1, 2020
3a97654
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 2, 2020
385bef3
Moved WMR hand data provider profile asset
FejZa May 2, 2020
79a005c
Fix WMR namespace compiler error
FejZa May 2, 2020
7e82446
Cleanup namespace
FejZa May 3, 2020
a99946a
Move default wmr data provider profile from SDK
FejZa May 3, 2020
fb39291
Update profile references
FejZa May 3, 2020
99ad70e
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 5, 2020
6697acf
Introduce hand rendering mode
FejZa May 10, 2020
f6443d7
Implement runtime rendering mode switch
FejZa May 10, 2020
396062d
Merge branch 'development' into feature/hand-input
StephenHodgson May 13, 2020
e974bc9
Merge branch 'development' into feature/hand-input
StephenHodgson May 13, 2020
3287ff6
Merge branch 'development' into feature/hand-input
StephenHodgson May 14, 2020
413b50b
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 18, 2020
e3384f8
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 18, 2020
c9f4c46
Update converter to define platform capabilities
FejZa May 22, 2020
4526673
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa May 22, 2020
b5eb70d
Update wmr to use post processor
FejZa May 26, 2020
1ede661
Fix build errors due to removal of base converter
FejZa May 26, 2020
345e86c
Rename joints
FejZa May 27, 2020
a904684
Point to new hand controller profiles
FejZa May 27, 2020
d44f826
Pass handedness to pose recognizer
FejZa May 29, 2020
82ae8d0
Merge branch 'development' into feature/hand-input
StephenHodgson Jun 2, 2020
81a2c2d
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa Jun 8, 2020
c769c6b
Merge branch 'development' into feature/hand-input
StephenHodgson Jun 12, 2020
c0245c4
Merge branch 'development' into feature/hand-input
StephenHodgson Jun 12, 2020
6fe7b0b
Fix build errors
FejZa Jun 14, 2020
c42e4d7
Merge branch 'development' into feature/hand-input
StephenHodgson Jun 17, 2020
f8c46f7
Update WMR converter to latest changes
FejZa Jun 21, 2020
90ca188
Update wmr hand data provider
FejZa Jul 15, 2020
976cbcd
Temp update WindowsApiChecker
FejZa Jul 15, 2020
304dd31
Fix joint-root offset calculation
FejZa Aug 3, 2020
fd04553
Merge branch 'development' into feature/hand-input
StephenHodgson Aug 29, 2020
364c89c
Merge branch 'development' of https://github.com/XRTK/WindowsMixedRea…
FejZa Sep 17, 2020
a9cc766
Finally fix freaking joint conversion
FejZa Sep 18, 2020
7fbd5eb
Cleanup code
FejZa Sep 18, 2020
e7ebf65
Commit new controller GUIDs
FejZa Sep 18, 2020
6f7e987
Implement pointer pose override for WMR platform
FejZa Sep 20, 2020
a248a3b
Remove DOTNETWINRT_PRESENT usage
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MonoBehaviour:
cameraClearFlagsOpaqueDisplay: 1
backgroundColorOpaqueDisplay: {r: 0, g: 0, b: 0, a: 1}
opaqueQualityLevel: 0
nearClipPlaneTransparentDisplay: 0.2
nearClipPlaneTransparentDisplay: 0.05
cameraClearFlagsTransparentDisplay: 2
backgroundColorTransparentDisplay: {r: 0, g: 0, b: 0, a: 0}
transparentQualityLevel: 0
Expand Down

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 @@ -11,7 +11,7 @@ MonoBehaviour:
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe9eeb08f95b1c1419ad17953d9a48ee, type: 3}
m_Name: WindowsMixedRealityControllerDataProviderProfile
m_EditorClassIdentifier:
m_EditorClassIdentifier:
hasSetupDefaults: 1
controllerMappingProfiles:
- {fileID: 11400000, guid: aaa9b82b55ce7834bb43c9d726ff893e, type: 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
hasSetupDefaults: 1
controllerMappingProfiles:
- {fileID: 11400000, guid: b43ff1b6f37e65946b1abc7e50af105f, type: 2}
- {fileID: 11400000, guid: 6c775257f26873e459a492f28125e129, type: 2}
handMeshingEnabled: 0
- {fileID: 11400000, guid: dd499836e4b82f14da2f414aad1fed8b, type: 2}
- {fileID: 11400000, guid: 78bf44d2b6970a74ea2721883b0b22bc, type: 2}
renderingMode: 1
handPhysicsEnabled: 0
useTriggers: 0
boundsMode: 0
trackedPoses: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if WINDOWS_UWP

using System;
using Windows.Perception.People;
using XRTK.Definitions.Controllers.Hands;

Expand All @@ -18,36 +19,36 @@ public static TrackedHandJoint ToTrackedHandJoint(this HandJointKind handJointKi

case HandJointKind.Wrist: return TrackedHandJoint.Wrist;

case HandJointKind.ThumbMetacarpal: return TrackedHandJoint.ThumbMetacarpalJoint;
case HandJointKind.ThumbProximal: return TrackedHandJoint.ThumbProximalJoint;
case HandJointKind.ThumbDistal: return TrackedHandJoint.ThumbDistalJoint;
case HandJointKind.ThumbMetacarpal: return TrackedHandJoint.ThumbMetacarpal;
case HandJointKind.ThumbProximal: return TrackedHandJoint.ThumbProximal;
case HandJointKind.ThumbDistal: return TrackedHandJoint.ThumbDistal;
case HandJointKind.ThumbTip: return TrackedHandJoint.ThumbTip;

case HandJointKind.IndexMetacarpal: return TrackedHandJoint.IndexMetacarpal;
case HandJointKind.IndexProximal: return TrackedHandJoint.IndexKnuckle;
case HandJointKind.IndexIntermediate: return TrackedHandJoint.IndexMiddleJoint;
case HandJointKind.IndexDistal: return TrackedHandJoint.IndexDistalJoint;
case HandJointKind.IndexProximal: return TrackedHandJoint.IndexProximal;
case HandJointKind.IndexIntermediate: return TrackedHandJoint.IndexIntermediate;
case HandJointKind.IndexDistal: return TrackedHandJoint.IndexDistal;
case HandJointKind.IndexTip: return TrackedHandJoint.IndexTip;

case HandJointKind.MiddleMetacarpal: return TrackedHandJoint.MiddleMetacarpal;
case HandJointKind.MiddleProximal: return TrackedHandJoint.MiddleKnuckle;
case HandJointKind.MiddleIntermediate: return TrackedHandJoint.MiddleMiddleJoint;
case HandJointKind.MiddleDistal: return TrackedHandJoint.MiddleDistalJoint;
case HandJointKind.MiddleProximal: return TrackedHandJoint.MiddleProximal;
case HandJointKind.MiddleIntermediate: return TrackedHandJoint.MiddleIntermediate;
case HandJointKind.MiddleDistal: return TrackedHandJoint.MiddleDistal;
case HandJointKind.MiddleTip: return TrackedHandJoint.MiddleTip;

case HandJointKind.RingMetacarpal: return TrackedHandJoint.RingMetacarpal;
case HandJointKind.RingProximal: return TrackedHandJoint.RingKnuckle;
case HandJointKind.RingIntermediate: return TrackedHandJoint.RingMiddleJoint;
case HandJointKind.RingDistal: return TrackedHandJoint.RingDistalJoint;
case HandJointKind.RingProximal: return TrackedHandJoint.RingProximal;
case HandJointKind.RingIntermediate: return TrackedHandJoint.RingIntermediate;
case HandJointKind.RingDistal: return TrackedHandJoint.RingDistal;
case HandJointKind.RingTip: return TrackedHandJoint.RingTip;

case HandJointKind.LittleMetacarpal: return TrackedHandJoint.PinkyMetacarpal;
case HandJointKind.LittleProximal: return TrackedHandJoint.PinkyKnuckle;
case HandJointKind.LittleIntermediate: return TrackedHandJoint.PinkyMiddleJoint;
case HandJointKind.LittleDistal: return TrackedHandJoint.PinkyDistalJoint;
case HandJointKind.LittleTip: return TrackedHandJoint.PinkyTip;
case HandJointKind.LittleMetacarpal: return TrackedHandJoint.LittleMetacarpal;
case HandJointKind.LittleProximal: return TrackedHandJoint.LittleProximal;
case HandJointKind.LittleIntermediate: return TrackedHandJoint.LittleIntermediate;
case HandJointKind.LittleDistal: return TrackedHandJoint.LittleDistal;
case HandJointKind.LittleTip: return TrackedHandJoint.LittleTip;

default: return TrackedHandJoint.None;
default: throw new ArgumentOutOfRangeException($"{typeof(HandJointKind).Name}.{handJointKind} could not be mapped to {typeof(TrackedHandJoint).Name}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ public static void StartHaptics(this InteractionSource interactionSource, float

public static void StartHaptics(this InteractionSource interactionSource, float intensity, float durationInSeconds)
{
if (!WindowsApiChecker.UniversalApiContractV4_IsAvailable && !Application.isEditor)
// GetForCurrentView and GetDetectedSourcesAtTimestamp were both introduced in the same Windows version.
// We need only check for one of them.
if ((!WindowsApiChecker.IsMethodAvailable(
"Windows.UI.Input.Spatial",
"SpatialInteractionManager",
"GetForCurrentView") ||
!WindowsApiChecker.IsTypeAvailable("Windows.Devices.Haptics", "SimpleHapticsController")) && !Application.isEditor)
{
return;
}
Expand Down Expand Up @@ -82,7 +88,13 @@ public static void StartHaptics(this InteractionSource interactionSource, float

public static void StopHaptics(this InteractionSource interactionSource)
{
if (!WindowsApiChecker.UniversalApiContractV4_IsAvailable && !Application.isEditor)
// GetForCurrentView and GetDetectedSourcesAtTimestamp were both introduced in the same Windows version.
// We need only check for one of them.
if ((!WindowsApiChecker.IsMethodAvailable(
"Windows.UI.Input.Spatial",
"SpatialInteractionManager",
"GetForCurrentView") ||
!WindowsApiChecker.IsTypeAvailable("Windows.Devices.Haptics", "SimpleHapticsController")) && !Application.isEditor)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,24 @@ private WindowsMixedRealityMotionController GetController(InteractionSource inte
private static async void TryRenderControllerModel(InteractionSource interactionSource, WindowsMixedRealityMotionController controller)
{
#if WINDOWS_UWP
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { return; }
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque)
{
return;
}

IRandomAccessStreamWithContentType stream = null;

if (!WindowsApiChecker.UniversalApiContractV5_IsAvailable) { return; }
if (!WindowsApiChecker.IsMethodAvailable(
"Windows.UI.Input.Spatial",
"SpatialInteractionManager",
"GetForCurrentView") ||
!WindowsApiChecker.IsMethodAvailable(
"Windows.UI.Input.Spatial",
"SpatialInteractionController",
"TryGetRenderableModelAsync"))
{
return;
}

await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, DispatchedHandler);

Expand Down
Loading