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

Commit

Permalink
Change requests/cleanup definitions (#497)
Browse files Browse the repository at this point in the history
* updated simulated hand controller pose type from class to struct

removed allocators each frame when lerping between two poses
misc formatting

* updated sdk checkout

* asset organization

* updated wmr checkout

* updated lumin commit

* Moved stopwatch utility
  • Loading branch information
StephenHodgson authored Apr 4, 2020
1 parent 0cd4f5f commit 663f423
Show file tree
Hide file tree
Showing 39 changed files with 230 additions and 214 deletions.
2 changes: 1 addition & 1 deletion Submodules/Lumin
Submodule Lumin updated from 06e583 to 886407
2 changes: 1 addition & 1 deletion Submodules/Oculus
2 changes: 1 addition & 1 deletion Submodules/SDK
Submodule SDK updated from 934642 to 891614
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace XRTK.Providers.Controllers.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// Available hand bounds modes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

using System;
using XRTK.Definitions.Utilities;
using XRTK.Providers.Controllers.Hands;

namespace XRTK.Providers.Controllers.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// Snapshot of hand data.
Expand All @@ -13,7 +14,12 @@ namespace XRTK.Providers.Controllers.Hands
public class HandData
{
/// <summary>
/// Timestamp of hand data, as FileTime, e.g. DateTime.UtcNow.ToFileTime().
/// Gets the total count of joints the hand data supports.
/// </summary>
public static readonly int JointCount = Enum.GetNames(typeof(TrackedHandJoint)).Length;

/// <summary>
/// Timestamp of hand data, as FileTime, e.g. <see cref="DateTime.UtcNow"/>
/// </summary>
public long TimeStamp { get; set; } = 0;

Expand All @@ -25,7 +31,7 @@ public class HandData
/// <summary>
/// Pose information for each hand joint.
/// </summary>
public MixedRealityPose[] Joints { get; } = new MixedRealityPose[BaseHandController.JointCount];
public MixedRealityPose[] Joints { get; } = new MixedRealityPose[JointCount];

/// <summary>
/// Mesh information of the hand.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
using UnityEngine;
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace XRTK.Providers.Controllers.Hands
using UnityEngine;

namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// Snapshot of hand mesh information.
/// </summary>
public class HandMeshData
public struct HandMeshData
{
/// <summary>
/// Constructs a new empty hand mesh data snapshot.
/// </summary>
public HandMeshData() { }

/// <summary>
/// Constructs a new hand mesh data snapshot.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using XRTK.Definitions.Utilities;
using XRTK.Providers.Controllers.Hands;

namespace XRTK.Providers.Controllers.Simulation.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// Unity's <see cref="JsonUtility"/> "currently" (stated in 2011) does not support top-level arrays.
/// But hey, it's on their "future" roadmap. That's why we need a wrapper definition around or items.
/// But hey, it's on their "future" road-map. That's why we need a wrapper definition around or items.
/// </summary>
/// <remarks>The <see cref="JsonUtility"/> also does not support properties, so we gotta use fields. Oh and it also
/// does not support auto mapping of JSON naming "items" to C# naming "Items".</remarks>
Expand All @@ -36,11 +36,11 @@ public struct RecordedHandJoint
/// <param name="pose"></param>
public RecordedHandJoint(TrackedHandJoint joint, MixedRealityPose pose)
{
this.joint = jointNames[(int)joint];
this.joint = JointNames[(int)joint];
this.pose = pose;
}

private static readonly string[] jointNames = Enum.GetNames(typeof(TrackedHandJoint));
private static readonly string[] JointNames = Enum.GetNames(typeof(TrackedHandJoint));

/// <summary>
/// Name of the joint recorded. Rather use <see cref="JointIndex"/> below for convenience.
Expand All @@ -59,15 +59,17 @@ public TrackedHandJoint JointIndex
{
get
{
int nameIndex = Array.FindIndex(jointNames, IsJointName);
int nameIndex = Array.FindIndex(JointNames, IsJointName);

if (nameIndex < 0)
{
Debug.LogError($"Joint name {joint} not in TrackedHandJoint enum");
Debug.LogError($"Joint name {joint} not in {nameof(TrackedHandJoint)} enum");
return TrackedHandJoint.None;
}

return (TrackedHandJoint)nameIndex;
}
set { joint = jointNames[(int)value]; }
set => joint = JointNames[(int)value];
}

private bool IsJointName(string s)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace XRTK.Providers.Controllers.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// Available hand bounds types.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace XRTK.Providers.Controllers.Hands
namespace XRTK.Definitions.Controllers.Hands
{
/// <summary>
/// The supported tracked hand joints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using System.Collections.Generic;
using UnityEngine;
using XRTK.Definitions.Controllers.Hands;
using XRTK.Definitions.Utilities;
using XRTK.Providers.Controllers.Hands;

namespace XRTK.Definitions.Controllers.Simulation.Hands
{
Expand Down
Loading

0 comments on commit 663f423

Please sign in to comment.