diff --git a/org.mixedrealitytoolkit.core/Interactables/MRTKBaseInteractable.cs b/org.mixedrealitytoolkit.core/Interactables/MRTKBaseInteractable.cs index 4a437a091..73cacb613 100644 --- a/org.mixedrealitytoolkit.core/Interactables/MRTKBaseInteractable.cs +++ b/org.mixedrealitytoolkit.core/Interactables/MRTKBaseInteractable.cs @@ -17,7 +17,7 @@ public class MRTKBaseInteractable : XRBaseInteractable { #region Gaze - readonly List hoveringGazeInteractors = new List(); + private readonly List hoveringGazeInteractors = new List(); /// /// (Read Only) The list of components currently gazing this object. @@ -28,14 +28,14 @@ public class MRTKBaseInteractable : XRBaseInteractable #region GazePinch - readonly List hoveringGazePinchInteractors = new List(); + private readonly List hoveringGazePinchInteractors = new List(); /// /// (Read Only) The list of components currently hovering this object. /// public List HoveringGazePinchInteractors => hoveringGazePinchInteractors; - readonly List selectingGazePinchInteractors = new List(); + private readonly List selectingGazePinchInteractors = new List(); /// /// (Read Only) The list of components currently selecting this object. @@ -46,7 +46,7 @@ public class MRTKBaseInteractable : XRBaseInteractable #region Poke - readonly List hoveringPokeInteractors = new List(); + private readonly List hoveringPokeInteractors = new List(); /// /// (Read Only) The list of components currently hovering this object. @@ -57,14 +57,14 @@ public class MRTKBaseInteractable : XRBaseInteractable #region Grab - readonly List hoveringGrabInteractors = new List(); + private readonly List hoveringGrabInteractors = new List(); /// /// (Read Only) The list of components currently hovering this object. /// ] public List HoveringGrabInteractors => hoveringGrabInteractors; - readonly List selectingGrabInteractors = new List(); + private readonly List selectingGrabInteractors = new List(); /// /// (Read Only) The list of components currently selecting this object. @@ -75,7 +75,7 @@ public class MRTKBaseInteractable : XRBaseInteractable #region Ray - readonly List hoveringRayInteractors = new List(); + private readonly List hoveringRayInteractors = new List(); /// /// (Read Only) The list of components currently hovering this object. @@ -93,7 +93,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object selected by a gaze-pinch interactor? /// - public TimedFlag IsGazePinchSelected { get => isGazePinchSelected; } + public TimedFlag IsGazePinchSelected => isGazePinchSelected; [SerializeField] [Tooltip("Is this object selected by a non-gaze ray interactor?")] @@ -102,7 +102,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object selected by a non-gaze ray interactor? /// - public TimedFlag IsRaySelected { get => isRaySelected; } + public TimedFlag IsRaySelected => isRaySelected; [SerializeField] [Tooltip("Is this object selected by a poke interactor?")] @@ -111,7 +111,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object selected by a poke interactor? /// - public TimedFlag IsPokeSelected { get => isPokeSelected; } + public TimedFlag IsPokeSelected => isPokeSelected; [SerializeField] [Tooltip("Is this object selected by a grab interactor?")] @@ -120,7 +120,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object selected by a grab interactor? /// - public TimedFlag IsGrabSelected { get => isGrabSelected; } + public TimedFlag IsGrabSelected => isGrabSelected; [SerializeField] [Tooltip("Is this object hovered by any gaze interactor?")] @@ -129,7 +129,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object hovered by any gaze interactor? /// - public TimedFlag IsGazeHovered { get => isGazeHovered; } + public TimedFlag IsGazeHovered => isGazeHovered; [SerializeField] [Tooltip("Is this object hovered by a gaze-pinch interactor?")] @@ -138,7 +138,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object hovered by a gaze-pinch interactor? /// - public TimedFlag IsGazePinchHovered { get => isGazePinchHovered; } + public TimedFlag IsGazePinchHovered => isGazePinchHovered; [SerializeField] [Tooltip("Is this object hovered by a non-gaze ray interactor?")] @@ -147,7 +147,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object hovered by a non-gaze ray interactor? /// - public TimedFlag IsRayHovered { get => isRayHovered; } + public TimedFlag IsRayHovered => isRayHovered; [SerializeField] [Tooltip("Is this object hovered by a grab interactor?")] @@ -156,7 +156,7 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object hovered by a grab interactor? /// - public TimedFlag IsGrabHovered { get => isGrabHovered; } + public TimedFlag IsGrabHovered => isGrabHovered; [SerializeField] [Tooltip("Is this object hovered by a near touch/poke interactor?")] @@ -166,12 +166,12 @@ public class MRTKBaseInteractable : XRBaseInteractable /// /// Is this object hovered by a near touch/poke interactor? /// - public TimedFlag IsPokeHovered { get => isPokeHovered; } + public TimedFlag IsPokeHovered => isPokeHovered; /// /// Is this object hovered by any interactor other than passive targeting interactors? /// - public TimedFlag IsActiveHovered { get => isActiveHovered; } + public TimedFlag IsActiveHovered => isActiveHovered; [SerializeField] [Tooltip("Is this object hovered by any interactor other than only passive targeting interactors?")] @@ -199,7 +199,7 @@ public void DisableInteractorType(SystemInterfaceType type) } } /// - /// Removes the specified type to the set of interactors which cannot select this interactable + /// Removes the specified type from the set of interactors which cannot select this interactable /// public void EnableInteractorType(SystemInterfaceType type) { diff --git a/org.mixedrealitytoolkit.input/Tests/Runtime/BasicInputTests.cs b/org.mixedrealitytoolkit.input/Tests/Runtime/BasicInputTests.cs index a6ae95b3b..8d23a6b03 100644 --- a/org.mixedrealitytoolkit.input/Tests/Runtime/BasicInputTests.cs +++ b/org.mixedrealitytoolkit.input/Tests/Runtime/BasicInputTests.cs @@ -5,19 +5,15 @@ #pragma warning disable CS1591 using MixedReality.Toolkit.Core.Tests; +using MixedReality.Toolkit.Input.Simulation; +using MixedReality.Toolkit.Subsystems; using NUnit.Framework; using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.TestTools; using UnityEngine.XR; using UnityEngine.XR.Interaction.Toolkit; -using MixedReality.Toolkit.Input; -using MixedReality.Toolkit.Input.Simulation; -using MixedReality.Toolkit; -using MixedReality.Toolkit.Subsystems; - using HandshapeId = MixedReality.Toolkit.Input.HandshapeTypes.HandshapeId; namespace MixedReality.Toolkit.Input.Tests @@ -31,7 +27,7 @@ public class BasicInputTests : BaseRuntimeInputTests /// Ensure the simulated input devices are registered and present. /// [UnityTest] - public IEnumerator InputDeviceSmoketest() + public IEnumerator InputDeviceSmokeTest() { foreach (var device in InputSystem.devices) { @@ -45,9 +41,10 @@ public IEnumerator InputDeviceSmoketest() /// Ensure the simulated input devices bind to the controllers on the rig. /// [UnityTest] - public IEnumerator InputBindingSmoketest() + public IEnumerator InputBindingSmokeTest() { - var controllers = new[] { + XRBaseController[] controllers = + { CachedLookup.LeftHandController, CachedLookup.RightHandController, CachedLookup.GazeController @@ -69,7 +66,7 @@ public IEnumerator InputBindingSmoketest() /// Ensure the simulated input device actually makes the rig's controllers move/actuate. /// [UnityTest] - public IEnumerator HandMovingSmoketest() + public IEnumerator HandMovingSmokeTest() { var controller = CachedLookup.RightHandController as ActionBasedController; @@ -107,7 +104,7 @@ public IEnumerator GrabAnchorTest() Vector3 cubePos = InputTestUtilities.InFrontOfUser(); cube.transform.position = cubePos; cube.transform.localScale = Vector3.one * 1.0f; - + var testHand = new TestHand(Handedness.Right); InputTestUtilities.SetHandAnchorPoint(Handedness.Right, ControllerAnchorPoint.Grab); @@ -136,32 +133,28 @@ public IEnumerator GrabAnchorTest() public IEnumerator StatefulInteractableSmokeTest() { GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); - cube.AddComponent(); + StatefulInteractable firstCubeInteractable = cube.AddComponent(); cube.transform.position = InputTestUtilities.InFrontOfUser(new Vector3(0.2f, 0.2f, 0.5f)); cube.transform.localScale = Vector3.one * 0.1f; // For this test, we won't use poke selection. - cube.GetComponent().DisableInteractorType(typeof(PokeInteractor)); + firstCubeInteractable.DisableInteractorType(typeof(PokeInteractor)); GameObject cube2 = GameObject.CreatePrimitive(PrimitiveType.Cube); - cube2.AddComponent(); + StatefulInteractable secondCubeInteractable = cube2.AddComponent(); cube2.transform.position = InputTestUtilities.InFrontOfUser(new Vector3(-0.2f, -0.2f, 0.5f)); cube2.transform.localScale = Vector3.one * 0.1f; // For this test, we won't use poke selection. - cube2.GetComponent().DisableInteractorType(typeof(PokeInteractor)); + secondCubeInteractable.DisableInteractorType(typeof(PokeInteractor)); var rightHand = new TestHand(Handedness.Right); yield return rightHand.Show(InputTestUtilities.InFrontOfUser(0.5f)); - yield return RuntimeTestUtilities.WaitForUpdates(); bool shouldTestToggle = false; - StatefulInteractable firstCubeInteractable = cube.GetComponent(); - StatefulInteractable secondCubeInteractable = cube2.GetComponent(); - for (int i = 0; i < 5; i++) { // Flip this back and forth to test both toggleability and un-toggleability @@ -176,27 +169,33 @@ public IEnumerator StatefulInteractableSmokeTest() firstCubeInteractable.TriggerOnRelease = (i % 2) == 0; Assert.IsFalse(firstCubeInteractable.IsGrabHovered, + "StatefulInteractable was already GrabHovered."); + Assert.IsFalse(firstCubeInteractable.isHovered, "StatefulInteractable was already hovered."); yield return rightHand.MoveTo(cube.transform.position); yield return RuntimeTestUtilities.WaitForUpdates(); Assert.IsTrue(firstCubeInteractable.IsGrabHovered, + "StatefulInteractable did not get GrabHovered."); + Assert.IsTrue(firstCubeInteractable.isHovered, "StatefulInteractable did not get hovered."); yield return rightHand.SetHandshape(HandshapeId.Pinch); yield return RuntimeTestUtilities.WaitForUpdates(); Assert.IsTrue(firstCubeInteractable.IsGrabSelected, "StatefulInteractable did not get GrabSelected."); + Assert.IsTrue(firstCubeInteractable.isSelected, + "StatefulInteractable did not get selected."); if (shouldTestToggle) { - if (secondCubeInteractable.TriggerOnRelease) + if (firstCubeInteractable.TriggerOnRelease) { - Assert.IsFalse(secondCubeInteractable.IsToggled, "StatefulInteractable toggled on press, when it was set to be toggled on release."); + Assert.IsFalse(firstCubeInteractable.IsToggled, "StatefulInteractable toggled on press, when it was set to be toggled on release."); } else { - Assert.IsFalse(secondCubeInteractable.IsToggled, "StatefulInteractable didn't toggled on press, when it was set to be toggled on press."); + Assert.IsFalse(firstCubeInteractable.IsToggled, "StatefulInteractable didn't toggled on press, when it was set to be toggled on press."); } } @@ -225,17 +224,23 @@ public IEnumerator StatefulInteractableSmokeTest() yield return RuntimeTestUtilities.WaitForUpdates(); Assert.IsFalse(secondCubeInteractable.IsGrabHovered, + "StatefulInteractable was already GrabHovered."); + Assert.IsFalse(secondCubeInteractable.isHovered, "StatefulInteractable was already hovered."); yield return rightHand.MoveTo(secondCubeInteractable.transform.position); yield return RuntimeTestUtilities.WaitForUpdates(); Assert.IsTrue(secondCubeInteractable.IsGrabHovered, + "StatefulInteractable did not get GrabHovered."); + Assert.IsTrue(secondCubeInteractable.isHovered, "StatefulInteractable did not get hovered."); yield return rightHand.SetHandshape(HandshapeId.Pinch); yield return RuntimeTestUtilities.WaitForUpdates(); Assert.IsTrue(secondCubeInteractable.IsGrabSelected, "StatefulInteractable did not get GrabSelected."); + Assert.IsTrue(secondCubeInteractable.isSelected, + "StatefulInteractable did not get selected."); if (shouldTestToggle) { @@ -303,7 +308,7 @@ public IEnumerator GazePinchSmokeTest() yield return rightHand.SetHandshape(HandshapeId.Open); yield return RuntimeTestUtilities.WaitForUpdates(); - + Assert.IsFalse(interactable.isSelected); Assert.IsFalse(interactable.IsGazePinchSelected); Assert.IsTrue(interactable.isHovered); @@ -388,7 +393,7 @@ public IEnumerator ToggleHydrationTest() didFireEvent = false; interactable.ForceSetToggled(true, fireEvents: false); - + Assert.IsTrue(interactable.IsToggled, "Interactable didn't get toggled."); Assert.IsFalse(didFireEvent, "ForceSetToggled(true, fireEvents:false) should NOT have fired the event."); @@ -493,7 +498,7 @@ public IEnumerator SpawnInteractableOnHand() // Move hand far away. yield return rightHand.MoveTo(new Vector3(2, 2, 2)); - yield return RuntimeTestUtilities.WaitForUpdates(frameCount:240); + yield return RuntimeTestUtilities.WaitForUpdates(frameCount: 240); Assert.IsFalse(AnyProximityDetectorsTriggered(), "Prox detectors should no longer be triggered."); @@ -608,4 +613,4 @@ private bool AnyProximityDetectorsTriggered() } } } -#pragma warning restore CS1591 \ No newline at end of file +#pragma warning restore CS1591 diff --git a/org.mixedrealitytoolkit.input/Tests/Runtime/InteractionModeManagerTests.cs b/org.mixedrealitytoolkit.input/Tests/Runtime/InteractionModeManagerTests.cs index 06515e3f5..83725205f 100644 --- a/org.mixedrealitytoolkit.input/Tests/Runtime/InteractionModeManagerTests.cs +++ b/org.mixedrealitytoolkit.input/Tests/Runtime/InteractionModeManagerTests.cs @@ -76,7 +76,7 @@ public IEnumerator InteractionDetectorTest() XRBaseController rightHandController = CachedLookup.RightHandController; Assert.IsTrue(rightHandController != null, "No controllers found for right hand."); - // Moving the hand to a position where it's far ray is hovering over the cube + // Moving the hand to a position where its far ray is hovering over the cube yield return rightHand.AimAt(cube.transform.position); yield return RuntimeTestUtilities.WaitForUpdates(); @@ -127,7 +127,7 @@ public IEnumerator ModeMediationTest() InputTestUtilities.SetHandAnchorPoint(Handedness.Right, ControllerAnchorPoint.Grab); yield return RuntimeTestUtilities.WaitForUpdates(); - // Moving the hand to a position where it's far ray is hovering over the cube + // Moving the hand to a position where its far ray is hovering over the cube yield return rightHand.AimAt(cube.transform.position); yield return RuntimeTestUtilities.WaitForUpdates(); InteractionMode farRayMode = rightHandController.GetComponentInChildren().GetComponent().ModeOnHover; @@ -165,7 +165,7 @@ public IEnumerator ModeMediationTest() ValidateInteractionModeActive(rightHandController, nearMode); - // Moving the hand to a position where it's far ray is hovering over the cube + // Moving the hand to a position where its far ray is hovering over the cube yield return rightHand.MoveTo(cube.transform.position + new Vector3(0.02f, -0.1f, -0.8f)); yield return RuntimeTestUtilities.WaitForUpdates(frameCount:120); @@ -180,7 +180,7 @@ public IEnumerator ModeMediationTest() private void ValidateInteractionModeActive(XRBaseController controller, InteractionMode currentMode) { // We construct the list of managed interactor types manually because we don't want to expose the internal controller mapping implementation to even internal use, since - // we don't want any other class to be able to modify those collections without going through the Mode Manager or it's in-editor inspector. + // we don't want any other class to be able to modify those collections without going through the Mode Manager or its in-editor inspector. HashSet managedInteractorTypes = new HashSet(InteractionModeManager.Instance.PrioritizedInteractionModes.SelectMany(x => x.AssociatedTypes)); HashSet activeInteractorTypes = InteractionModeManager.Instance.PrioritizedInteractionModes.Find(x => x.ModeName == currentMode.Name).AssociatedTypes; diff --git a/org.mixedrealitytoolkit.input/Tests/Runtime/Utilities/InputTestUtilities.cs b/org.mixedrealitytoolkit.input/Tests/Runtime/Utilities/InputTestUtilities.cs index 5ca4fe1d3..5ce3c9f8c 100644 --- a/org.mixedrealitytoolkit.input/Tests/Runtime/Utilities/InputTestUtilities.cs +++ b/org.mixedrealitytoolkit.input/Tests/Runtime/Utilities/InputTestUtilities.cs @@ -435,7 +435,7 @@ public static IEnumerator PointHandToTarget(Vector3 target, HandshapeId handshap /// /// /// - /// This smooths the handshape based on the provided/ over the number of + /// This smooths the handshape based on the provided over the number of /// steps provided by . /// /// diff --git a/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/HandConstraintTests.cs b/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/HandConstraintTests.cs index cfa274fe7..fb2a05341 100644 --- a/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/HandConstraintTests.cs +++ b/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/HandConstraintTests.cs @@ -24,7 +24,7 @@ public class HandConstraintTests : BaseRuntimeInputTests [UnityTest] public IEnumerator HandConstraintEventsOneHanded() { - // Disable gaze interactions for this unit test; + // Disable gaze interactions for this unit test InputTestUtilities.DisableGazeInteractor(); // Set up GameObject with a SolverHandler diff --git a/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/ObjectManipulatorTests.cs b/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/ObjectManipulatorTests.cs index 3f69290b8..9a0ee83cd 100644 --- a/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/ObjectManipulatorTests.cs +++ b/org.mixedrealitytoolkit.spatialmanipulation/Tests/Runtime/ObjectManipulatorTests.cs @@ -4,19 +4,19 @@ // Disable "missing XML comment" warning for tests. While nice to have, this documentation is not required. #pragma warning disable CS1591 -using MixedReality.Toolkit; using MixedReality.Toolkit.Core.Tests; -using MixedReality.Toolkit.Input.Tests; +using MixedReality.Toolkit.Input; using MixedReality.Toolkit.Input.Simulation; +using MixedReality.Toolkit.Input.Tests; using NUnit.Framework; using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; using UnityEngine.TestTools; using UnityEngine.XR.Interaction.Toolkit; using HandshapeId = MixedReality.Toolkit.Input.HandshapeTypes.HandshapeId; using MovementType = UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.MovementType; -using MixedReality.Toolkit.Input; namespace MixedReality.Toolkit.SpatialManipulation.Runtime.Tests { @@ -537,7 +537,6 @@ public IEnumerator ObjectManipulatorOneHandMoveFar() } } - /// /// This tests that the gaze pointer can be used to directly invoke the manipulation logic via simulated pointer events, used /// for scenarios like voice-driven movement using the gaze pointer. @@ -744,29 +743,27 @@ public IEnumerator TestObjManipTargetChange() Assert.IsTrue(cube1.transform.position.CloseEnoughTo(cube1Pos), "Cube1 moved when it shouldn't have!"); Assert.IsTrue(!cube2.transform.position.CloseEnoughTo(cube2Pos), "Cube2 didn't move when it should have!"); - + // Cube2 should be facing the user. Assert.IsTrue(cube2.transform.forward.CloseEnoughTo(-(cube2.transform.position - Camera.main.transform.position).normalized), "Cube2 didn't stay facing user!"); - } #endregion #region Two Handed Manipulation Tests - // This test is not yet working due to some confusion as to how the centroid math works with the current object manipulator - - /* /// /// Test that the grab centroid is calculated correctly while rotating /// the hands during a two-hand near interaction grab. /// - [UnityTest] + [UnityTest, Ignore("This test is not yet working due to some confusion as to how the centroid math works with the current object manipulator")] public IEnumerator ObjectManipulatorTwoHandedCentroid() { InputTestUtilities.DisableGazeInteractor(); + yield return RuntimeTestUtilities.WaitForUpdates(); InputTestUtilities.InitializeCameraToOriginAndForward(); + yield return RuntimeTestUtilities.WaitForUpdates(); // Set up cube with ObjectManipulator var testObject = GameObject.CreatePrimitive(PrimitiveType.Cube); @@ -780,17 +777,21 @@ public IEnumerator ObjectManipulatorTwoHandedCentroid() objectManipulator.SmoothingFar = false; objectManipulator.SmoothingNear = false; // Configuring for two-handed interaction - objectManipulator.selectMode = UnityEngine.XR.Interaction.Toolkit.InteractableSelectMode.Multiple; + objectManipulator.selectMode = InteractableSelectMode.Multiple; TestHand rightHand = new TestHand(Handedness.Right); TestHand leftHand = new TestHand(Handedness.Left); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return rightHand.Show(Vector3.zero); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return leftHand.Show(Vector3.zero); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return rightHand.MoveTo(new Vector3(0.1f, -0.1f, 0.8f)); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return leftHand.MoveTo(new Vector3(-0.1f, -0.1f, 0.8f)); - yield return null; + yield return RuntimeTestUtilities.WaitForUpdates(); // Only testing move/rotate centroid position objectManipulator.AllowedManipulations = TransformFlags.Move | TransformFlags.Scale; @@ -804,8 +805,10 @@ public IEnumerator ObjectManipulatorTwoHandedCentroid() objectManipulator.selectExited.AddListener((med) => manipulationEndedCount++); // Grab the box. - yield return rightHand.SetGesture(GestureId.Pinch); - yield return leftHand.SetGesture(GestureId.Pinch); + yield return rightHand.SetHandshape(HandshapeId.Pinch); + yield return RuntimeTestUtilities.WaitForUpdates(); + yield return leftHand.SetHandshape(HandshapeId.Pinch); + yield return RuntimeTestUtilities.WaitForUpdates(); // Previously we checked that we didn't move after two pinches, however, due to the hand position shifting slighting on pinch, this is not applicable // TODO, address in the future? @@ -815,14 +818,11 @@ public IEnumerator ObjectManipulatorTwoHandedCentroid() // The ObjectManipulator should recognize that we've begun manipulation. Assert.IsTrue(manipulationStartedCount > 0); - yield return RuntimeTestUtilities.WaitForEnterKey(); - // Move both hands outwards; the object may be scaled but the position should remain the same. yield return rightHand.MoveTo(new Vector3(0.2f, -0.1f, 0.8f)); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return leftHand.MoveTo(new Vector3(-0.2f, -0.1f, 0.8f)); - - - yield return RuntimeTestUtilities.WaitForEnterKey(); + yield return RuntimeTestUtilities.WaitForUpdates(); // Should *still* not have moved! // TestUtilities.AssertAboutEqual(testObject.transform.position, initialObjectPosition, $"Object moved when it shouldn't have! Position: {testObject.transform.position:F5}", 0.00001f); @@ -853,8 +853,10 @@ public IEnumerator ObjectManipulatorTwoHandedCentroid() yield return MoveHandsAndCheckCentroid(testCondition.Item1, testCondition.Item2, leftHand, rightHand, objectManipulator, initialObjectPosition, originalCentroid, testObject.transform); } - yield return rightHand.SetGesture(GestureId.Open); - yield return leftHand.SetGesture(GestureId.Open); + yield return rightHand.SetHandshape(HandshapeId.Open); + yield return RuntimeTestUtilities.WaitForUpdates(); + yield return leftHand.SetHandshape(HandshapeId.Open); + yield return RuntimeTestUtilities.WaitForUpdates(); } /// @@ -870,11 +872,15 @@ private IEnumerator MoveHandsAndCheckCentroid(Vector3 handRotationEuler, Vector3 { // Rotate the hands. yield return rightHand.RotateTo(Quaternion.Euler(handRotationEuler.x, handRotationEuler.y, handRotationEuler.z)); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return leftHand.RotateTo(Quaternion.Euler(handRotationEuler.x, -handRotationEuler.y, -handRotationEuler.z)); + yield return RuntimeTestUtilities.WaitForUpdates(); // Move the hands. yield return rightHand.MoveTo(new Vector3(handPosition.x, handPosition.y, handPosition.z)); + yield return RuntimeTestUtilities.WaitForUpdates(); yield return leftHand.MoveTo(new Vector3(-handPosition.x, handPosition.y, handPosition.z)); + yield return RuntimeTestUtilities.WaitForUpdates(); // Recalculate the new grab centroid. var leftGrabPoint = om.interactorsSelecting[0].transform.position; @@ -888,7 +894,6 @@ private IEnumerator MoveHandsAndCheckCentroid(Vector3 handRotationEuler, Vector3 TestUtilities.AssertAboutEqual(testObject.transform.position, originalObjectPosition + centroidDelta, $"Object moved did not move according to the delta! Actual position: {testObject.transform.position:F5}, should be {originalObjectPosition + centroidDelta}", 0.00001f); } - */ #endregion @@ -1287,4 +1292,4 @@ public IEnumerator ObjectManipulatorFarThrow() */ } } -#pragma warning restore CS1591 \ No newline at end of file +#pragma warning restore CS1591