zoukankan      html  css  js  c++  java
  • WebGL_0007:强制横屏的参考

    1,

        var gt, vt = S.a.register("OrientationManager")(dt = function() {
                function t(t) {
                    var e = this;
                    !
                    function(t, e, n) {
                        e in t ? Object.defineProperty(t, e, {
                            value: n,
                            enumerable: !0,
                            configurable: !0,
                            writable: !0
                        }) : t[e] = n
                    }(this, "onResize", (function() {
                        setTimeout((function() {
                            var t = window.innerWidth,
                                n = window.innerHeight,
                                i = window.orientation || 0,
                                a = e.app;
                            "forceLandscape" === e.mode && 0 === i && t < n ? (e.setOrientation(90), e.setCanvasSize(n, t)) : (e.setOrientation(0), e.setCanvasSize(t, n)), a.renderNextFrame = a.globals.renderNextFrame, a.fire("orientation:resize", {
                                 t,
                                height: n
                            })
                        }), 100)
                    })), this.app = t, this.orientation = 0, this.width = window.innerWidth, this.height = window.innerHeight, this._mode = "normal", this.onResize(), window.addEventListener("resize", this.onResize, !1), window.addEventListener("orientationchange", this.onResize, !1)
                }
                var e, n, i, a = t.prototype;
                return a.getOptions = function() {
                        return {
                            mode: ["normal", "forceLandscape"]
                        }
                    }, a.getState = function() {
                        return {
                            mode: this.mode
                        }
                    }, a.setState = function(t) {
                        var e = this;
                        return new Promise((function(n) {
                                if (x()(t)) return n("[OrientationManager] Can not find data.");
                                e.mode = t.mode, n("[OrientationManager] setState resolve")
                            }))
                            //WG  相机旋转
                    },
                    a.setOrientation = function(t) {
                        var e = this.app.camera,
                            n = e ? e.script.orbitCamera : null,
                            i = this.app.graphicsDevice.canvas.parentElement,
                            a = window.innerWidth,
                            r = window.innerHeight;
                        i && (0 === t ? (i.style.width = a + "px", i.style.height = r + "px", i.style.top = "0px", i.style.left = "0px", i.style.webkitTransformOrigin = "0% 0%", i.style.transformOrigin = "0% 0%", i.style.webkitTransform = "none", i.style.transform = "none") : (i.style.width = r + "px", i.style.height = a + "px", i.style.top = "0px", i.style.left = a + "px", i.style.webkitTransformOrigin = "0% 0%", i.style.transformOrigin = "0% 0%", i.style.webkitTransform = "rotate(90deg)", i.style.transform = "rotate(90deg)")), n && (n.orientation = t), this.app.fire("orientation:change", t)
                    },
                    a.setCanvasSize = function(t, e) {
                        var n = this.app,
                            i = n.camera,
                            a = n.graphicsDevice.canvas;
                        n.graphicsDevice.maxPixelRatio;
                        n.resizeCanvas(t, e), n.renderNextFrame = n.globals.renderNextFrame, i && i.picker && i.picker._picker && i.picker._picker.resize(a.width, a.height)
                    }, e = t, (n = [{
                        key: "mode",
                        get: function() {
                            return this._mode
                        },
                        set: function(t) {
                            "normal" !== t && "forceLandscape" !== t || (this._mode = t, this.onResize())
                        }
                    }, {
                        key: "useForceLandscape",
                        get: function() {
                            return "forceLandscape" === this._mode && window.innerWidth < window.innerHeight
                        }
                    }]) && mt(e.prototype, n), i && mt(e, i), t
            }()) || dt,
            bt = n(79),
            yt = n(167),
            _t = n(29);
    琥珀君的博客
  • 相关阅读:
    HDU 2159 FATE
    POJ 3384 Feng Shui 凸包直径 + 半平面交
    Irrlicht学习之光照的研究
    正襟危坐说--操作系统(伍):进程间通信
    网站建设--团队的重要性
    好累啊,你感觉到了吗?
    android 4.2 root
    OpenSSL命令---rand
    STL中deque
    正襟危坐说--操作系统(陆):进程同步
  • 原文地址:https://www.cnblogs.com/eliteboy/p/13308823.html
Copyright © 2011-2022 走看看