<commit_before>// TODO: onselectstart="return false"
(function() {
    var GAME_STATE = { STOP: -1, READY: 0, RUNNING: 1, PAUSE: 2 };
    var Game = this.Game = Class.extend({
        init: function(divId, player, socket) {
            // init elements
            this.container = document.getElementById('GamePlay');
            var scope = this.scope = this;
            this.clock = new THREE.Clock();
            this.socket = socket;

            ///////////
            // SCENE //
            ///////////
            this.scene = new THREE.Scene();
            this.scene.updateMatrixWorld();
			this.CssScene = new THREE.Scene();

            //////////////
            // RENDERER //
            //////////////
            this.renderer = new THREE.WebGLRenderer({
                antialias: true
            });

			// this.renderer.setPixelRatio( window.devicePixelRatio );
            this.renderer.setSize(window.innerWidth, window.innerHeight);
            this.renderer.domElement.style.position = 'absolute';
            this.renderer.domElement.style.top = 0;
            this.container.appendChild(this.renderer.domElement);

			this.CssRenderer = new THREE.CSS3DRenderer();
            this.CssRenderer.setSize(window.innerWidth, window.innerHeight);
            this.CssRenderer.domElement.style.position = 'absolute';
            this.CssRenderer.domElement.style.top = 0;
            this.container.appendChild(this.CssRenderer.domElement);

            ///////////
            // STATS //
            ///////////
            this.stats = new Stats();
            this.stats.domElement.style.position = 'absolute';
            //this.stats.domElement.style.bottom = '0px';
            this.stats.domElement.style.top = '0px';
            this.stats.domElement.style.left = '0px';
            this.stats.domElement.style.zIndex = 100;
            this.container.appendChild(this.stats.domElement);


            ///////////
            // PLAYER//
            ///////////
            this.setController(player);

            // DO
            // TODO: Think the better way to store
            // player.canMoveOn(world.ground);

			//to create the plane mesh
            // var iframeWidth = 1004, iframeHeight = 504;
            // var planeMaterial = new THREE.MeshBasicMaterial({ wireframe: true , color: 0x000000});
            // var planeGeometry = new THREE.PlaneGeometry(iframeWidth, iframeHeight);
            // var planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
            // planeMesh.position.set(0, 250, -1000);
            // this.add(planeMesh);

			//to create the dom element
            var element = document.createElement('iframe');
            element.src = '/Paint';
            element.width = 1004;
            element.height = 504;
            element.scrolling = 'no';
			var cssObj = new THREE.CSS3DObject(element);
			// cssObj.position.copy(planeMesh.position);
   //          cssObj.rotation.copy(planeMesh.rotation);
			         cssObj.position.set(0, 250, -1000);
            //cssObj.rotation.copy(planeMesh.rotation);
            this.CssScene.add(cssObj);

            var element1 = document.createElement('iframe');
            element1.src = '/Webcam';
            element1.with = 504;
            element1.height = 404;
            element1.scrolling = 'no';
            var cssObj1 = new THREE.CSS3DObject(element1);
            cssObj1.position.set(200, 250,1000);
            //cssObj.rotation.copy(planeMesh.rotation);
            this.CssScene.add(cssObj1);

            var element2 = document.createElement('iframe');
            element2.src = '/WebcamCanvas';
            element2.with = 504;
            element2.height = 404;
            element2.scrolling = 'no';
            var cssObj2 = new THREE.CSS3DObject(element2);
            cssObj2.position.set(400, 250, 1000);
            //cssObj2.rotation.copy(planeMesh.rotation);
            this.CssScene.add(cssObj2);

            //important
			scope.camera.updateProjectionMatrix();

            /////////////////////
            // FUNCTION DEFINE //
            /////////////////////
            this.render = function() {
                var delta = scope.clock.getDelta();
                scope.ObjectsToUpdate.forEach((obj)=>obj.update(delta));
                scope.stats.update();
                scope.renderer.render(scope.scene, scope.camera);
                scope.CssRenderer.render(scope.CssScene, scope.camera);

                if(scope.state == GAME_STATE.RUNNING)
                    scope.requestId = requestAnimationFrame(scope.render);
                // else if(this.state == GAME_STATE.STOP)
                    // cancelAnimationFrame(this.requestId);
            }
            this.start = function() {
                scope.state = GAME_STATE.RUNNING;
                requestAnimationFrame(scope.render);
            }
            this.stop = function() {
                scope.state = GAME_STATE.STOP;
                if (scope.requestId){
                    cancelAnimationFrame(scope.requestId);<commit_msg>// webcam<commit_after>// TODO: onselectstart="return false"
(function() {
    var GAME_STATE = { STOP: -1, READY: 0, RUNNING: 1, PAUSE: 2 };
    var Game = this.Game = Class.extend({
        init: function(divId, player, socket) {
            // init elements
            this.container = document.getElementById('GamePlay');
            var scope = this.scope = this;
            this.clock = new THREE.Clock();
            this.socket = socket;

            ///////////
            // SCENE //
            ///////////
            this.scene = new THREE.Scene();
            this.scene.updateMatrixWorld();
			this.CssScene = new THREE.Scene();

            //////////////
            // RENDERER //
            //////////////
            this.renderer = new THREE.WebGLRenderer({
                antialias: true
            });

			// this.renderer.setPixelRatio( window.devicePixelRatio );
            this.renderer.setSize(window.innerWidth, window.innerHeight);
            this.renderer.domElement.style.position = 'absolute';
            this.renderer.domElement.style.top = 0;
            this.container.appendChild(this.renderer.domElement);

			this.CssRenderer = new THREE.CSS3DRenderer();
            this.CssRenderer.setSize(window.innerWidth, window.innerHeight);
            this.CssRenderer.domElement.style.position = 'absolute';
            this.CssRenderer.domElement.style.top = 0;
            this.container.appendChild(this.CssRenderer.domElement);

            ///////////
            // STATS //
            ///////////
            this.stats = new Stats();
            this.stats.domElement.style.position = 'absolute';
            //this.stats.domElement.style.bottom = '0px';
            this.stats.domElement.style.top = '0px';
            this.stats.domElement.style.left = '0px';
            this.stats.domElement.style.zIndex = 100;
            this.container.appendChild(this.stats.domElement);


            ///////////
            // PLAYER//
            ///////////
            this.setController(player);

            // DO
            // TODO: Think the better way to store
            // player.canMoveOn(world.ground);

			//to create the plane mesh
            // var iframeWidth = 1004, iframeHeight = 504;
            // var planeMaterial = new THREE.MeshBasicMaterial({ wireframe: true , color: 0x000000});
            // var planeGeometry = new THREE.PlaneGeometry(iframeWidth, iframeHeight);
            // var planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
            // planeMesh.position.set(0, 250, -1000);
            // this.add(planeMesh);

			//to create the dom element
            var element = document.createElement('iframe');
            element.src = '/Paint';
            element.width = 1004;
            element.height = 504;
            element.scrolling = 'no';
			var cssObj = new THREE.CSS3DObject(element);
			// cssObj.position.copy(planeMesh.position);
   //          cssObj.rotation.copy(planeMesh.rotation);
			         cssObj.position.set(0, 250, -1000);
            //cssObj.rotation.copy(planeMesh.rotation);
            this.CssScene.add(cssObj);

            // var element1 = document.createElement('iframe');
            // element1.src = '/Webcam';
            // element1.with = 504;
            // element1.height = 404;
            // element1.scrolling = 'no';
            // var cssObj1 = new THREE.CSS3DObject(element1);
            // cssObj1.position.set(200, 250,1000);
            // //cssObj.rotation.copy(planeMesh.rotation);
            // this.CssScene.add(cssObj1);

            // var element2 = document.createElement('iframe');
            // element2.src = '/WebcamCanvas';
            // element2.with = 504;
            // element2.height = 404;
            // element2.scrolling = 'no';
            // var cssObj2 = new THREE.CSS3DObject(element2);
            // cssObj2.position.set(400, 250, 1000);
            // //cssObj2.rotation.copy(planeMesh.rotation);
            // this.CssScene.add(cssObj2);

            //important
			scope.camera.updateProjectionMatrix();

            /////////////////////
            // FUNCTION DEFINE //
            /////////////////////
            this.render = function() {
                var delta = scope.clock.getDelta();
                scope.ObjectsToUpdate.forEach((obj)=>obj.update(delta));
                scope.stats.update();
                scope.renderer.render(scope.scene, scope.camera);
                scope.CssRenderer.render(scope.CssScene, scope.camera);

                if(scope.state == GAME_STATE.RUNNING)
                    scope.requestId = requestAnimationFrame(scope.render);
                // else if(this.state == GAME_STATE.STOP)
                    // cancelAnimationFrame(this.requestId);
            }
            this.start = function() {
                scope.state = GAME_STATE.RUNNING;
                requestAnimationFrame(scope.render);
            }
            this.stop = function() {
                scope.state = GAME_STATE.STOP;
                if (scope.requestId){
                    cancelAnimationFrame(scope.requestId);
{'fraction_non_alphanumeric': 0.1426891415131321, 'fraction_numerical': 0.020384163073304585, 'mean_word_length': 1.524740227610094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4309398', 'n_tokens_mistral': 2897, 'n_tokens_neox': 2638, 'n_words': 456}