public bool ComputeIntersection(Vector3 source, Vector3 direction, ref IntersectionResults results)
    {
        var overlay = OpenVR.Overlay;
        if (overlay == null)
            return false;

        var input = new VROverlayIntersectionParams_t();
        input.eOrigin = SteamVR_Render.instance.trackingSpace;
        input.vSource.v0 =  source.x;
        input.vSource.v1 =  source.y;
        input.vSource.v2 = -source.z;
        input.vDirection.v0 =  direction.x;
        input.vDirection.v1 =  direction.y;
        input.vDirection.v2 = -direction.z;

        var output = new VROverlayIntersectionResults_t();
        if (!overlay.ComputeOverlayIntersection(handle, ref input, ref output))
            return false;

        results.point = new Vector3(output.vPoint.v0, output.vPoint.v1, -output.vPoint.v2);
        results.normal = new Vector3(output.vNormal.v0, output.vNormal.v1, -output.vNormal.v2);
        results.UVs = new Vector2(output.vUVs.v0, output.vUVs.v1);
        results.distance = output.fDistance;
        return true;
    }
Ejemplo n.º 2
0
        public bool ComputeIntersection(Vector3 source, Vector3 direction, ref IntersectionResults results)
        {
            var overlay = OpenVR.Overlay;

            if (overlay == null)
            {
                return(false);
            }

            var input = new VROverlayIntersectionParams_t();

            input.eOrigin       = SteamVR.settings.trackingSpace;
            input.vSource.v0    = source.x;
            input.vSource.v1    = source.y;
            input.vSource.v2    = -source.z;
            input.vDirection.v0 = direction.x;
            input.vDirection.v1 = direction.y;
            input.vDirection.v2 = -direction.z;

            var output = new VROverlayIntersectionResults_t();

            if (!overlay.ComputeOverlayIntersection(handle, ref input, ref output))
            {
                return(false);
            }

            results.point    = new Vector3(output.vPoint.v0, output.vPoint.v1, -output.vPoint.v2);
            results.normal   = new Vector3(output.vNormal.v0, output.vNormal.v1, -output.vNormal.v2);
            results.UVs      = new Vector2(output.vUVs.v0, output.vUVs.v1);
            results.distance = output.fDistance;
            return(true);
        }
Ejemplo n.º 3
0
    public bool ComputeIntersection(Vector3 source, Vector3 direction, ref IntersectionResults results)
    {
        var vr = SteamVR.instance;

        var input = new VROverlayIntersectionParams_t();
        input.eOrigin = SteamVR_Render.instance.trackingSpace;
        input.vSource.v = new float[] { source.x, source.y, -source.z };
        input.vDirection.v = new float[] { direction.x, direction.y, -direction.z };

        var output = new VROverlayIntersectionResults_t();
        if (!vr.overlay.ComputeOverlayIntersection(handle, ref input, ref output))
            return false;

        results.point = new Vector3(output.vPoint.v[0], output.vPoint.v[1], -output.vPoint.v[2]);
        results.normal = new Vector3(output.vNormal.v[0], output.vNormal.v[1], -output.vNormal.v[2]);
        results.UVs = new Vector2(output.vUVs.v[0], output.vUVs.v[1]);
        results.distance = output.fDistance;
        return true;
    }
Ejemplo n.º 4
0
	public abstract bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults);
Ejemplo n.º 5
0
	internal static extern bool VR_IVROverlay_ComputeOverlayIntersection(IntPtr instancePtr, ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);
Ejemplo n.º 6
0
	public override bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
	{
		CheckIfUsable();
		bool result = VRNativeEntrypoints.VR_IVROverlay_ComputeOverlayIntersection(m_pVROverlay,ulOverlayHandle,ref pParams,ref pResults);
		return result;
	}
Ejemplo n.º 7
0
 public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale) => default;                                                                                                                                                                                 // 0x00000001811DECE0-0x00000001811DED10
 public bool ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults) => default;                                                                                                                               // 0x00000001811DE030-0x00000001811DE060
Ejemplo n.º 8
0
 public bool ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults)
 {
     return(this.FnTable.ComputeOverlayIntersection(ulOverlayHandle, ref pParams, ref pResults));
 }
Ejemplo n.º 9
0
	public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
	{
		bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults);
		return result;
	}