<commit_before><!DOCTYPE html>
<html>
<head>
	<title>Google Thief Auto</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script src="lib/jquery-1.11.1.min.js"></script>
<script src="lib/three.min.js"></script>
<script src="lib/AssimpJSONLoader.js"></script>
<script src="Physijs/physi.js"></script>
<script>
	'use strict';

	Physijs.scripts.worker = 'Physijs/physijs_worker.js';
	Physijs.scripts.ammo = 'examples/js/ammo.js';

</script>
<script>
  var leftkey = false,
      rightkey = false,
      upkey = false,
      downkey = false;
	$(document).ready(function(){
		var container;
		var camera;
		var scene, renderer, objects;
		var car, object;

		init();

		var lines = [];

		var offsetX, offsetZ;

		function init() {
			container = document.createElement( 'div' );
			document.body.appendChild( container );

			camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
			scene = new Physijs.Scene();

			scene.add( new THREE.AmbientLight( 0xcccccc ) );

			var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee );
			directionalLight.position.x = Math.random() - 0.5;
			directionalLight.position.y = Math.random() - 0.5;
			directionalLight.position.z = Math.random() - 0.5;
			directionalLight.position.normalize();
			scene.add( directionalLight );

			renderer = new THREE.WebGLRenderer();
			renderer.setSize( window.innerWidth, window.innerHeight );
			renderer.setClearColorHex( 0xffffff, 1 );
			container.appendChild( renderer.domElement );

			window.addEventListener( 'resize', onWindowResize, false );

/*
			var loader1 = new THREE.AssimpJSONLoader();
			loader1.load( 'models/assimp/jeep/jeep1.ms3d.json', function ( assimpjson ) {
				assimpjson.updateMatrix();
				scene.add(assimpjson);
			});
*/
			
			$("#data").load('map4.json', function(e){
				var data = $.parseJSON(e);
				$("#data").hide();
				$.each(data.features, function(index, value){
					if(value.properties.building == "yes"){
						var geometry = new THREE.Geometry();
						$.each(value.geometry.coordinates[0], function(index, vertex){
							if(!offsetX){
								offsetX = vertex[0];
								offsetZ = vertex[1];
							}
							geometry.vertices.push(new THREE.Vector3((vertex[0]-offsetX)*1000,0,(vertex[1]-offsetZ)*1000));
						//	console.log(new THREE.Vector3(vertex[0]-offsetX,0,vertex[1]-offsetZ));
						});
						var line = new THREE.Line( geometry, new THREE.LineBasicMaterial({color:0x000000}));
						lines.push(line);

						scene.add( line );
					}
				});

				var geometry = new THREE.Geometry();
					geometry.vertices.push(new THREE.Vector3(.1,0,.1));
					geometry.vertices.push(new THREE.Vector3(0,0,.1));
					geometry.vertices.push(new THREE.Vector3(0,0,0));
					geometry.vertices.push(new THREE.Vector3(.1,0,0));
					geometry.vertices.push(new THREE.Vector3(.1,0,.1));
				car = new THREE.Line( geometry, new THREE.LineBasicMaterial({color:0x000000}));
				car.direction = 5.6240;
				car.steering = 0;
				car.speed = 0;
				console.log(car);

				scene.add( car );
				animate();
			});
			

		    $(document).keydown(function(e){
		      if(e.keyCode == 65 || e.keyCode == 37){
		        leftkey = true;
		      }else if(e.keyCode == 68 || e.keyCode == 39){
		        rightkey = true;

		      }else if(e.keyCode == 87 || e.keyCode == 38){
		        upkey = true;
		        
		      }else if(e.keyCode == 83 || e.keyCode == 40){
		        downkey = true;        
		      }
		      return false;
		    });



		    $(document).keyup(function(e){
		      if(e.keyCode == 65 || e.keyCode == 37){
		        leftkey = false;
		      }else if(e.keyCode == 68 || e.keyCode == 39){
		        rightkey = false;
		      }else if(e.keyCode == 87 || e.keyCode == 38){
		        upkey = false;
		      }else if(e.keyCode == 83 || e.keyCode == 40){
		        downkey = false;        
		      }
		      return false;
		    });
		  

		}

		function onWindowResize() {

			windowHalfX = window.innerWidth / 2;
			windowHalfY = window.innerHeight / 2;

			camera.aspect = window.innerWidth / window.innerHeight;
			camera.updateProjectionMatrix();

			renderer.setSize( window.innerWidth, window.innerHeight );

		}

		function animate() {
			requestAnimationFrame( animate );
			render();
		}

		function render() {
			camera.position.x = 0;
			camera.position.y = 10;
			camera.position.z = 0;
			camera.lookAt(lines[0].geometry.vertices[0]);


		    if(leftkey){
		      if(car.steering<1){ car.steering += 0.01; }
		    }else if(rightkey){
		      if(car.steering>-1){  car.steering -= 0.01; }
		    }else{
		      car.steering *= 0.1;
		    }

		    if(downkey){
		      car.power = 1;
		    }else if(upkey){
		      car.power = -1;
		    }else{
		      car.power = 0;
		    }

		    if(car.speed + car.power){
		      car.speed += car.power;
		    }

		    car.speed *=0.99;

		    car.direction += car.steering;

		    car.position.x += car.speed * -Math.cos(car.direction) * 0.001;
		    car.position.z += car.speed * Math.sin(car.direction) * 0.001;
			console.log(car.position.x,car.position.z)		    
//		    loc.setLatitude(car.latitude);
//		    loc.setLongitude(car.longitude);

		//    console.log(car.latitude, car.longitude, car.direction);
			/*
		    var orientation = model.getOrientation();
		    orientation.setHeading(360-car.direction/Math.PI*180%360);
		    model.setOrientation(orientation);
*/
			renderer.render( scene, camera );
		}
	});
