public static bool Raycast(float[] ray_origin, float[] ray_direction, TrackableHitFlags filter, out TrackableHit hitResult) { if (SessionManager == null) { hitResult = new TrackableHit(); return(false); } return(SessionManager.FrameManager.Raycast(ray_origin, ray_direction, filter, out hitResult)); }
/// <summary> /// Performs a raycast against physical objects being tracked by ARCore. /// Output the closest hit from the camera. /// Note that the Unity's screen coordinate (0, 0) /// starts from bottom left. /// </summary> /// <param name="x">Horizontal touch position in Unity's screen coordiante.</param> /// <param name="y">Vertical touch position in Unity's screen coordiante.</param> /// <param name="filter">A filter bitmask where each {@link TrackableHitFlag} which is set represents a category /// of raycast hits the method call should consider valid.</param> /// <param name="hitResult">A {@link TrackableHit} that will be set if the raycast is successful.</param> /// <returns><c>true</c> if the raycast had a hit, otherwise <c>false</c>.</returns> public static bool Raycast(float x, float y, TrackableHitFlags filter, out TrackableHit hitResult) { if (SessionManager == null) { hitResult = new TrackableHit(); return(false); } return(SessionManager.FrameManager.Raycast(x, y, filter, out hitResult)); }