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

Commit

Permalink
Implement grip threshold profile setting (#117)
Browse files Browse the repository at this point in the history
* Implement hand grip threshold

* Update core dependency

* Fix uplicate using

* Update license and bump core dependency and version

* Fix package version to increase only by one patch step

* updated package lock

Co-authored-by: Stephen Hodgson <hodgson.designs@gmail.com>
  • Loading branch information
FejZa and StephenHodgson committed Jan 26, 2021
1 parent 78dcfc6 commit 4975e57
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2019 Microsoft Corporation
Copyright (c) 2020 XRTK
Copyright (c) 2021 XRTK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MonoBehaviour:
controllerMappingProfiles:
- {fileID: 11400000, guid: f296956538cc1d146bc7a7ebab8505b9, type: 2}
- {fileID: 11400000, guid: 3f8ea7a404a0ae14fa71a41b2ed725e3, type: 2}
gripThreshold: 0.8
renderingMode: 1
handPhysicsEnabled: 0
useTriggers: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using XRTK.Services;
using XRTK.Attributes;
using XRTK.Definitions.Platforms;
using XRTK.Interfaces.InputSystem;
Expand All @@ -17,7 +18,6 @@
using Windows.Perception;
using Windows.UI.Input.Spatial;
using XRTK.Definitions.Devices;
using XRTK.Services;
using XRTK.WindowsMixedReality.Extensions;
using XRTK.Definitions.Controllers.Hands;
using XRTK.Definitions.Utilities;
Expand All @@ -40,7 +40,13 @@ public WindowsMixedRealityHandControllerDataProvider(string name, uint priority,
: base(name, priority, profile, parentService)
{
handDataProvider = new WindowsMixedRealityHandDataConverter();
postProcessor = new HandDataPostProcessor(TrackedPoses)

var globalSettingsProfile = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
var isGrippingThreshold = profile.GripThreshold != globalSettingsProfile.GripThreshold
? profile.GripThreshold
: globalSettingsProfile.GripThreshold;

postProcessor = new HandDataPostProcessor(TrackedPoses, isGrippingThreshold)
{
PlatformProvidesPointerPose = true
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"mixed",
"reality"
],
"version": "0.2.1",
"version": "0.2.2",
"unity": "2019.4",
"license": "MIT",
"author": "XRTK Team (https://github.com/XRTK)",
"dependencies": {
"com.xrtk.core": "0.2.1",
"com.xrtk.core": "0.2.3",
"com.unity.xr.windowsmr.metro": "4.2.3"
},
"profiles": [
Expand Down

0 comments on commit 4975e57

Please sign in to comment.