コード例 #1
0
        //
        // @fn SILVER_ERROR silverSetHeadOrientation(SilverPlayer* p, SilverOrientation* pOrientation)
        // @brief Set head orientation
        // @param \pPlayer Pointer to player object
        // @param \pOrientation - Yaw, pitch and roll of current viewer ideal position (pitch=x, yaw=y, roll=z)
        public SILVER_ERROR SetHeadOrientation(Vector3 orientation)
        {
            if (m_Instance == IntPtr.Zero)
            {
                return(SILVER_ERROR.SILVER_NOT_EXIST);
            }
            SilverOrientation newOrientation = new SilverOrientation();

            newOrientation.yaw   = orientation.y;
            newOrientation.pitch = orientation.x;
            newOrientation.roll  = orientation.z;
            // Debug.LogError("step 3 yaw " + newOrientation.yaw + " roll " + newOrientation.roll + " pitch " + newOrientation.pitch);
            return(silverSetHeadOrientation(m_Instance, ref newOrientation));
        }
コード例 #2
0
        //
        // @fn SILVER_ERROR SILVER_ERROR silverGetOrientation(SilverPlayer* p, SilverOrientation* pOrientation, int64_t ulTimestampUs)
        // @brief Return mesh orientation at a specific time
        // @param \pPlayer Pointer to player object
        // @param \pOrientation - Receives new orientation information
        // @param \pulTimestampUs - What frame to retrieve orientation for
        // Note: Time given, here, must coincide with the timestamp of the video frame about to be displayed.
        // Any delay of this, will cause brief stuttering during view transition
        public SILVER_ERROR GetOrientation(out Vector3 orientation, Int64 lTimestampUs)
        {
            SILVER_ERROR Result;

            if (m_Instance == IntPtr.Zero)
            {
                orientation = Vector3.zero;
                return(SILVER_ERROR.SILVER_NOT_EXIST);
            }
            SilverOrientation newOrientation = new SilverOrientation();

            Result        = silverGetOrientation(m_Instance, out newOrientation, lTimestampUs);
            orientation.x = newOrientation.pitch;
            orientation.y = newOrientation.yaw;
            orientation.z = newOrientation.roll;
//            Debug.LogError(" from silver  ori "+ orientation + " timeStampUs "+lTimestampUs);
            return(Result);
        }
コード例 #3
0
 private static extern SILVER_ERROR silverGetOrientation(IntPtr s, out SilverOrientation orientation, Int64 ulTimestamp);
コード例 #4
0
 private static extern SILVER_ERROR silverSetHeadOrientation(IntPtr s, ref SilverOrientation orientation);