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

Commit

Permalink
Fixed build targets (#85)
Browse files Browse the repository at this point in the history
* Fixed build targets

* Fixed controller namespaces

* removed some logs
  • Loading branch information
StephenHodgson authored Jun 2, 2020
1 parent 19bc71b commit ea149ba
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Runtime/Extensions/SpatialInteractionSourceKindExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using Windows.UI.Input.Spatial;
using XRTK.Providers.Controllers.Hands;
using XRTK.WindowsMixedReality.Controllers;
using XRTK.WindowsMixedReality.Providers.Controllers;

namespace XRTK.WindowsMixedReality.Extensions
{
Expand All @@ -32,4 +32,4 @@ public static Type ToControllerType(this SpatialInteractionSourceKind spatialInt

}
}
#endif // WINDOWS_UWP
#endif // WINDOWS_UWP
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using XRTK.Definitions.InputSystem;
using XRTK.Definitions.Utilities;
using XRTK.Definitions.Controllers;
using XRTK.WindowsMixedReality.Providers.InputSystem.Controllers;
using XRTK.WindowsMixedReality.Providers.Controllers;

namespace XRTK.WindowsMixedReality.Profiles
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using XRTK.Utilities;
#endif // WINDOWS_UWP

namespace XRTK.WindowsMixedReality.Providers.InputSystem.Controllers
namespace XRTK.WindowsMixedReality.Providers.Controllers
{
/// <summary>
/// The device manager for Windows Mixed Reality controllers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#endif // WINDOWS_UWP

namespace XRTK.WindowsMixedReality.Providers.InputSystem.Controllers
namespace XRTK.WindowsMixedReality.Providers.Controllers
{
/// <summary>
/// The Windows Mixed Reality Data Provider for hand controller support.
Expand Down Expand Up @@ -101,7 +101,7 @@ public override void Update()
{
isLeftHandTracked = true;

if (TryGetController(spatialInteractionSource.Handedness.ToHandedness(), out MixedRealityHandController leftHandController))
if (TryGetController(spatialInteractionSource.Handedness.ToHandedness(), out var leftHandController))
{
leftHandController.UpdateController(handDataConverter.GetHandData(sourceState));
}
Expand All @@ -116,7 +116,7 @@ public override void Update()
{
isRightHandTracked = true;

if (TryGetController(spatialInteractionSource.Handedness.ToHandedness(), out MixedRealityHandController rightHandController))
if (TryGetController(spatialInteractionSource.Handedness.ToHandedness(), out var rightHandController))
{
rightHandController.UpdateController(handDataConverter.GetHandData(sourceState));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using XRTK.Services;
#endif

namespace XRTK.WindowsMixedReality.Providers.InputSystem.Controllers
namespace XRTK.WindowsMixedReality.Providers.Controllers
{
/// <summary>
/// A Windows Mixed Reality Controller Instance.
Expand Down Expand Up @@ -305,11 +305,9 @@ private void UpdateTriggerData(InteractionSourceState interactionSourceState, Mi
{
case DeviceInputType.TriggerPress:
interactionMapping.BoolData = interactionSourceState.grasped;
Debug.Log($"{interactionMapping.Description}:{interactionMapping.BoolData}:{interactionMapping.MixedRealityInputAction.Description}:{interactionSourceState.grasped}");
break;
case DeviceInputType.Select:
bool selectPressed = interactionSourceState.selectPressed;
Debug.Log($"{interactionMapping.Description}:{interactionMapping.BoolData}:{interactionMapping.MixedRealityInputAction.Description}:{interactionSourceState.selectPressed}");

// BEGIN WORKAROUND: Unity issue #1033526
// See https://issuetracker.unity3d.com/issues/hololens-interactionsourcestate-dot-selectpressed-is-false-when-air-tap-and-hold
Expand Down
8 changes: 0 additions & 8 deletions Runtime/Providers/InputSystem.meta

This file was deleted.

18 changes: 8 additions & 10 deletions Runtime/Utilities/WindowsMixedRealityHandDataConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,25 @@ public HandData GetHandData(SpatialInteractionSourceState spatialInteractionSour
// Accessing the hand mesh data involves copying quite a bit of data, so only do it if application requests it.
if (HandMeshingEnabled)
{
if (!handMeshObservers.ContainsKey(spatialInteractionSourceState.Source.Handedness) && !HasRequestedHandMeshObserver(spatialInteractionSourceState.Source.Handedness))
if (!handMeshObservers.ContainsKey(spatialInteractionSourceState.Source.Handedness) &&
!HasRequestedHandMeshObserver(spatialInteractionSourceState.Source.Handedness))
{
SetHandMeshObserver(spatialInteractionSourceState);
}

if (handMeshObservers.TryGetValue(spatialInteractionSourceState.Source.Handedness, out var handMeshObserver) && handMeshTriangleIndices == null)
{
uint indexCount = handMeshObserver.TriangleIndexCount;
ushort[] indices = new ushort[indexCount];
var indexCount = handMeshObserver.TriangleIndexCount;
var indices = new ushort[indexCount];
handMeshObserver.GetTriangleIndices(indices);
handMeshTriangleIndices = new int[indexCount];
Array.Copy(indices, handMeshTriangleIndices, (int)handMeshObserver.TriangleIndexCount);

// Compute neutral pose
Vector3[] neutralPoseVertices = new Vector3[handMeshObserver.VertexCount];
HandPose neutralPose = handMeshObserver.NeutralPose;
var neutralPoseVertices = new Vector3[handMeshObserver.VertexCount];
var neutralPose = handMeshObserver.NeutralPose;
var vertexAndNormals = new HandMeshVertex[handMeshObserver.VertexCount];
HandMeshVertexState handMeshVertexState = handMeshObserver.GetVertexStateForPose(neutralPose);
var handMeshVertexState = handMeshObserver.GetVertexStateForPose(neutralPose);
handMeshVertexState.GetVertices(vertexAndNormals);

for (int i = 0; i < handMeshObserver.VertexCount; i++)
Expand All @@ -122,10 +123,7 @@ public HandData GetHandData(SpatialInteractionSourceState spatialInteractionSour
var meshTransform = handMeshVertexState.CoordinateSystem.TryGetTransformTo(WindowsMixedRealityUtilities.SpatialCoordinateSystem);
if (meshTransform.HasValue)
{
System.Numerics.Vector3 scale;
System.Numerics.Quaternion rotation;
System.Numerics.Vector3 translation;
System.Numerics.Matrix4x4.Decompose(meshTransform.Value, out scale, out rotation, out translation);
System.Numerics.Matrix4x4.Decompose(meshTransform.Value, out var scale, out var rotation, out var translation);

var handMeshVertices = new Vector3[handMeshObserver.VertexCount];
var handMeshNormals = new Vector3[handMeshObserver.VertexCount];
Expand Down

0 comments on commit ea149ba

Please sign in to comment.