Provides test results of boundary system queries.
    public void BoundaryTestResult()
    {
        OVRBoundary.BoundaryTestResult test = OVRManager.boundary.TestPoint(tartget.transform.position, OVRBoundary.BoundaryType.OuterBoundary);
        display.text = test.ClosestPoint + "," + test.ClosestDistance;

        Instantiate(box, new Vector3(test.ClosestPoint.x, 0, test.ClosestPoint.z), Quaternion.identity);
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        //OVR
        OVRBoundary.BoundaryTestResult Testnode = new OVRBoundary.BoundaryTestResult();
        objs = new List <GameObject> ();
        //OVRBoundary.
        //Bounds b = room.GetComponent<BoxCollider>().bounds;
        //print (room.GetComponent<Renderer> ().bounds.ToString ("F3"));
        //test ();
        //print (room.transform.localScale.ToString ("F3"));


        StartCoroutine(loadData(this.jsonFile));
    }
Example #3
0
    /// <summary>
    /// Returns the results of testing a 3d point against the specified boundary type.
    /// The test point is expected in local tracking space.
    /// All points are returned in local tracking space shared by tracked nodes and accessible through OVRCameraRig's trackingSpace anchor.
    /// </summary>
    public OVRBoundary.BoundaryTestResult TestPoint(Vector3 point, OVRBoundary.BoundaryType boundaryType)
    {
        OVRPlugin.BoundaryTestResult ovrpRes = OVRPlugin.TestBoundaryPoint(point.ToFlippedZVector3f(), (OVRPlugin.BoundaryType)boundaryType);

        OVRBoundary.BoundaryTestResult res = new OVRBoundary.BoundaryTestResult()
        {
            IsTriggering       = (ovrpRes.IsTriggering == OVRPlugin.Bool.True),
            ClosestDistance    = ovrpRes.ClosestDistance,
            ClosestPoint       = ovrpRes.ClosestPoint.FromFlippedZVector3f(),
            ClosestPointNormal = ovrpRes.ClosestPointNormal.FromFlippedZVector3f(),
        };

        return(res);
    }
Example #4
0
	/// <summary>
	/// Returns the results of testing a tracked node against the specified boundary type.
	/// All points are returned in local tracking space shared by tracked nodes and accessible through OVRCameraRig's trackingSpace anchor.
	/// </summary>
	public OVRBoundary.BoundaryTestResult TestNode(OVRBoundary.Node node, OVRBoundary.BoundaryType boundaryType)
	{
		OVRPlugin.BoundaryTestResult ovrpRes = OVRPlugin.TestBoundaryNode((OVRPlugin.Node)node, (OVRPlugin.BoundaryType)boundaryType);

		OVRBoundary.BoundaryTestResult res = new OVRBoundary.BoundaryTestResult()
		{
			IsTriggering = (ovrpRes.IsTriggering == OVRPlugin.Bool.True),
			ClosestDistance = ovrpRes.ClosestDistance,
			ClosestPoint = ovrpRes.ClosestPoint.FromFlippedZVector3f(),
			ClosestPointNormal = ovrpRes.ClosestPointNormal.FromFlippedZVector3f(),
		};

		return res;
	}