Exemplo n.º 1
0
 /// <summary>
 /// Method to be implemented by provider to get the camera frame for the subsystem.
 /// </summary>
 /// <param name="cameraParams">The current Unity <c>Camera</c> parameters.</param>
 /// <param name="cameraFrame">The current camera frame returned by the method.</param>
 /// <returns>
 /// <c>true</c> if the method successfully got a frame. Otherwise, <c>false</c>.
 /// </returns>
 public virtual bool TryGetFrame(
     XRCameraParams cameraParams,
     out XRCameraFrame cameraFrame)
 {
     cameraFrame = default(XRCameraFrame);
     return(false);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get the latest frame from the provider.
        /// </summary>
        /// <param name="cameraParams">The Unity <c>Camera</c> parameters.</param>
        /// <param name="frame">The camera frame to be populated if the subsystem is running and successfully provides
        /// the latest camera frame.</param>
        /// <returns>
        /// <c>true</c> if the camera frame is successfully returned. Otherwise, <c>false</c>.
        /// </returns>
        public bool TryGetLatestFrame(
            XRCameraParams cameraParams,
            out XRCameraFrame frame)
        {
            if (m_Running && m_Provider.TryGetFrame(cameraParams, out frame))
            {
                return(true);
            }

            frame = default(XRCameraFrame);
            return(false);
        }