Beispiel #1
0
        public void SetProjMatrix(Matrix4x4 proj)
        {
            if (handle == Types.INVALID_HANDLE)
            {
                return;
            }

            var apiMat44 = HvrPlayerInterfaceHelper.GetMat44FromMatrix4x4(proj);

            HvrPlayerInterfaceAPI.Viewport_SetProjMatrix(handle, apiMat44);
        }
Beispiel #2
0
        public void SetTransform(Transform trans, float scaleFactor)
        {
            if (m_handle == Types.INVALID_HANDLE)
            {
                return;
            }

            // Set scale factor
            Matrix4x4 matrix = trans.localToWorldMatrix * Matrix4x4.Scale(new Vector3(scaleFactor, scaleFactor, scaleFactor));

            // Account for Unity's -Z orientation, and fix the actors being mirrored
            matrix = matrix * Matrix4x4.Scale(new Vector3(-1, 1, 1));

            var apiMat44 = HvrPlayerInterfaceHelper.GetMat44FromMatrix4x4(matrix);

            HvrPlayerInterfaceAPI.Actor_SetTransform(m_handle, apiMat44);
        }