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

Hand Tracking change requests #476

Merged
merged 5 commits into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 d184b0 to 76d76a
2 changes: 1 addition & 1 deletion Submodules/Oculus
2 changes: 1 addition & 1 deletion Submodules/SDK
Submodule SDK updated from 6add89 to 91d427
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
8 changes: 8 additions & 0 deletions XRTK-Core/Assets/App.meta

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 @@ -4,7 +4,7 @@
namespace XRTK.Definitions.Controllers
{
/// <summary>
/// Provides additional information about the controller data provider other than the input mapping.
/// Provides additional configuration options for controller data providers.
/// </summary>
public abstract class BaseMixedRealityControllerDataProviderProfile : BaseMixedRealityProfile
{
Expand Down
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
Copy link
Contributor

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.

{
[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
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using UnityEngine;
using XRTK.Attributes;
using XRTK.Definitions.InputSystem;
using XRTK.Definitions.Utilities;
using XRTK.Interfaces.Providers.Controllers.Simulation;

Expand Down Expand Up @@ -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>
Expand All @@ -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;

Expand All @@ -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")]
Expand Down Expand Up @@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are registered in the ControllerDataProviderProfile with the rest of the controllers

}
}
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Up @@ -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
Expand Down Expand Up @@ -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.")]
Copy link
Contributor

Choose a reason for hiding this comment

The 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void OnInspectorGUI()
{
MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

thisProfile.CheckProfileLock();
ThisProfile.CheckProfileLock();

serializedObject.Update();

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

using UnityEditor;
using UnityEngine;
using XRTK.Definitions.InputSystem;
using XRTK.Inspectors.Utilities;
using XRTK.Definitions.Controllers.Hands;

namespace XRTK.Inspectors.Profiles.InputSystem
{
[CustomEditor(typeof(MixedRealityHandTrackingProfile))]
public class MixedRealityHandTrackingProfileInspector : BaseMixedRealityProfileInspector
[CustomEditor(typeof(BaseMixedRealityHandDataProviderProfile))]
public class BaseMixedRealityHandDataProviderProfileInspector : BaseMixedRealityProfileInspector
{
private SerializedProperty handMeshingEnabled;
private SerializedProperty handRayType;
Expand All @@ -30,15 +28,6 @@ protected override void OnEnable()

public override void OnInspectorGUI()
{
MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

if (thisProfile.ParentProfile != null &&
GUILayout.Button("Back To Input System Profile"))
{
Selection.activeObject = thisProfile.ParentProfile;
}

thisProfile.CheckProfileLock();
serializedObject.Update();

EditorGUILayout.BeginVertical();
Expand Down
Loading