</script>
</head>
<body>

	<div id="data"></div>

</body>
</html><commit_msg>@jin merged with new index.html<commit_after><!DOCTYPE html>
<html>
<head>
	<title>Google Thief Auto</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script src="lib/jquery-1.11.1.min.js"></script>
<script src="lib/three.min.js"></script>
<script src="lib/AssimpJSONLoader.js"></script>
<script src="Physijs/physi.js"></script>
<script>
	'use strict';

	Physijs.scripts.worker = 'Physijs/physijs_worker.js';
	Physijs.scripts.ammo = 'examples/js/ammo.js';

</script>
<script>
  var leftkey = false,
      rightkey = false,
      upkey = false,
      downkey = false;
	$(document).ready(function(){
		var container;
		var camera;
		var scene, renderer, objects;
		var car, object;

		init();

		var lines = [];

		var offsetX, offsetZ;

		function init() {
			container = document.createElement( 'div' );
			document.body.appendChild( container );
			camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
			scene = new Physijs.Scene();


			scene.add( new THREE.AmbientLight( 0xcccccc ) );

			var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee );
			directionalLight.position.x = Math.random() - 0.5;
			directionalLight.position.y = Math.random() - 0.5;
			directionalLight.position.z = Math.random() - 0.5;
			directionalLight.position.normalize();
			scene.add( directionalLight );

			renderer = new THREE.WebGLRenderer();
			renderer.setSize( window.innerWidth, window.innerHeight );
			renderer.setClearColorHex( 0xffffff, 1 );
			container.appendChild( renderer.domElement );

			window.addEventListener( 'resize', onWindowResize, false );

/*
			var loader1 = new THREE.AssimpJSONLoader();
			loader1.load( 'models/assimp/jeep/jeep1.ms3d.json', function ( assimpjson ) {
				assimpjson.updateMatrix();
				scene.add(assimpjson);
			});
*/
			
			$("#data").load('map4.json', function(e){
				var data = $.parseJSON(e);
				$("#data").hide();
				$.each(data.features, function(index, value){
					if(value.properties.building == "yes"){
						var geometry = new THREE.Geometry();
						$.each(value.geometry.coordinates[0], function(index, vertex){
							if(!offsetX){
								offsetX = vertex[0];
								offsetZ = vertex[1];
							}
							geometry.vertices.push(new THREE.Vector3((vertex[0]-offsetX)*1000,0,(vertex[1]-offsetZ)*1000));
						//	console.log(new THREE.Vector3(vertex[0]-offsetX,0,vertex[1]-offsetZ));
						});

						var n = geometry.vertices.length;

						for (x = 0; x < n-2; x++) {
					        geometry.faces.push(new THREE.Face3(0, x + 1, x + 2));
					    }

						material = new THREE.MeshBasicMaterial({color:"#000000",wireframe:true});

						mesh = new THREE.Mesh(geometry, material);
						mesh.geometry.computeBoundingBox ();

						var bBox = mesh.geometry.boundingBox;

						scene.add(mesh);
						lines.push(mesh);

						var geometry = new THREE.Geometry();
							geometry.vertices.push(new THREE.Vector3(bBox.min.x,0,bBox.min.z));
							geometry.vertices.push(new THREE.Vector3(bBox.min.x,0,bBox.max.z));
							geometry.vertices.push(new THREE.Vector3(bBox.max.x,0,bBox.max.z));
							geometry.vertices.push(new THREE.Vector3(bBox.max.x,0,bBox.min.z));

						for (x = 0; x < 2; x++) {
					        geometry.faces.push(new THREE.Face3(0, x + 1, x + 2));
					    }

						material = new THREE.MeshBasicMaterial({color:"#ff0000",wireframe:true});

						bound = new THREE.Mesh(geometry, material);
						scene.add(bound);

					}
				});

				console.log(lines[0]);

				var geometry = new THREE.Geometry();
					geometry.vertices.push(new THREE.Vector3(.2,0,.1));
					geometry.vertices.push(new THREE.Vector3(0,0,.1));
					geometry.vertices.push(new THREE.Vector3(0,0,0));
					geometry.vertices.push(new THREE.Vector3(.2,0,0));
					geometry.vertices.push(new THREE.Vector3(.2,0,.1));
				car = new THREE.Line( geometry, new THREE.LineBasicMaterial({color:0x0000cc}));
				car.direction = 0;
				car.steering = 0;
				car.speed = 0;
				console.log(car);

				scene.add( car );
				animate();
			});
			

		    $(document).keydown(function(e){
		      if(e.keyCode == 65 || e.keyCode == 37){
		        leftkey = true;
		      }else if(e.keyCode == 68 || e.keyCode == 39){
		        rightkey = true;

		      }else if(e.keyCode == 87 || e.keyCode == 38){
		        upkey = true;
		        
		      }else if(e.keyCode == 83 || e.keyCode == 40){
		        downkey = true;        
		      }
		      return false;
		    });



		    $(document).keyup(function(e){
		      if(e.keyCode == 65 || e.keyCode == 37){
		        leftkey = false;
		      }else if(e.keyCode == 68 || e.keyCode == 39){
		        rightkey = false;
		      }else if(e.keyCode == 87 || e.keyCode == 38){
		        upkey = false;
		      }else if(e.keyCode == 83 || e.keyCode == 40){
		        downkey = false;        
		      }
		      return false;
		    });
		  

		}

		function onWindowResize() {

			windowHalfX = window.innerWidth / 2;
			windowHalfY = window.innerHeight / 2;

			camera.aspect = window.innerWidth / window.innerHeight;
			camera.updateProjectionMatrix();

			renderer.setSize( window.innerWidth, window.innerHeight );

		}

		function animate() {
			requestAnimationFrame( animate );
			render();
		}

		function render() {


		    if(leftkey){
		      if(car.steering<0.05){ car.steering += 0.002; }
		    }else if(rightkey){
		      if(car.steering>-0.05){  car.steering -= 0.002; }
		    }else{
		      car.steering *= 0.1;
		    }

		    if(upkey){
		      car.power = 1;
		    }else if(downkey){
		      car.power = -1;
		    }else{
		      car.power = 0;
		    }

		    if(car.speed + car.power){
		      car.speed += car.power;
		    }

		    car.speed *=0.99;

		    car.direction += car.steering;

		    car.position.x += car.speed * -Math.cos(car.direction) * 0.001;
		    car.position.z += car.speed * Math.sin(car.direction) * 0.001;

	        car.rotation.y = car.direction;


			camera.position.x = car.position.x;
			camera.position.y = 1+Math.pow(car.speed,2)/5000;
			camera.position.z = car.position.z;
			camera.lookAt(car.position);

			var distance = Math.sqrt(Math.pow(car.position.x,2)+Math.pow(car.position.z,2));

			if(distance>5){

			}
			renderer.render( scene, camera );
		}
	});
</script>
</head>
<body>

	<div id="data"></div>

</body>
</html>
{'fraction_non_alphanumeric': 0.16680553241126478, 'fraction_numerical': 0.028995167472087986, 'mean_word_length': 2.6695200244573525, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 56, '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': '3244648', 'n_tokens_mistral': 5144, 'n_tokens_neox': 4054, 'n_words': 725}