Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transformations] New Transformations system which replaces the old Solvers+Constraints system #11323

Closed
wants to merge 12 commits into from
Closed

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -922,6 +922,7 @@ private bool TryGetGripRotation(IXRSelectInteractor interactor, out Quaternion r
}
}

#region ReleaseBehaviorEnum Extenions
RogPodge marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// Extension methods specific to the <see cref="ReleaseBehaviorType"/> enum.
/// </summary>
Expand All @@ -939,4 +940,5 @@ public static bool IsMaskSet(this ObjectManipulator.ReleaseBehaviorType a, Objec
return ((a & b) == b);
}
}
#endregion
}
407 changes: 407 additions & 0 deletions com.microsoft.mrtk.spatialmanipulation/PlacementHub.cs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions com.microsoft.mrtk.spatialmanipulation/PlacementHub.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -124,7 +124,10 @@ public IEnumerator TestObjManipSmoothingDrift()
yield return RuntimeTestUtilities.WaitForUpdates();

ObjectManipulator objManip = cube.GetComponent<ObjectManipulator>();
objManip.SmoothingNear = false;

// Enable smoothing for near interaction.
objManip.SmoothingNear = true;
objManip.AllowedManipulations = TransformFlags.Move;

var rightHand = new TestHand(Handedness.Right);
yield return rightHand.Show(InputTestUtilities.InFrontOfUser(0.5f));
Expand All @@ -137,12 +140,10 @@ public IEnumerator TestObjManipSmoothingDrift()

yield return rightHand.SetHandshape(HandshapeId.Pinch);
yield return RuntimeTestUtilities.WaitForUpdates();
yield return new WaitForSeconds(2.0f);

Assert.IsTrue(objManip.IsGrabSelected, "ObjManip didn't report IsGrabSelected");

// Enable smoothing for near interaction.
objManip.SmoothingNear = true;

// Move the hand to the right.
Vector3 originalPosition = cube.transform.position;
Vector3 attachTransform = objManip.firstInteractorSelecting.GetAttachTransform(objManip).position;
Expand All @@ -168,6 +169,12 @@ public IEnumerator TestObjManipSmoothingDrift()
// Disable smoothing, to check that it properly sticks to the hand once disabled.
objManip.SmoothingNear = false;

yield return rightHand.SetHandshape(HandshapeId.Open);
yield return RuntimeTestUtilities.WaitForUpdates();
yield return rightHand.SetHandshape(HandshapeId.Pinch);
yield return RuntimeTestUtilities.WaitForUpdates();
originalAttachOffset = attachTransform - cube.transform.position;
keveleigh marked this conversation as resolved.
Show resolved Hide resolved

newPosition = originalPosition - Vector3.right * 1.5f;
yield return rightHand.MoveTo(newPosition);
yield return RuntimeTestUtilities.WaitForUpdates();
Expand Down