internal static BasePoseProvider CreatePoseProviderOnTPD(TestTrackedPoseDriverWrapper tpd) { TestPoseProvider tpp = tpd.gameObject.AddComponent <TestPoseProvider>(); tpd.poseProviderComponent = tpp; return(tpp); }
public void TPDPartialUpdateDataTest() { TestTrackedPoseDriverWrapper tpd = CreateGameObjectWithTPD(); BasePoseProvider pp = CreatePoseProviderOnTPD(tpd); TestPoseProvider tpp = pp as TestPoseProvider; Assert.That(tpd.poseProviderComponent, Is.EqualTo(pp)); tpp.flags = PoseDataFlags.Position; tpd.FakeUpdate(); Assert.That(tpd.gameObject.transform.position, Is.EqualTo(testpos)); Assert.That(!tpd.gameObject.transform.rotation.Equals(testrot)); Reset(tpd.gameObject); tpp.flags = PoseDataFlags.Rotation; tpd.FakeUpdate(); Assert.That(tpd.gameObject.transform.position, Is.Not.EqualTo(testpos)); Assert.That(tpd.gameObject.transform.rotation.Equals(testrot)); Reset(tpd.gameObject); tpp.flags = PoseDataFlags.Position | PoseDataFlags.Rotation; tpd.FakeUpdate(); Assert.That(tpd.gameObject.transform.position, Is.EqualTo(testpos)); Assert.That(tpd.gameObject.transform.rotation.Equals(testrot)); }
internal static XRDirectInteractor CreateDirectInteractorWithWrappedXRController() { GameObject interactorGO = new GameObject(); CreateGOSphereCollider(interactorGO); XRControllerWrapper controllerWrapper = interactorGO.AddComponent <XRControllerWrapper>(); XRDirectInteractor interactor = interactorGO.AddComponent <XRDirectInteractor>(); #if LIH_PRESENT TestPoseProvider tpp = interactorGO.AddComponent <TestPoseProvider>(); controllerWrapper.poseProvider = tpp; #endif return(interactor); }