-
-
Notifications
You must be signed in to change notification settings - Fork 34
Hand Tracking change requests #476
Changes from all commits
dea7abd
2a7e9cb
58726c9
9d23764
40d0ff9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) XRTK. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEngine; | ||
using XRTK.Attributes; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Interfaces.InputSystem.Controllers.Hands; | ||
using XRTK.Providers.Controllers.Hands; | ||
|
||
namespace XRTK.Definitions.Controllers.Hands | ||
{ | ||
/// <summary> | ||
/// Provides additional configuration options for hand controller data providers. | ||
/// </summary> | ||
public abstract class BaseMixedRealityHandDataProviderProfile : BaseMixedRealityControllerDataProviderProfile | ||
{ | ||
[Header("General Settings")] | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hand mesh data will be read and available for visualization. Disable for optimized performance.")] | ||
private bool handMeshingEnabled = false; | ||
|
||
/// <summary> | ||
/// If set, hand mesh data will be read and available for visualization. Disable for optimized performance. | ||
/// </summary> | ||
public bool HandMeshingEnabled => handMeshingEnabled; | ||
|
||
[SerializeField] | ||
[Tooltip("The hand ray concrete type to use when raycasting for hand interaction.")] | ||
[Implements(typeof(IMixedRealityHandRay), TypeGrouping.ByNamespaceFlat)] | ||
private SystemType handRayType = null; | ||
|
||
/// <summary> | ||
/// The hand ray concrete type to use when raycasting for hand interaction. | ||
/// </summary> | ||
public SystemType HandRayType => handRayType; | ||
|
||
[Header("Hand Physics")] | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system.")] | ||
private bool handPhysicsEnabled = false; | ||
|
||
/// <summary> | ||
/// If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system. | ||
/// </summary> | ||
public bool HandPhysicsEnabled => handPhysicsEnabled; | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hand colliders will be setup as triggers.")] | ||
private bool useTriggers = false; | ||
|
||
/// <summary> | ||
/// If set, hand colliders will be setup as triggers. | ||
/// </summary> | ||
public bool UseTriggers => useTriggers; | ||
|
||
[SerializeField] | ||
[Tooltip("Set the bounds mode to use for calculating hand bounds.")] | ||
private HandBoundsMode boundsMode = HandBoundsMode.Hand; | ||
|
||
/// <summary> | ||
/// Set the bounds mode to use for calculating hand bounds. | ||
/// </summary> | ||
public HandBoundsMode BoundsMode => boundsMode; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
namespace XRTK.Definitions.Controllers.Simulation.Hands | ||
{ | ||
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Data Providers/Simulated Hand Controller Data Provider Profile", fileName = "SimulatedHandControllerDataProviderProfile", order = (int)CreateProfileMenuItemIndices.Input)] | ||
public class SimulatedHandControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile | ||
public class SimulatedHandControllerDataProviderProfile : SimulatedControllerDataProviderProfile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for a specific rather than generic base? Concerned this separates this from the standard implementation |
||
{ | ||
[SerializeField] | ||
[Tooltip("Hand pose definitions.")] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
using UnityEngine; | ||
using XRTK.Attributes; | ||
using XRTK.Definitions.InputSystem; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Interfaces.Providers.Controllers.Simulation; | ||
|
||
|
@@ -31,7 +30,7 @@ public class SimulatedControllerDataProviderProfile : BaseMixedRealityController | |
private double simulatedUpdateFrequency = 0; | ||
|
||
/// <summary> | ||
/// The simulated update frequency in milliseconds mimicks the hardware's ability to | ||
/// The simulated update frequency in milliseconds mimics the hardware's ability to | ||
/// update controller tracking data. A value of 0ms will provide data | ||
/// updates every frame. | ||
/// </summary> | ||
|
@@ -42,7 +41,7 @@ public class SimulatedControllerDataProviderProfile : BaseMixedRealityController | |
private float controllerHideTimeout = 0.2f; | ||
|
||
/// <summary> | ||
/// ime after which uncontrolled controllers are hidden | ||
/// Time after which uncontrolled controllers are hidden | ||
/// </summary> | ||
public float ControllerHideTimeout => controllerHideTimeout; | ||
|
||
|
@@ -68,7 +67,7 @@ public class SimulatedControllerDataProviderProfile : BaseMixedRealityController | |
/// <summary> | ||
/// Depth change when scrolling the mouse wheel. | ||
/// </summary> | ||
public float HandDepthMultiplier => depthMultiplier; | ||
public float DepthMultiplier => depthMultiplier; | ||
|
||
[SerializeField] | ||
[Tooltip("Apply random offset to the controller position")] | ||
|
@@ -131,13 +130,5 @@ public class SimulatedControllerDataProviderProfile : BaseMixedRealityController | |
public float RotationSpeed => rotationSpeed; | ||
|
||
#endregion | ||
|
||
[SerializeField] | ||
private ControllerDataProviderConfiguration[] registeredControllerDataProviders = new ControllerDataProviderConfiguration[0]; | ||
|
||
/// <summary> | ||
/// The currently registered controller data providers for simulation. | ||
/// </summary> | ||
public ControllerDataProviderConfiguration[] RegisteredControllerDataProviders => registeredControllerDataProviders; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are registered in the |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,68 @@ | ||
// Copyright (c) XRTK. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
//// Copyright (c) XRTK. All rights reserved. | ||
//// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEngine; | ||
using XRTK.Attributes; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Interfaces.InputSystem.Controllers.Hands; | ||
using XRTK.Providers.Controllers.Hands; | ||
//using UnityEngine; | ||
//using XRTK.Attributes; | ||
//using XRTK.Definitions.Utilities; | ||
//using XRTK.Interfaces.InputSystem.Controllers.Hands; | ||
//using XRTK.Providers.Controllers.Hands; | ||
|
||
namespace XRTK.Definitions.InputSystem | ||
{ | ||
/// <summary> | ||
/// Configuration profile settings for setting up and consuming gesture based input actions. | ||
/// </summary> | ||
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Hand Tracking Profile", fileName = "MixedRealityHandTrackingProfile", order = (int)CreateProfileMenuItemIndices.HandTracking)] | ||
public class MixedRealityHandTrackingProfile : BaseMixedRealityProfile | ||
{ | ||
[Header("General Settings")] | ||
//namespace XRTK.Definitions.InputSystem | ||
//{ | ||
// /// <summary> | ||
// /// Configuration profile settings for setting up and consuming gesture based input actions. | ||
// /// </summary> | ||
// [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Hand Tracking Profile", fileName = "MixedRealityHandTrackingProfile", order = (int)CreateProfileMenuItemIndices.HandTracking)] | ||
// public class MixedRealityHandTrackingProfile : BaseMixedRealityProfile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my comment above about this change. Also this seems only commented out, I'd rather have code removed that's not needed anymore. |
||
// { | ||
// [Header("General Settings")] | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hand mesh data will be read and available for visualzation. Disable for optimized performance.")] | ||
private bool handMeshingEnabled = false; | ||
/// <summary> | ||
/// If set, hand mesh data will be read and available for visualzation. Disable for optimized performance. | ||
/// </summary> | ||
public bool HandMeshingEnabled => handMeshingEnabled; | ||
// [SerializeField] | ||
// [Tooltip("If set, hand mesh data will be read and available for visualization. Disable for optimized performance.")] | ||
// private bool handMeshingEnabled = false; | ||
|
||
[SerializeField] | ||
[Tooltip("The hand ray concrete type to use when raycasting for hand interaction.")] | ||
[Implements(typeof(IMixedRealityHandRay), TypeGrouping.ByNamespaceFlat)] | ||
private SystemType handRayType; | ||
// /// <summary> | ||
// /// If set, hand mesh data will be read and available for visualization. Disable for optimized performance. | ||
// /// </summary> | ||
// public bool HandMeshingEnabled => handMeshingEnabled; | ||
|
||
/// <summary> | ||
/// The hand ray concrete type to use when raycasting for hand interaction. | ||
/// </summary> | ||
public SystemType HandRayType => handRayType; | ||
// [SerializeField] | ||
// [Tooltip("The hand ray concrete type to use when raycasting for hand interaction.")] | ||
// [Implements(typeof(IMixedRealityHandRay), TypeGrouping.ByNamespaceFlat)] | ||
// private SystemType handRayType = null; | ||
|
||
[Header("Hand Physics")] | ||
// /// <summary> | ||
// /// The hand ray concrete type to use when raycasting for hand interaction. | ||
// /// </summary> | ||
// public SystemType HandRayType => handRayType; | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system.")] | ||
private bool handPhysicsEnabled = false; | ||
/// <summary> | ||
/// If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system. | ||
/// </summary> | ||
public bool HandPhysicsEnabled => handPhysicsEnabled; | ||
// [Header("Hand Physics")] | ||
|
||
[SerializeField] | ||
[Tooltip("If set, hand colliders will be setup as triggers.")] | ||
private bool useTriggers = false; | ||
/// <summary> | ||
/// If set, hand colliders will be setup as triggers. | ||
/// </summary> | ||
public bool UseTriggers => useTriggers; | ||
// [SerializeField] | ||
// [Tooltip("If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system.")] | ||
// private bool handPhysicsEnabled = false; | ||
|
||
[SerializeField] | ||
[Tooltip("Set the bounds mode to use for calculating hand bounds.")] | ||
private HandBoundsMode boundsMode = HandBoundsMode.Hand; | ||
/// <summary> | ||
/// Set the bounds mode to use for calculating hand bounds. | ||
/// </summary> | ||
public HandBoundsMode BoundsMode => boundsMode; | ||
} | ||
} | ||
// /// <summary> | ||
// /// If set, hands will be setup with colliders and a rigidbody to work with Unity's physics system. | ||
// /// </summary> | ||
// public bool HandPhysicsEnabled => handPhysicsEnabled; | ||
|
||
// [SerializeField] | ||
// [Tooltip("If set, hand colliders will be setup as triggers.")] | ||
// private bool useTriggers = false; | ||
|
||
// /// <summary> | ||
// /// If set, hand colliders will be setup as triggers. | ||
// /// </summary> | ||
// public bool UseTriggers => useTriggers; | ||
|
||
// [SerializeField] | ||
// [Tooltip("Set the bounds mode to use for calculating hand bounds.")] | ||
// private HandBoundsMode boundsMode = HandBoundsMode.Hand; | ||
|
||
// /// <summary> | ||
// /// Set the bounds mode to use for calculating hand bounds. | ||
// /// </summary> | ||
// public HandBoundsMode BoundsMode => boundsMode; | ||
// } | ||
//} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ | |
|
||
using UnityEngine; | ||
using XRTK.Attributes; | ||
using XRTK.Definitions.Controllers; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Interfaces.InputSystem; | ||
using XRTK.Interfaces.Providers.Controllers; | ||
using XRTK.Definitions.Controllers; | ||
using XRTK.Services; | ||
|
||
namespace XRTK.Definitions.InputSystem | ||
|
@@ -144,18 +144,18 @@ public MixedRealityControllerVisualizationProfile ControllerVisualizationProfile | |
internal set => controllerVisualizationProfile = value; | ||
} | ||
|
||
[SerializeField] | ||
[Tooltip("Profile for platform agnostic hand tracking configuration.")] | ||
private MixedRealityHandTrackingProfile handTrackingProfile; | ||
|
||
/// <summary> | ||
/// Profile for platform agnostic hand tracking configuration. | ||
/// </summary> | ||
public MixedRealityHandTrackingProfile HandTrackingProfile | ||
{ | ||
get => handTrackingProfile; | ||
internal set => handTrackingProfile = value; | ||
} | ||
//[SerializeField] | ||
//[Tooltip("Profile for platform agnostic hand tracking configuration.")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again see comment from above. |
||
//private MixedRealityHandTrackingProfile handTrackingProfile; | ||
|
||
///// <summary> | ||
///// Profile for platform agnostic hand tracking configuration. | ||
///// </summary> | ||
//public MixedRealityHandTrackingProfile HandTrackingProfile | ||
//{ | ||
// get => handTrackingProfile; | ||
// internal set => handTrackingProfile = value; | ||
//} | ||
|
||
private IMixedRealityFocusProvider focusProvider; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is LITERALLY what I had a while ago when discussion started and it was suggested to add a
HandTrackingProfile
to the input system profile to instead. I even provided screenshots and everything to make 100% sure that's what' asked for. Basically you are here just reversing those changes I did after being asked to do them here and restoring the state I had before that.