コード例 #1
0
        internal AsyncRaycastResult(ulong trackerHandle, RaycastQuery query)
        {
            pose       = Pose.identity;
            confidence = 0f;

            // Translate the query to an MLRaycastQuery
            var mlQuery = new MLRaycastQuery
            {
                position  = FlipHandedness(query.ray.origin),
                direction = FlipHandedness(query.ray.direction),
                up_vector = query.up.normalized,
                width     = (uint)query.width,
                height    = (uint)query.height,
                horizontal_fov_degrees  = query.horizontalFov,
                collide_with_unobserved = query.collideWithUnobserved
            };

            var apiResult = MLRaycastRequest(trackerHandle, ref mlQuery, out m_RequestHandle);

            if (apiResult == MLApiResult.Ok)
            {
                m_State         = null;
                m_TrackerHandle = trackerHandle;
            }
            else
            {
                m_State         = apiResult.ToRaycastResultState();
                m_TrackerHandle = k_InvalidHandle;
            }
        }
コード例 #2
0
 public AsyncRaycastResult AsyncRaycast(RaycastQuery query)
 {
     return(new AsyncRaycastResult(m_TrackerHandle, query));
 }
コード例 #3
0
 /// <summary>
 /// Asynchronously casts a ray. Use the returned <see cref="AsyncRaycastResult"/> to check for completion and
 /// retrieve the raycast hit results.
 /// </summary>
 /// <param name="query">The input query for the raycast job.</param>
 /// <returns>An <see cref="AsyncRaycastResult"/> which can be used to check for completion and retrieve the raycast result.</returns>
 public AsyncRaycastResult AsyncRaycast(RaycastQuery query)
 {
     return(m_Provider.AsyncRaycast(query));
 }