public override void Setup()
    {
        DeviceTestManager TestManager = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>();

        if ((DeviceUnderTest.characteristics & InputDeviceCharacteristics.HeadMounted) == 0)
        {
            // Set up visualizer
            m_Visualizer = Object.Instantiate(TestManager.TrackedDeviceVisualizerRotationPrefab);
            m_Visualizer.transform.SetParent(TestManager.XRRig.transform);
            TrackedDevice Device = m_Visualizer.GetComponent <TrackedDevice>();
            Device.device        = DeviceUnderTest;
            Device.rotationUsage = FeatureUsageUnderTest.As <Quaternion>();

            m_Visualizer.transform.localPosition = Vector3.forward;

            Vector3 trash;
            if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.devicePosition, out trash))
            {
                Device.positionUsage = CommonUsages.devicePosition;
            }
            else if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.colorCameraPosition, out trash))
            {
                Device.positionUsage = CommonUsages.colorCameraPosition;
            }
        }
        else
        {
            m_TextOnFace = TestManager.rotationTextOnFace;
            m_TextOnFace.SetDrivingUsage(DeviceUnderTest, FeatureUsageUnderTest.As <Quaternion>());
        }
    }
Пример #2
0
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        bool value;

        if (FeatureUsageUnderTest.type == typeof(bool) &&
            DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <bool>(), out value) &&
            value == true)
        {
            passed = true;
        }
    }
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        float value;

        if (FeatureUsageUnderTest.type == typeof(float) &&
            DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <float>(), out value) &&
            value == 1.0f)
        {
            passed = true;
        }
    }
Пример #4
0
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        Vector2 value;

        if (FeatureUsageUnderTest.type == typeof(Vector2) &&
            DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <Vector2>(), out value) &&
            value.x < 0f &&
            value.y < 0f)
        {
            passed = true;
        }
    }
    public override void Setup()
    {
        m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
        m_Bearings.EnableXYZVelocityParticles = true;

        m_Graph = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().graphVector3;
        if (m_Graph != null)
        {
            m_Graph.gameObject.SetActive(true);
            m_Graph.SetActive(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>(), 0.2f);
        }
    }
 // Run the check, which should be a single testable property or characteristic
 public override void RunCheck()
 {
     float value = float.NaN;
     if (!
         (FeatureUsageUnderTest.type == typeof(float)
         && DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As<float>(), out value)
         && value >= 0f
         && value <= 1f)
        )
     {
         ForceFail("Value of " + FeatureUsageUnderTest.name + " is outside of the range 0f to 1f");
     }
 }
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        Quaternion value;

        if (FeatureUsageUnderTest.type == typeof(Quaternion) &&
            DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <Quaternion>(), out value) &&
            Mathf.Sqrt(Mathf.Pow(value.x, 2) + Mathf.Pow(value.y, 2) + Mathf.Pow(value.z, 2) + Mathf.Pow(value.w, 2)) != 1.0f)
        {
            ForceFail("ForceFail: quaternion is not normalized. Magnitude = " + (Mathf.Sqrt(Mathf.Pow(value.x, 2.0f) + Mathf.Pow(value.y, 2.0f) + Mathf.Pow(value.z, 2.0f) + Mathf.Pow(value.w, 2.0f))).ToString("F8"));
        }

        passed = true;
    }
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        Quaternion value;

        if (FeatureUsageUnderTest.type == typeof(Quaternion) &&
            DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <Quaternion>(), out value) &&
            value.x == 0.0f &&
            value.y == 0.0f &&
            value.z == 0.0f &&
            value.w == 1.0f)
        {
            passed = true;
        }
    }
Пример #9
0
    public override void Setup()
    {
        DeviceTestManager TestManager = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>();

        // Set up visualizer
        m_Visualizer = Object.Instantiate(TestManager.TrackedDeviceVisualizerPointerPrefab);
        m_Visualizer.transform.SetParent(TestManager.XRRig.transform);
        TrackedDevice Device = m_Visualizer.GetComponent <TrackedDevice>();

        Device.device = DeviceUnderTest;
        //Device.rotationUsage = FeatureUsageUnderTest.As<Quaternion>();

        m_Visualizer.transform.localPosition = Vector3.forward;

        Quaternion checkIfRotationIsPresent;

        if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.deviceRotation, out checkIfRotationIsPresent))
        {
            Device.rotationUsage = CommonUsages.deviceRotation;
        }
        else if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.colorCameraRotation, out checkIfRotationIsPresent))
        {
            Device.rotationUsage = CommonUsages.colorCameraRotation;
        }
        Vector3 checkIfPositionIsPresent;

        if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.devicePosition, out checkIfPositionIsPresent))
        {
            Device.positionUsage = CommonUsages.devicePosition;
        }
        else if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.colorCameraPosition, out checkIfPositionIsPresent))
        {
            Device.positionUsage = CommonUsages.colorCameraPosition;
        }

        // Set up bearings
        m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
        if (m_Bearings != null)
        {
            m_Bearings.EnableAngularAcceleration(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>());
        }

        m_Graph = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().graphVector3;
        if (m_Graph != null)
        {
            m_Graph.gameObject.SetActive(true);
            m_Graph.SetActive(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>(), 10f);
        }
    }
    public override void Setup()
    {
        DeviceTestManager TestManager = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>();

        if ((DeviceUnderTest.characteristics & InputDeviceCharacteristics.HeadMounted) == 0)
        {
            // Set up visualizer
            m_Visualizer = Object.Instantiate(TestManager.TrackedDeviceVisualizerPositionPrefab);
            m_Visualizer.transform.SetParent(TestManager.XRRig.transform);
            TrackedDevice Device = m_Visualizer.GetComponent <TrackedDevice>();
            Device.device        = DeviceUnderTest;
            Device.positionUsage = FeatureUsageUnderTest.As <Vector3>();
        }

        // Show coordinates
        TestManager.bearings.EnableCoordinates = true;
    }
Пример #11
0
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        Vector2 value = new Vector2(float.NaN, float.NaN);

        if (!
            (FeatureUsageUnderTest.type == typeof(Vector2) &&
             DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <Vector2>(), out value) &&
             value.x >= -1f &&
             value.x <= 1f &&
             value.y >= -1f &&
             value.y <= 1f)
            )
        {
            ForceFail("Value of " + FeatureUsageUnderTest.name + " is outside of the range -1.0 to 1.0.  " +
                      "X = " + value.x.ToString("F8") +
                      "Y = " + value.y.ToString("F8"));
        }
    }
Пример #12
0
    // Run the check, which should be a single testable property or characteristic
    public override void RunCheck()
    {
        Eyes  value = new Eyes();
        float left  = 0;
        float right = 0;

        if (DeviceUnderTest.TryGetFeatureValue(FeatureUsageUnderTest.As <Eyes>(), out value))
        {
            value.TryGetLeftEyeOpenAmount(out left);
            value.TryGetRightEyeOpenAmount(out right);

            if (left < 0 || left > 1)
            {
                ForceFail("ForceFail: Left Eye open value is not within [0, 1]. Left Eye Open Value is " + left);
            }
            if (right < 0 || right > 1)
            {
                ForceFail("ForceFail: Right Eye open value is not within [0, 1]. Right Eye Open Value is " + right);
            }
        }

        passed = true;
    }
Пример #13
0
 public override void Setup()
 {
     m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
     m_Bearings.EnableAngularVelocityOrbit(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>());
 }