Ejemplo n.º 1
0
    // Token: 0x0600009F RID: 159 RVA: 0x00007788 File Offset: 0x00005988
    public bool ComputeIntersection(global::UnityEngine.Vector3 source, global::UnityEngine.Vector3 direction, ref global::SteamVR_Overlay.IntersectionResults results)
    {
        global::Valve.VR.CVROverlay overlay = global::Valve.VR.OpenVR.Overlay;
        bool flag = overlay == null;
        bool result;

        if (flag)
        {
            result = false;
        }
        else
        {
            global::Valve.VR.VROverlayIntersectionParams_t vroverlayIntersectionParams_t = default(global::Valve.VR.VROverlayIntersectionParams_t);
            vroverlayIntersectionParams_t.eOrigin       = global::SteamVR_Render.instance.trackingSpace;
            vroverlayIntersectionParams_t.vSource.v0    = source.x;
            vroverlayIntersectionParams_t.vSource.v1    = source.y;
            vroverlayIntersectionParams_t.vSource.v2    = -source.z;
            vroverlayIntersectionParams_t.vDirection.v0 = direction.x;
            vroverlayIntersectionParams_t.vDirection.v1 = direction.y;
            vroverlayIntersectionParams_t.vDirection.v2 = -direction.z;
            global::Valve.VR.VROverlayIntersectionResults_t vroverlayIntersectionResults_t = default(global::Valve.VR.VROverlayIntersectionResults_t);
            bool flag2 = !overlay.ComputeOverlayIntersection(this.handle, ref vroverlayIntersectionParams_t, ref vroverlayIntersectionResults_t);
            if (flag2)
            {
                result = false;
            }
            else
            {
                results.point    = new global::UnityEngine.Vector3(vroverlayIntersectionResults_t.vPoint.v0, vroverlayIntersectionResults_t.vPoint.v1, -vroverlayIntersectionResults_t.vPoint.v2);
                results.normal   = new global::UnityEngine.Vector3(vroverlayIntersectionResults_t.vNormal.v0, vroverlayIntersectionResults_t.vNormal.v1, -vroverlayIntersectionResults_t.vNormal.v2);
                results.UVs      = new global::UnityEngine.Vector2(vroverlayIntersectionResults_t.vUVs.v0, vroverlayIntersectionResults_t.vUVs.v1);
                results.distance = vroverlayIntersectionResults_t.fDistance;
                result           = true;
            }
        }
        return(result);
    }
Ejemplo n.º 2
0
 // Token: 0x060001B5 RID: 437 RVA: 0x0000CB1C File Offset: 0x0000AD1C
 public bool ComputeOverlayIntersection(ulong ulOverlayHandle, ref global::Valve.VR.VROverlayIntersectionParams_t pParams, ref global::Valve.VR.VROverlayIntersectionResults_t pResults)
 {
     return(this.FnTable.ComputeOverlayIntersection(ulOverlayHandle, ref pParams, ref pResults));
 }