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 173eef1 commit 2257ab5
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 31 deletions.
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

This file was deleted.

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
6 changes: 3 additions & 3 deletions azure_pipelines/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ parameters:
windows:
image: windows-latest
# TODO: Only use XRTK defined platforms for build and install the correct components and switch to the correct targets as needed
components: '"Windows", "Windows_IL2CPP"'
components: '"Windows", "UWP_IL2CPP"'
# https://github.com/microsoft/unitysetup.powershell installer component options
# Windows, Windows_IL2CPP, UWP_IL2CPP, Lumin, Android, iOS, Mac, Mac_IL2CPP , WebGL
targets:
- StandaloneWindows64
- WSAPlayer
# Unity -buildTarget command line args https://docs.unity3d.com/Manual/CommandLineArguments.html
# 'StandaloneOSX', 'StandaloneWindows', 'iOS', 'Android', 'StandaloneLinux', 'StandaloneWindows64', 'WebGL',
# 'WSAPlayer', 'StandaloneLinux64', 'StandaloneLinuxUniversal', 'Tizen', 'PSP2', 'PS4', 'XBoxOne', 'N3DS', 'WiiU', 'tvOS', 'Switch', 'Lumin'
macOS:
image: macOS-latest
components: '"Mac", "Mac_IL2CPP"'
components: '"Mac"'
targets:
- StandaloneOSX
linux:
Expand Down

0 comments on commit 2257ab5

Please sign in to comment.