예제 #1
0
        void LateUpdate()
        {
            if (OnHeadsetUpdate == null || xrState != WebXRState.ENABLED)
            {
                return;
            }

            Matrix4x4 leftProjectionMatrix  = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(0));
            Matrix4x4 rightProjectionMatrix = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(1));
            Matrix4x4 leftViewMatrix        = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(2));
            Matrix4x4 rightViewMatrix       = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(3));
            Matrix4x4 sitStandMatrix        = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(4));

            // Matrix4x4 sitStandMatrix = Matrix4x4.Translate(new Vector3(0, DefaultHeight, 0));

            OnHeadsetUpdate(
                leftProjectionMatrix,
                rightProjectionMatrix,
                leftViewMatrix,
                rightViewMatrix,
                sitStandMatrix);
        }
예제 #2
0
        void LateUpdate()
        {
            if (OnHeadsetUpdate != null && this.xrState != WebXRState.NORMAL)
            {
                Matrix4x4 leftProjectionMatrix  = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(0));
                Matrix4x4 rightProjectionMatrix = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(1));
                Matrix4x4 leftViewMatrix        = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(2));
                Matrix4x4 rightViewMatrix       = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(3));
                Matrix4x4 sitStandMatrix        = WebXRMatrixUtil.NumbersToMatrix(GetFromSharedArray(4));
                if (!this.capabilities.hasPosition)
                {
                    sitStandMatrix = Matrix4x4.Translate(new Vector3(0, this.DefaultHeight, 0));
                }

                OnHeadsetUpdate(
                    leftProjectionMatrix,
                    rightProjectionMatrix,
                    leftViewMatrix,
                    rightViewMatrix,
                    sitStandMatrix);
            }
        }