Ver código fonte

添加依赖引用

rindy 7 anos atrás
pai
commit
c991e50f9e
100 arquivos alterados com 1377425 adições e 1 exclusões
  1. 3 0
      .gitmodules
  2. 6 0
      package-lock.json
  3. 2 1
      package.json
  4. 5 0
      public/index.html
  5. 17 0
      public/static/libs/TweenMax.min.js
  6. 11 0
      public/static/libs/css/animate.css
  7. 4 0
      public/static/libs/jquery.min.js
  8. 282 0
      public/static/libs/threejs/DragControls.js
  9. 793 0
      public/static/libs/threejs/OBJLoader.js
  10. 1039 0
      public/static/libs/threejs/OrbitControls.js
  11. 259 0
      public/static/libs/threejs/ctm/CTMLoader.js
  12. 19 0
      public/static/libs/threejs/ctm/CTMWorker.js
  13. 658 0
      public/static/libs/threejs/ctm/ctm.js
  14. 517 0
      public/static/libs/threejs/ctm/lzma.js
  15. 1 0
      public/static/libs/threejs/dat.gui.css
  16. 13 0
      public/static/libs/threejs/dat.gui.min.js
  17. 521 0
      public/static/libs/threejs/draco/DRACOLoader.js
  18. 32 0
      public/static/libs/threejs/draco/draco_decoder.js
  19. BIN
      public/static/libs/threejs/draco/draco_decoder.wasm
  20. 5 0
      public/static/libs/threejs/stats.min.js
  21. 47349 0
      public/static/libs/threejs/three.js
  22. 949 0
      public/static/libs/threejs/three.min.js
  23. 46939 0
      public/static/libs/threejs/three.module.js
  24. BIN
      public/static/models/KongMingDian - 副本.jpg
  25. BIN
      public/static/models/KongMingDian.jpg
  26. 517895 0
      public/static/models/KongMingDian.obj
  27. BIN
      public/static/models/KongMingDian_2048.jpg
  28. BIN
      public/static/models/KongMingDian_512.jpg
  29. BIN
      public/static/models/LiuBeiDian - 副本.jpg
  30. BIN
      public/static/models/LiuBeiDian.jpg
  31. 374989 0
      public/static/models/LiuBeiDian.obj
  32. BIN
      public/static/models/LiuBeiDian_2048.jpg
  33. BIN
      public/static/models/LiuBeiDian_512.jpg
  34. BIN
      public/static/models/TangBei - 副本.jpg
  35. BIN
      public/static/models/TangBei.jpg
  36. 123286 0
      public/static/models/TangBei.obj
  37. BIN
      public/static/models/TangBei_2048.jpg
  38. BIN
      public/static/models/TangBei_512.jpg
  39. BIN
      public/static/models/WenChenLang - 副本.jpg
  40. BIN
      public/static/models/WenChenLang.jpg
  41. 261775 0
      public/static/models/WenChenLang.obj
  42. BIN
      public/static/models/WenChenLang_2048.jpg
  43. BIN
      public/static/models/WenChenLang_512.jpg
  44. 1 0
      public/static/points/all2(1)_lod10.json
  45. 1 0
      public/static/points/all2(2)_lod10.json
  46. 1 0
      public/static/points/all_lod10.json
  47. 1 0
      public/static/points/di(1)_lod10.json
  48. 1 0
      public/static/points/di(2)_lod10.json
  49. 1 0
      public/static/points/di_lod10.json
  50. 1 0
      public/static/points/fileNames.txt
  51. 1 0
      public/static/points/point_0.json
  52. 1 0
      public/static/points/point_1.json
  53. 1 0
      public/static/points/point_10.json
  54. 1 0
      public/static/points/point_100.json
  55. 1 0
      public/static/points/point_101.json
  56. 1 0
      public/static/points/point_102.json
  57. 1 0
      public/static/points/point_103.json
  58. 1 0
      public/static/points/point_104.json
  59. 1 0
      public/static/points/point_105.json
  60. 1 0
      public/static/points/point_106.json
  61. 1 0
      public/static/points/point_107.json
  62. 1 0
      public/static/points/point_108.json
  63. 1 0
      public/static/points/point_109.json
  64. 1 0
      public/static/points/point_11.json
  65. 1 0
      public/static/points/point_110.json
  66. 1 0
      public/static/points/point_111.json
  67. 1 0
      public/static/points/point_112.json
  68. 1 0
      public/static/points/point_113.json
  69. 1 0
      public/static/points/point_114.json
  70. 1 0
      public/static/points/point_115.json
  71. 1 0
      public/static/points/point_116.json
  72. 1 0
      public/static/points/point_117.json
  73. 1 0
      public/static/points/point_118.json
  74. 1 0
      public/static/points/point_119.json
  75. 1 0
      public/static/points/point_12.json
  76. 1 0
      public/static/points/point_120.json
  77. 1 0
      public/static/points/point_121.json
  78. 1 0
      public/static/points/point_122.json
  79. 1 0
      public/static/points/point_123.json
  80. 1 0
      public/static/points/point_124.json
  81. 1 0
      public/static/points/point_125.json
  82. 1 0
      public/static/points/point_126.json
  83. 1 0
      public/static/points/point_127.json
  84. 1 0
      public/static/points/point_128.json
  85. 1 0
      public/static/points/point_129.json
  86. 1 0
      public/static/points/point_13.json
  87. 1 0
      public/static/points/point_130.json
  88. 1 0
      public/static/points/point_131.json
  89. 1 0
      public/static/points/point_132.json
  90. 1 0
      public/static/points/point_133.json
  91. 1 0
      public/static/points/point_134.json
  92. 1 0
      public/static/points/point_135.json
  93. 1 0
      public/static/points/point_136.json
  94. 1 0
      public/static/points/point_137.json
  95. 1 0
      public/static/points/point_138.json
  96. 1 0
      public/static/points/point_139.json
  97. 1 0
      public/static/points/point_14.json
  98. 1 0
      public/static/points/point_140.json
  99. 1 0
      public/static/points/point_141.json
  100. 0 0
      public/static/points/point_142.json

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "src/wuhouci-core"]
+	path = src/wuhouci-core
+	url = http://192.168.0.115:3000/WebGL/wuhouci-core.git

+ 6 - 0
package-lock.json

@@ -849,6 +849,12 @@
       "integrity": "sha1-SP2YwVYf5xi2FzPa7Ub/EVtJbhg=",
       "dev": true
     },
+    "@types/three": {
+      "version": "0.93.19",
+      "resolved": "http://registry.npm.taobao.org/@types/three/download/@types/three-0.93.19.tgz",
+      "integrity": "sha1-arFt2bBH48S6lCG1kIY6hkRaDcI=",
+      "dev": true
+    },
     "@types/webpack-env": {
       "version": "1.13.6",
       "resolved": "http://registry.npm.taobao.org/@types/webpack-env/download/@types/webpack-env-1.13.6.tgz",

+ 2 - 1
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "start": "vue-cli-service serve",
-	"dev": "vue-cli-service serve",
+    "dev": "vue-cli-service serve",
     "build": "vue-cli-service build"
   },
   "dependencies": {
@@ -13,6 +13,7 @@
     "vuex": "^3.0.1"
   },
   "devDependencies": {
+    "@types/three": "^0.93.19",
     "@vue/cli-plugin-babel": "^3.3.0",
     "@vue/cli-plugin-typescript": "^3.3.0",
     "@vue/cli-service": "^3.3.0",

+ 5 - 0
public/index.html

@@ -7,6 +7,11 @@
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title>武侯祠艺术之旅</title>
+    <script src="static/libs/TweenMax.min.js"></script>
+    <script src="static/libs/threejs/three.min.js"></script>
+    <script src="static/libs/threejs/OrbitControls.js"></script>
+    <script src="static/libs/threejs/stats.min.js"></script>
+    <script src="static/libs/threejs/draco/DRACOLoader.js"></script>
 </head>
 
 <body>

Diferenças do arquivo suprimidas por serem muito extensas
+ 17 - 0
public/static/libs/TweenMax.min.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 11 - 0
public/static/libs/css/animate.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 0
public/static/libs/jquery.min.js


+ 282 - 0
public/static/libs/threejs/DragControls.js

@@ -0,0 +1,282 @@
+/*
+ * @author zz85 / https://github.com/zz85
+ * @author mrdoob / http://mrdoob.com
+ * Running this will allow you to drag three.js objects around the screen.
+ */
+
+THREE.DragControls = function ( _objects, _camera, _domElement ) {
+
+	if ( _objects instanceof THREE.Camera ) {
+
+		console.warn( 'THREE.DragControls: Constructor now expects ( objects, camera, domElement )' );
+		var temp = _objects; _objects = _camera; _camera = temp;
+
+	}
+
+	var _plane = new THREE.Plane();
+	var _raycaster = new THREE.Raycaster();
+
+	var _mouse = new THREE.Vector2();
+	var _offset = new THREE.Vector3();
+	var _intersection = new THREE.Vector3();
+
+	var _selected = null, _hovered = null;
+
+	//
+
+	var scope = this;
+
+	function activate() {
+
+		_domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
+		_domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
+		_domElement.addEventListener( 'mouseup', onDocumentMouseCancel, false );
+		_domElement.addEventListener( 'mouseleave', onDocumentMouseCancel, false );
+		_domElement.addEventListener( 'touchmove', onDocumentTouchMove, false );
+		_domElement.addEventListener( 'touchstart', onDocumentTouchStart, false );
+		_domElement.addEventListener( 'touchend', onDocumentTouchEnd, false );
+
+	}
+
+	function deactivate() {
+
+		_domElement.removeEventListener( 'mousemove', onDocumentMouseMove, false );
+		_domElement.removeEventListener( 'mousedown', onDocumentMouseDown, false );
+		_domElement.removeEventListener( 'mouseup', onDocumentMouseCancel, false );
+		_domElement.removeEventListener( 'mouseleave', onDocumentMouseCancel, false );
+		_domElement.removeEventListener( 'touchmove', onDocumentTouchMove, false );
+		_domElement.removeEventListener( 'touchstart', onDocumentTouchStart, false );
+		_domElement.removeEventListener( 'touchend', onDocumentTouchEnd, false );
+
+	}
+
+	function dispose() {
+
+		deactivate();
+
+	}
+
+	function onDocumentMouseMove( event ) {
+
+		event.preventDefault();
+
+		var rect = _domElement.getBoundingClientRect();
+
+		_mouse.x = ( ( event.clientX - rect.left ) / rect.width ) * 2 - 1;
+		_mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1;
+
+		_raycaster.setFromCamera( _mouse, _camera );
+
+		if ( _selected && scope.enabled ) {
+
+			if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
+
+				_selected.position.copy( _intersection.sub( _offset ) );
+
+			}
+
+			scope.dispatchEvent( { type: 'drag', object: _selected } );
+
+			return;
+
+		}
+
+		_raycaster.setFromCamera( _mouse, _camera );
+
+		var intersects = _raycaster.intersectObjects( _objects );
+
+		if ( intersects.length > 0 ) {
+
+			var object = intersects[ 0 ].object;
+
+			_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), object.position );
+
+			if ( _hovered !== object ) {
+
+				scope.dispatchEvent( { type: 'hoveron', object: object } );
+
+				_domElement.style.cursor = 'pointer';
+				_hovered = object;
+
+			}
+
+		} else {
+
+			if ( _hovered !== null ) {
+
+				scope.dispatchEvent( { type: 'hoveroff', object: _hovered } );
+
+				_domElement.style.cursor = 'auto';
+				_hovered = null;
+
+			}
+
+		}
+
+	}
+
+	function onDocumentMouseDown( event ) {
+
+		event.preventDefault();
+
+		_raycaster.setFromCamera( _mouse, _camera );
+
+		var intersects = _raycaster.intersectObjects( _objects );
+
+		if ( intersects.length > 0 ) {
+
+			_selected = intersects[ 0 ].object;
+
+			if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
+
+				_offset.copy( _intersection ).sub( _selected.position );
+
+			}
+
+			_domElement.style.cursor = 'move';
+
+			scope.dispatchEvent( { type: 'dragstart', object: _selected } );
+
+		}
+
+
+	}
+
+	function onDocumentMouseCancel( event ) {
+
+		event.preventDefault();
+
+		if ( _selected ) {
+
+			scope.dispatchEvent( { type: 'dragend', object: _selected } );
+
+			_selected = null;
+
+		}
+
+		_domElement.style.cursor = _hovered ? 'pointer' : 'auto';
+
+	}
+
+	function onDocumentTouchMove( event ) {
+
+		event.preventDefault();
+		event = event.changedTouches[ 0 ];
+
+		var rect = _domElement.getBoundingClientRect();
+
+		_mouse.x = ( ( event.clientX - rect.left ) / rect.width ) * 2 - 1;
+		_mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1;
+
+		_raycaster.setFromCamera( _mouse, _camera );
+
+		if ( _selected && scope.enabled ) {
+
+			if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
+
+				_selected.position.copy( _intersection.sub( _offset ) );
+
+			}
+
+			scope.dispatchEvent( { type: 'drag', object: _selected } );
+
+			return;
+
+		}
+
+	}
+
+	function onDocumentTouchStart( event ) {
+
+		event.preventDefault();
+		event = event.changedTouches[ 0 ];
+
+		var rect = _domElement.getBoundingClientRect();
+
+		_mouse.x = ( ( event.clientX - rect.left ) / rect.width ) * 2 - 1;
+		_mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1;
+
+		_raycaster.setFromCamera( _mouse, _camera );
+
+		var intersects = _raycaster.intersectObjects( _objects );
+
+		if ( intersects.length > 0 ) {
+
+			_selected = intersects[ 0 ].object;
+
+			_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _selected.position );
+
+			if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
+
+				_offset.copy( _intersection ).sub( _selected.position );
+
+			}
+
+			_domElement.style.cursor = 'move';
+
+			scope.dispatchEvent( { type: 'dragstart', object: _selected } );
+
+		}
+
+
+	}
+
+	function onDocumentTouchEnd( event ) {
+
+		event.preventDefault();
+
+		if ( _selected ) {
+
+			scope.dispatchEvent( { type: 'dragend', object: _selected } );
+
+			_selected = null;
+
+		}
+
+		_domElement.style.cursor = 'auto';
+
+	}
+
+	activate();
+
+	// API
+
+	this.enabled = true;
+
+	this.activate = activate;
+	this.deactivate = deactivate;
+	this.dispose = dispose;
+
+	// Backward compatibility
+
+	this.setObjects = function () {
+
+		console.error( 'THREE.DragControls: setObjects() has been removed.' );
+
+	};
+
+	this.on = function ( type, listener ) {
+
+		console.warn( 'THREE.DragControls: on() has been deprecated. Use addEventListener() instead.' );
+		scope.addEventListener( type, listener );
+
+	};
+
+	this.off = function ( type, listener ) {
+
+		console.warn( 'THREE.DragControls: off() has been deprecated. Use removeEventListener() instead.' );
+		scope.removeEventListener( type, listener );
+
+	};
+
+	this.notify = function ( type ) {
+
+		console.error( 'THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead.' );
+		scope.dispatchEvent( { type: type } );
+
+	};
+
+};
+
+THREE.DragControls.prototype = Object.create( THREE.EventDispatcher.prototype );
+THREE.DragControls.prototype.constructor = THREE.DragControls;

+ 793 - 0
public/static/libs/threejs/OBJLoader.js

@@ -0,0 +1,793 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.OBJLoader = ( function () {
+
+	// o object_name | g group_name
+	var object_pattern = /^[og]\s*(.+)?/;
+	// mtllib file_reference
+	var material_library_pattern = /^mtllib /;
+	// usemtl material_name
+	var material_use_pattern = /^usemtl /;
+
+	function ParserState() {
+
+		var state = {
+			objects: [],
+			object: {},
+
+			vertices: [],
+			normals: [],
+			colors: [],
+			uvs: [],
+
+			materialLibraries: [],
+
+			startObject: function ( name, fromDeclaration ) {
+
+				// If the current object (initial from reset) is not from a g/o declaration in the parsed
+				// file. We need to use it for the first parsed g/o to keep things in sync.
+				if ( this.object && this.object.fromDeclaration === false ) {
+
+					this.object.name = name;
+					this.object.fromDeclaration = ( fromDeclaration !== false );
+					return;
+
+				}
+
+				var previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );
+
+				if ( this.object && typeof this.object._finalize === 'function' ) {
+
+					this.object._finalize( true );
+
+				}
+
+				this.object = {
+					name: name || '',
+					fromDeclaration: ( fromDeclaration !== false ),
+
+					geometry: {
+						vertices: [],
+						normals: [],
+						colors: [],
+						uvs: []
+					},
+					materials: [],
+					smooth: true,
+
+					startMaterial: function ( name, libraries ) {
+
+						var previous = this._finalize( false );
+
+						// New usemtl declaration overwrites an inherited material, except if faces were declared
+						// after the material, then it must be preserved for proper MultiMaterial continuation.
+						if ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {
+
+							this.materials.splice( previous.index, 1 );
+
+						}
+
+						var material = {
+							index: this.materials.length,
+							name: name || '',
+							mtllib: ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),
+							smooth: ( previous !== undefined ? previous.smooth : this.smooth ),
+							groupStart: ( previous !== undefined ? previous.groupEnd : 0 ),
+							groupEnd: - 1,
+							groupCount: - 1,
+							inherited: false,
+
+							clone: function ( index ) {
+
+								var cloned = {
+									index: ( typeof index === 'number' ? index : this.index ),
+									name: this.name,
+									mtllib: this.mtllib,
+									smooth: this.smooth,
+									groupStart: 0,
+									groupEnd: - 1,
+									groupCount: - 1,
+									inherited: false
+								};
+								cloned.clone = this.clone.bind( cloned );
+								return cloned;
+
+							}
+						};
+
+						this.materials.push( material );
+
+						return material;
+
+					},
+
+					currentMaterial: function () {
+
+						if ( this.materials.length > 0 ) {
+
+							return this.materials[ this.materials.length - 1 ];
+
+						}
+
+						return undefined;
+
+					},
+
+					_finalize: function ( end ) {
+
+						var lastMultiMaterial = this.currentMaterial();
+						if ( lastMultiMaterial && lastMultiMaterial.groupEnd === - 1 ) {
+
+							lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;
+							lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;
+							lastMultiMaterial.inherited = false;
+
+						}
+
+						// Ignore objects tail materials if no face declarations followed them before a new o/g started.
+						if ( end && this.materials.length > 1 ) {
+
+							for ( var mi = this.materials.length - 1; mi >= 0; mi -- ) {
+
+								if ( this.materials[ mi ].groupCount <= 0 ) {
+
+									this.materials.splice( mi, 1 );
+
+								}
+
+							}
+
+						}
+
+						// Guarantee at least one empty material, this makes the creation later more straight forward.
+						if ( end && this.materials.length === 0 ) {
+
+							this.materials.push( {
+								name: '',
+								smooth: this.smooth
+							} );
+
+						}
+
+						return lastMultiMaterial;
+
+					}
+				};
+
+				// Inherit previous objects material.
+				// Spec tells us that a declared material must be set to all objects until a new material is declared.
+				// If a usemtl declaration is encountered while this new object is being parsed, it will
+				// overwrite the inherited material. Exception being that there was already face declarations
+				// to the inherited material, then it will be preserved for proper MultiMaterial continuation.
+
+				if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function' ) {
+
+					var declared = previousMaterial.clone( 0 );
+					declared.inherited = true;
+					this.object.materials.push( declared );
+
+				}
+
+				this.objects.push( this.object );
+
+			},
+
+			finalize: function () {
+
+				if ( this.object && typeof this.object._finalize === 'function' ) {
+
+					this.object._finalize( true );
+
+				}
+
+			},
+
+			parseVertexIndex: function ( value, len ) {
+
+				var index = parseInt( value, 10 );
+				return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
+
+			},
+
+			parseNormalIndex: function ( value, len ) {
+
+				var index = parseInt( value, 10 );
+				return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
+
+			},
+
+			parseUVIndex: function ( value, len ) {
+
+				var index = parseInt( value, 10 );
+				return ( index >= 0 ? index - 1 : index + len / 2 ) * 2;
+
+			},
+
+			addVertex: function ( a, b, c ) {
+
+				var src = this.vertices;
+				var dst = this.object.geometry.vertices;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
+				dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );
+				dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );
+
+			},
+
+			addVertexPoint: function ( a ) {
+
+				var src = this.vertices;
+				var dst = this.object.geometry.vertices;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
+
+			},
+
+			addVertexLine: function ( a ) {
+
+				var src = this.vertices;
+				var dst = this.object.geometry.vertices;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
+
+			},
+
+			addNormal: function ( a, b, c ) {
+
+				var src = this.normals;
+				var dst = this.object.geometry.normals;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
+				dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );
+				dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );
+
+			},
+
+			addColor: function ( a, b, c ) {
+
+				var src = this.colors;
+				var dst = this.object.geometry.colors;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
+				dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );
+				dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );
+
+			},
+
+			addUV: function ( a, b, c ) {
+
+				var src = this.uvs;
+				var dst = this.object.geometry.uvs;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ] );
+				dst.push( src[ b + 0 ], src[ b + 1 ] );
+				dst.push( src[ c + 0 ], src[ c + 1 ] );
+
+			},
+
+			addUVLine: function ( a ) {
+
+				var src = this.uvs;
+				var dst = this.object.geometry.uvs;
+
+				dst.push( src[ a + 0 ], src[ a + 1 ] );
+
+			},
+
+			addFace: function ( a, b, c, ua, ub, uc, na, nb, nc ) {
+
+				var vLen = this.vertices.length;
+
+				var ia = this.parseVertexIndex( a, vLen );
+				var ib = this.parseVertexIndex( b, vLen );
+				var ic = this.parseVertexIndex( c, vLen );
+
+				this.addVertex( ia, ib, ic );
+
+				if ( ua !== undefined && ua !== '' ) {
+
+					var uvLen = this.uvs.length;
+					ia = this.parseUVIndex( ua, uvLen );
+					ib = this.parseUVIndex( ub, uvLen );
+					ic = this.parseUVIndex( uc, uvLen );
+					this.addUV( ia, ib, ic );
+
+				}
+
+				if ( na !== undefined && na !== '' ) {
+
+					// Normals are many times the same. If so, skip function call and parseInt.
+					var nLen = this.normals.length;
+					ia = this.parseNormalIndex( na, nLen );
+
+					ib = na === nb ? ia : this.parseNormalIndex( nb, nLen );
+					ic = na === nc ? ia : this.parseNormalIndex( nc, nLen );
+
+					this.addNormal( ia, ib, ic );
+
+				}
+
+				if ( this.colors.length > 0 ) {
+
+					this.addColor( ia, ib, ic );
+
+				}
+
+			},
+
+			addPointGeometry: function ( vertices ) {
+
+				this.object.geometry.type = 'Points';
+
+				var vLen = this.vertices.length;
+
+				for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {
+
+					this.addVertexPoint( this.parseVertexIndex( vertices[ vi ], vLen ) );
+
+				}
+
+			},
+
+			addLineGeometry: function ( vertices, uvs ) {
+
+				this.object.geometry.type = 'Line';
+
+				var vLen = this.vertices.length;
+				var uvLen = this.uvs.length;
+
+				for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {
+
+					this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );
+
+				}
+
+				for ( var uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {
+
+					this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );
+
+				}
+
+			}
+
+		};
+
+		state.startObject( '', false );
+
+		return state;
+
+	}
+
+	//
+
+	function OBJLoader( manager ) {
+
+		this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+
+		this.materials = null;
+
+	}
+
+	OBJLoader.prototype = {
+
+		constructor: OBJLoader,
+
+		load: function ( url, onLoad, onProgress, onError ) {
+
+			var scope = this;
+
+			var loader = new THREE.FileLoader( scope.manager );
+			loader.setPath( this.path );
+			loader.load( url, function ( text ) {
+
+				onLoad( scope.parse( text ) );
+
+			}, onProgress, onError );
+
+		},
+
+		setPath: function ( value ) {
+
+			this.path = value;
+
+			return this;
+
+		},
+
+		setMaterials: function ( materials ) {
+
+			this.materials = materials;
+
+			return this;
+
+		},
+
+		parse: function ( text ) {
+
+			console.time( 'OBJLoader' );
+
+			var state = new ParserState();
+
+			if ( text.indexOf( '\r\n' ) !== - 1 ) {
+
+				// This is faster than String.split with regex that splits on both
+				text = text.replace( /\r\n/g, '\n' );
+
+			}
+
+			if ( text.indexOf( '\\\n' ) !== - 1 ) {
+
+				// join lines separated by a line continuation character (\)
+				text = text.replace( /\\\n/g, '' );
+
+			}
+
+			var lines = text.split( '\n' );
+			var line = '', lineFirstChar = '';
+			var lineLength = 0;
+			var result = [];
+
+			// Faster to just trim left side of the line. Use if available.
+			var trimLeft = ( typeof ''.trimLeft === 'function' );
+
+			for ( var i = 0, l = lines.length; i < l; i ++ ) {
+
+				line = lines[ i ];
+
+				line = trimLeft ? line.trimLeft() : line.trim();
+
+				lineLength = line.length;
+
+				if ( lineLength === 0 ) continue;
+
+				lineFirstChar = line.charAt( 0 );
+
+				// @todo invoke passed in handler if any
+				if ( lineFirstChar === '#' ) continue;
+
+				if ( lineFirstChar === 'v' ) {
+
+					var data = line.split( /\s+/ );
+
+					switch ( data[ 0 ] ) {
+
+						case 'v':
+							state.vertices.push(
+								parseFloat( data[ 1 ] ),
+								parseFloat( data[ 2 ] ),
+								parseFloat( data[ 3 ] )
+							);
+							if ( data.length === 8 ) {
+
+								state.colors.push(
+									parseFloat( data[ 4 ] ),
+									parseFloat( data[ 5 ] ),
+									parseFloat( data[ 6 ] )
+
+								);
+
+							}
+							break;
+						case 'vn':
+							state.normals.push(
+								parseFloat( data[ 1 ] ),
+								parseFloat( data[ 2 ] ),
+								parseFloat( data[ 3 ] )
+							);
+							break;
+						case 'vt':
+							state.uvs.push(
+								parseFloat( data[ 1 ] ),
+								parseFloat( data[ 2 ] )
+							);
+							break;
+
+					}
+
+				} else if ( lineFirstChar === 'f' ) {
+
+					var lineData = line.substr( 1 ).trim();
+					var vertexData = lineData.split( /\s+/ );
+					var faceVertices = [];
+
+					// Parse the face vertex data into an easy to work with format
+
+					for ( var j = 0, jl = vertexData.length; j < jl; j ++ ) {
+
+						var vertex = vertexData[ j ];
+
+						if ( vertex.length > 0 ) {
+
+							var vertexParts = vertex.split( '/' );
+							faceVertices.push( vertexParts );
+
+						}
+
+					}
+
+					// Draw an edge between the first vertex and all subsequent vertices to form an n-gon
+
+					var v1 = faceVertices[ 0 ];
+
+					for ( var j = 1, jl = faceVertices.length - 1; j < jl; j ++ ) {
+
+						var v2 = faceVertices[ j ];
+						var v3 = faceVertices[ j + 1 ];
+
+						state.addFace(
+							v1[ 0 ], v2[ 0 ], v3[ 0 ],
+							v1[ 1 ], v2[ 1 ], v3[ 1 ],
+							v1[ 2 ], v2[ 2 ], v3[ 2 ]
+						);
+
+					}
+
+				} else if ( lineFirstChar === 'l' ) {
+
+					var lineParts = line.substring( 1 ).trim().split( " " );
+					var lineVertices = [], lineUVs = [];
+
+					if ( line.indexOf( "/" ) === - 1 ) {
+
+						lineVertices = lineParts;
+
+					} else {
+
+						for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {
+
+							var parts = lineParts[ li ].split( "/" );
+
+							if ( parts[ 0 ] !== "" ) lineVertices.push( parts[ 0 ] );
+							if ( parts[ 1 ] !== "" ) lineUVs.push( parts[ 1 ] );
+
+						}
+
+					}
+					state.addLineGeometry( lineVertices, lineUVs );
+
+				} else if ( lineFirstChar === 'p' ) {
+
+					var lineData = line.substr( 1 ).trim();
+					var pointData = lineData.split( " " );
+
+					state.addPointGeometry( pointData );
+
+				} else if ( ( result = object_pattern.exec( line ) ) !== null ) {
+
+					// o object_name
+					// or
+					// g group_name
+
+					// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
+					// var name = result[ 0 ].substr( 1 ).trim();
+					var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
+
+					state.startObject( name );
+
+				} else if ( material_use_pattern.test( line ) ) {
+
+					// material
+
+					state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );
+
+				} else if ( material_library_pattern.test( line ) ) {
+
+					// mtl file
+
+					state.materialLibraries.push( line.substring( 7 ).trim() );
+
+				} else if ( lineFirstChar === 's' ) {
+
+					result = line.split( ' ' );
+
+					// smooth shading
+
+					// @todo Handle files that have varying smooth values for a set of faces inside one geometry,
+					// but does not define a usemtl for each face set.
+					// This should be detected and a dummy material created (later MultiMaterial and geometry groups).
+					// This requires some care to not create extra material on each smooth value for "normal" obj files.
+					// where explicit usemtl defines geometry groups.
+					// Example asset: examples/models/obj/cerberus/Cerberus.obj
+
+					/*
+					 * http://paulbourke.net/dataformats/obj/
+					 * or
+					 * http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf
+					 *
+					 * From chapter "Grouping" Syntax explanation "s group_number":
+					 * "group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.
+					 * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form
+					 * surfaces, smoothing groups are either turned on or off; there is no difference between values greater
+					 * than 0."
+					 */
+					if ( result.length > 1 ) {
+
+						var value = result[ 1 ].trim().toLowerCase();
+						state.object.smooth = ( value !== '0' && value !== 'off' );
+
+					} else {
+
+						// ZBrush can produce "s" lines #11707
+						state.object.smooth = true;
+
+					}
+					var material = state.object.currentMaterial();
+					if ( material ) material.smooth = state.object.smooth;
+
+				} else {
+
+					// Handle null terminated files without exception
+					if ( line === '\0' ) continue;
+
+					throw new Error( 'THREE.OBJLoader: Unexpected line: "' + line + '"' );
+
+				}
+
+			}
+
+			state.finalize();
+
+			var container = new THREE.Group();
+			container.materialLibraries = [].concat( state.materialLibraries );
+
+			for ( var i = 0, l = state.objects.length; i < l; i ++ ) {
+
+				var object = state.objects[ i ];
+				var geometry = object.geometry;
+				var materials = object.materials;
+				var isLine = ( geometry.type === 'Line' );
+				var isPoints = ( geometry.type === 'Points' );
+				var hasVertexColors = false;
+
+				// Skip o/g line declarations that did not follow with any faces
+				if ( geometry.vertices.length === 0 ) continue;
+
+				var buffergeometry = new THREE.BufferGeometry();
+
+				buffergeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( geometry.vertices, 3 ) );
+
+				if ( geometry.normals.length > 0 ) {
+
+					buffergeometry.addAttribute( 'normal', new THREE.Float32BufferAttribute( geometry.normals, 3 ) );
+
+				} else {
+
+					buffergeometry.computeVertexNormals();
+
+				}
+
+				if ( geometry.colors.length > 0 ) {
+
+					hasVertexColors = true;
+					buffergeometry.addAttribute( 'color', new THREE.Float32BufferAttribute( geometry.colors, 3 ) );
+
+				}
+
+				if ( geometry.uvs.length > 0 ) {
+
+					buffergeometry.addAttribute( 'uv', new THREE.Float32BufferAttribute( geometry.uvs, 2 ) );
+
+				}
+
+				// Create materials
+
+				var createdMaterials = [];
+
+				for ( var mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {
+
+					var sourceMaterial = materials[ mi ];
+					var material = undefined;
+
+					if ( this.materials !== null ) {
+
+						material = this.materials.create( sourceMaterial.name );
+
+						// mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.
+						if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {
+
+							var materialLine = new THREE.LineBasicMaterial();
+							materialLine.copy( material );
+							materialLine.lights = false; // TOFIX
+							material = materialLine;
+
+						} else if ( isPoints && material && ! ( material instanceof THREE.PointsMaterial ) ) {
+
+							var materialPoints = new THREE.PointsMaterial( { size: 10, sizeAttenuation: false } );
+							materialLine.copy( material );
+							material = materialPoints;
+
+						}
+
+					}
+
+					if ( ! material ) {
+
+						if ( isLine ) {
+
+							material = new THREE.LineBasicMaterial();
+
+						} else if ( isPoints ) {
+
+							material = new THREE.PointsMaterial( { size: 1, sizeAttenuation: false } );
+
+						} else {
+
+							material = new THREE.MeshPhongMaterial();
+
+						}
+
+						material.name = sourceMaterial.name;
+
+					}
+
+					material.flatShading = sourceMaterial.smooth ? false : true;
+					material.vertexColors = hasVertexColors ? THREE.VertexColors : THREE.NoColors;
+
+					createdMaterials.push( material );
+
+				}
+
+				// Create mesh
+
+				var mesh;
+
+				if ( createdMaterials.length > 1 ) {
+
+					for ( var mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {
+
+						var sourceMaterial = materials[ mi ];
+						buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );
+
+					}
+
+					if ( isLine ) {
+
+						mesh = new THREE.LineSegments( buffergeometry, createdMaterials );
+
+					} else if ( isPoints ) {
+
+						mesh = new THREE.Points( buffergeometry, createdMaterials );
+
+					} else {
+
+						mesh = new THREE.Mesh( buffergeometry, createdMaterials );
+
+					}
+
+				} else {
+
+					if ( isLine ) {
+
+						mesh = new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] );
+
+					} else if ( isPoints ) {
+
+						mesh = new THREE.Points( buffergeometry, createdMaterials[ 0 ] );
+
+					} else {
+
+						mesh = new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] );
+
+					}
+
+				}
+
+				mesh.name = object.name;
+
+				container.add( mesh );
+
+			}
+
+			console.timeEnd( 'OBJLoader' );
+
+			return container;
+
+		}
+
+	};
+
+	return OBJLoader;
+
+} )();

Diferenças do arquivo suprimidas por serem muito extensas
+ 1039 - 0
public/static/libs/threejs/OrbitControls.js


+ 259 - 0
public/static/libs/threejs/ctm/CTMLoader.js

@@ -0,0 +1,259 @@
+/**
+ * Loader for CTM encoded models generated by OpenCTM tools:
+ *	http://openctm.sourceforge.net/
+ *
+ * Uses js-openctm library by Juan Mellado
+ *	http://code.google.com/p/js-openctm/
+ *
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.CTMLoader = function () {
+
+	THREE.Loader.call( this );
+
+};
+
+THREE.CTMLoader.prototype = Object.create( THREE.Loader.prototype );
+THREE.CTMLoader.prototype.constructor = THREE.CTMLoader;
+
+// Load multiple CTM parts defined in JSON
+
+THREE.CTMLoader.prototype.loadParts = function ( url, callback, parameters ) {
+
+	parameters = parameters || {};
+
+	var scope = this;
+
+	var xhr = new XMLHttpRequest();
+
+	var basePath = parameters.basePath ? parameters.basePath : THREE.LoaderUtils.extractUrlBase( url );
+
+	xhr.onreadystatechange = function () {
+
+		if ( xhr.readyState === 4 ) {
+
+			if ( xhr.status === 200 || xhr.status === 0 ) {
+
+				var jsonObject = JSON.parse( xhr.responseText );
+
+				var materials = [], geometries = [], counter = 0;
+
+				function callbackFinal( geometry ) {
+
+					counter += 1;
+
+					geometries.push( geometry );
+
+					if ( counter === jsonObject.offsets.length ) {
+
+						callback( geometries, materials );
+
+					}
+
+				}
+
+
+				// init materials
+
+				for ( var i = 0; i < jsonObject.materials.length; i ++ ) {
+
+					materials[ i ] = scope.createMaterial( jsonObject.materials[ i ], basePath );
+
+				}
+
+				// load joined CTM file
+
+				var partUrl = basePath + jsonObject.data;
+				var parametersPart = { useWorker: parameters.useWorker, worker: parameters.worker, offsets: jsonObject.offsets };
+				scope.load( partUrl, callbackFinal, parametersPart );
+
+			}
+
+		}
+
+	};
+
+	xhr.open( "GET", url, true );
+	xhr.setRequestHeader( "Content-Type", "text/plain" );
+	xhr.send( null );
+
+};
+
+// Load CTMLoader compressed models
+//	- parameters
+//		- url (required)
+//		- callback (required)
+
+THREE.CTMLoader.prototype.load = function ( url, callback, parameters ) {
+
+	parameters = parameters || {};
+
+	var scope = this;
+
+	var offsets = parameters.offsets !== undefined ? parameters.offsets : [ 0 ];
+
+	var xhr = new XMLHttpRequest(),
+		callbackProgress = null;
+
+	var length = 0;
+
+	xhr.onreadystatechange = function () {
+
+		if ( xhr.readyState === 4 ) {
+
+			if ( xhr.status === 200 || xhr.status === 0 ) {
+
+				var binaryData = new Uint8Array( xhr.response );
+
+				var s = Date.now();
+
+				if ( parameters.useWorker ) {
+
+					var worker = parameters.worker || new Worker( 'static/public/threejs/ctm/CTMWorker.js' );
+
+					worker.onmessage = function ( event ) {
+
+						var files = event.data;
+
+						for ( var i = 0; i < files.length; i ++ ) {
+
+							var ctmFile = files[ i ];
+
+							var e1 = Date.now();
+							// console.log( "CTM data parse time [worker]: " + (e1-s) + " ms" );
+
+							scope.createModel( ctmFile, callback );
+
+							var e = Date.now();
+							console.log( "model load time [worker]: " + ( e - e1 ) + " ms, total: " + ( e - s ) );
+
+						}
+
+
+					};
+
+					worker.postMessage( { "data": binaryData, "offsets": offsets }, [ binaryData.buffer ] );
+
+				} else {
+
+					for ( var i = 0; i < offsets.length; i ++ ) {
+
+						var stream = new CTM.Stream( binaryData );
+						stream.offset = offsets[ i ];
+
+						var ctmFile = new CTM.File( stream );
+
+						scope.createModel( ctmFile, callback );
+
+					}
+
+					//var e = Date.now();
+					//console.log( "CTM data parse time [inline]: " + (e-s) + " ms" );
+
+				}
+
+			} else {
+
+				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+
+			}
+
+		} else if ( xhr.readyState === 3 ) {
+
+			if ( callbackProgress ) {
+
+				if ( length === 0 ) {
+
+					length = xhr.getResponseHeader( "Content-Length" );
+
+				}
+
+				callbackProgress( { total: length, loaded: xhr.responseText.length } );
+
+			}
+
+		} else if ( xhr.readyState === 2 ) {
+
+			length = xhr.getResponseHeader( "Content-Length" );
+
+		}
+
+	};
+
+	xhr.open( "GET", url, true );
+	xhr.responseType = "arraybuffer";
+
+	xhr.send( null );
+
+};
+
+
+THREE.CTMLoader.prototype.createModel = function ( file, callback ) {
+
+	var Model = function () {
+
+		THREE.BufferGeometry.call( this );
+
+		this.materials = [];
+
+		var indices = file.body.indices;
+		var positions = file.body.vertices;
+		var normals = file.body.normals;
+
+		var uvs, colors;
+
+		var uvMaps = file.body.uvMaps;
+
+		if ( uvMaps !== undefined && uvMaps.length > 0 ) {
+
+			uvs = uvMaps[ 0 ].uv;
+
+		}
+
+		var attrMaps = file.body.attrMaps;
+
+		if ( attrMaps !== undefined && attrMaps.length > 0 && attrMaps[ 0 ].name === 'Color' ) {
+
+			colors = attrMaps[ 0 ].attr;
+
+		}
+
+		this.setIndex( new THREE.BufferAttribute( indices, 1 ) );
+		this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
+
+		if ( normals !== undefined ) {
+
+			this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
+
+		}
+
+		if ( uvs !== undefined ) {
+
+			this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
+
+		}
+
+		if ( colors !== undefined ) {
+
+			this.addAttribute( 'color', new THREE.BufferAttribute( colors, 4 ) );
+
+		}
+
+	};
+
+	Model.prototype = Object.create( THREE.BufferGeometry.prototype );
+	Model.prototype.constructor = Model;
+
+	var geometry = new Model();
+
+	// compute vertex normals if not present in the CTM model
+	if ( geometry.attributes.normal === undefined ) {
+
+		geometry.computeVertexNormals();
+
+	}
+
+	callback( geometry );
+
+};

+ 19 - 0
public/static/libs/threejs/ctm/CTMWorker.js

@@ -0,0 +1,19 @@
+importScripts( "lzma.js", "ctm.js" );
+
+self.onmessage = function ( event ) {
+
+	var files = [];
+
+	for ( var i = 0; i < event.data.offsets.length; i ++ ) {
+
+		var stream = new CTM.Stream( event.data.data );
+		stream.offset = event.data.offsets[ i ];
+
+		files[ i ] = new CTM.File( stream, [ event.data.data.buffer ] );
+
+	}
+
+	self.postMessage( files );
+	self.close();
+
+};

+ 658 - 0
public/static/libs/threejs/ctm/ctm.js

@@ -0,0 +1,658 @@
+/*
+Copyright (c) 2011 Juan Mellado
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+/*
+References:
+- "OpenCTM: The Open Compressed Triangle Mesh file format" by Marcus Geelnard
+  http://openctm.sourceforge.net/
+*/
+
+var CTM = CTM || {};
+
+// browserify support
+if ( typeof module === 'object' ) {
+
+	module.exports = CTM;
+
+}
+
+CTM.CompressionMethod = {
+  RAW: 0x00574152,
+  MG1: 0x0031474d,
+  MG2: 0x0032474d
+};
+
+CTM.Flags = {
+  NORMALS: 0x00000001
+};
+
+CTM.File = function(stream) {
+	this.load(stream);
+};
+
+CTM.File.prototype.load = function(stream) {
+	this.header = new CTM.FileHeader(stream);
+
+	this.body = new CTM.FileBody(this.header);
+
+	this.getReader().read(stream, this.body);
+};
+
+CTM.File.prototype.getReader = function() {
+	var reader;
+
+	switch (this.header.compressionMethod){
+		case CTM.CompressionMethod.RAW:
+			reader = new CTM.ReaderRAW();
+			break;
+		case CTM.CompressionMethod.MG1:
+			reader = new CTM.ReaderMG1();
+			break;
+		case CTM.CompressionMethod.MG2:
+			reader = new CTM.ReaderMG2();
+			break;
+	}
+
+	return reader;
+};
+
+CTM.FileHeader = function(stream) {
+	stream.readInt32(); //magic "OCTM"
+	this.fileFormat = stream.readInt32();
+	this.compressionMethod = stream.readInt32();
+	this.vertexCount = stream.readInt32();
+	this.triangleCount = stream.readInt32();
+	this.uvMapCount = stream.readInt32();
+	this.attrMapCount = stream.readInt32();
+	this.flags = stream.readInt32();
+	this.comment = stream.readString();
+};
+
+CTM.FileHeader.prototype.hasNormals = function() {
+	return this.flags & CTM.Flags.NORMALS;
+};
+
+CTM.FileBody = function(header) {
+	var i = header.triangleCount * 3,
+      v = header.vertexCount * 3,
+      n = header.hasNormals() ? header.vertexCount * 3 : 0,
+      u = header.vertexCount * 2,
+      a = header.vertexCount * 4,
+      j = 0;
+
+	var data = new ArrayBuffer(
+    (i + v + n + (u * header.uvMapCount) + (a * header.attrMapCount) ) * 4);
+
+	this.indices = new Uint32Array(data, 0, i);
+
+	this.vertices = new Float32Array(data, i * 4, v);
+
+	if ( header.hasNormals() ) {
+		this.normals = new Float32Array(data, (i + v) * 4, n);
+	}
+
+	if (header.uvMapCount) {
+		this.uvMaps = [];
+		for (j = 0; j < header.uvMapCount; ++ j) {
+			this.uvMaps[j] = { uv: new Float32Array(data,
+        (i + v + n + (j * u) ) * 4, u) };
+		}
+	}
+
+	if (header.attrMapCount) {
+		this.attrMaps = [];
+		for (j = 0; j < header.attrMapCount; ++ j) {
+			this.attrMaps[j] = { attr: new Float32Array(data,
+        (i + v + n + (u * header.uvMapCount) + (j * a) ) * 4, a) };
+		}
+	}
+};
+
+CTM.FileMG2Header = function(stream) {
+	stream.readInt32(); //magic "MG2H"
+	this.vertexPrecision = stream.readFloat32();
+	this.normalPrecision = stream.readFloat32();
+	this.lowerBoundx = stream.readFloat32();
+	this.lowerBoundy = stream.readFloat32();
+	this.lowerBoundz = stream.readFloat32();
+	this.higherBoundx = stream.readFloat32();
+	this.higherBoundy = stream.readFloat32();
+	this.higherBoundz = stream.readFloat32();
+	this.divx = stream.readInt32();
+	this.divy = stream.readInt32();
+	this.divz = stream.readInt32();
+
+	this.sizex = (this.higherBoundx - this.lowerBoundx) / this.divx;
+	this.sizey = (this.higherBoundy - this.lowerBoundy) / this.divy;
+	this.sizez = (this.higherBoundz - this.lowerBoundz) / this.divz;
+};
+
+CTM.ReaderRAW = function() {
+};
+
+CTM.ReaderRAW.prototype.read = function(stream, body) {
+	this.readIndices(stream, body.indices);
+	this.readVertices(stream, body.vertices);
+
+	if (body.normals) {
+		this.readNormals(stream, body.normals);
+	}
+	if (body.uvMaps) {
+		this.readUVMaps(stream, body.uvMaps);
+	}
+	if (body.attrMaps) {
+		this.readAttrMaps(stream, body.attrMaps);
+	}
+};
+
+CTM.ReaderRAW.prototype.readIndices = function(stream, indices) {
+	stream.readInt32(); //magic "INDX"
+	stream.readArrayInt32(indices);
+};
+
+CTM.ReaderRAW.prototype.readVertices = function(stream, vertices) {
+	stream.readInt32(); //magic "VERT"
+	stream.readArrayFloat32(vertices);
+};
+
+CTM.ReaderRAW.prototype.readNormals = function(stream, normals) {
+	stream.readInt32(); //magic "NORM"
+	stream.readArrayFloat32(normals);
+};
+
+CTM.ReaderRAW.prototype.readUVMaps = function(stream, uvMaps) {
+	var i = 0;
+	for (; i < uvMaps.length; ++ i) {
+		stream.readInt32(); //magic "TEXC"
+
+		uvMaps[i].name = stream.readString();
+		uvMaps[i].filename = stream.readString();
+		stream.readArrayFloat32(uvMaps[i].uv);
+	}
+};
+
+CTM.ReaderRAW.prototype.readAttrMaps = function(stream, attrMaps) {
+	var i = 0;
+	for (; i < attrMaps.length; ++ i) {
+		stream.readInt32(); //magic "ATTR"
+
+		attrMaps[i].name = stream.readString();
+		stream.readArrayFloat32(attrMaps[i].attr);
+	}
+};
+
+CTM.ReaderMG1 = function() {
+};
+
+CTM.ReaderMG1.prototype.read = function(stream, body) {
+	this.readIndices(stream, body.indices);
+	this.readVertices(stream, body.vertices);
+
+	if (body.normals) {
+		this.readNormals(stream, body.normals);
+	}
+	if (body.uvMaps) {
+		this.readUVMaps(stream, body.uvMaps);
+	}
+	if (body.attrMaps) {
+		this.readAttrMaps(stream, body.attrMaps);
+	}
+};
+
+CTM.ReaderMG1.prototype.readIndices = function(stream, indices) {
+	stream.readInt32(); //magic "INDX"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(indices, 3);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+	CTM.restoreIndices(indices, indices.length);
+};
+
+CTM.ReaderMG1.prototype.readVertices = function(stream, vertices) {
+	stream.readInt32(); //magic "VERT"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(vertices, 1);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+};
+
+CTM.ReaderMG1.prototype.readNormals = function(stream, normals) {
+	stream.readInt32(); //magic "NORM"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(normals, 3);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+};
+
+CTM.ReaderMG1.prototype.readUVMaps = function(stream, uvMaps) {
+	var i = 0;
+	for (; i < uvMaps.length; ++ i) {
+		stream.readInt32(); //magic "TEXC"
+
+		uvMaps[i].name = stream.readString();
+		uvMaps[i].filename = stream.readString();
+
+		stream.readInt32(); //packed size
+
+		var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);
+		LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+	}
+};
+
+CTM.ReaderMG1.prototype.readAttrMaps = function(stream, attrMaps) {
+	var i = 0;
+	for (; i < attrMaps.length; ++ i) {
+		stream.readInt32(); //magic "ATTR"
+
+		attrMaps[i].name = stream.readString();
+
+		stream.readInt32(); //packed size
+
+		var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);
+		LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+	}
+};
+
+CTM.ReaderMG2 = function() {
+};
+
+CTM.ReaderMG2.prototype.read = function(stream, body) {
+	this.MG2Header = new CTM.FileMG2Header(stream);
+
+	this.readVertices(stream, body.vertices);
+	this.readIndices(stream, body.indices);
+
+	if (body.normals) {
+		this.readNormals(stream, body);
+	}
+	if (body.uvMaps) {
+		this.readUVMaps(stream, body.uvMaps);
+	}
+	if (body.attrMaps) {
+		this.readAttrMaps(stream, body.attrMaps);
+	}
+};
+
+CTM.ReaderMG2.prototype.readVertices = function(stream, vertices) {
+	stream.readInt32(); //magic "VERT"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(vertices, 3);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+	var gridIndices = this.readGridIndices(stream, vertices);
+
+	CTM.restoreVertices(vertices, this.MG2Header, gridIndices, this.MG2Header.vertexPrecision);
+};
+
+CTM.ReaderMG2.prototype.readGridIndices = function(stream, vertices) {
+	stream.readInt32(); //magic "GIDX"
+	stream.readInt32(); //packed size
+
+	var gridIndices = new Uint32Array(vertices.length / 3);
+
+	var interleaved = new CTM.InterleavedStream(gridIndices, 1);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+	CTM.restoreGridIndices(gridIndices, gridIndices.length);
+
+	return gridIndices;
+};
+
+CTM.ReaderMG2.prototype.readIndices = function(stream, indices) {
+	stream.readInt32(); //magic "INDX"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(indices, 3);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+	CTM.restoreIndices(indices, indices.length);
+};
+
+CTM.ReaderMG2.prototype.readNormals = function(stream, body) {
+	stream.readInt32(); //magic "NORM"
+	stream.readInt32(); //packed size
+
+	var interleaved = new CTM.InterleavedStream(body.normals, 3);
+	LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+	var smooth = CTM.calcSmoothNormals(body.indices, body.vertices);
+
+	CTM.restoreNormals(body.normals, smooth, this.MG2Header.normalPrecision);
+};
+
+CTM.ReaderMG2.prototype.readUVMaps = function(stream, uvMaps) {
+	var i = 0;
+	for (; i < uvMaps.length; ++ i) {
+		stream.readInt32(); //magic "TEXC"
+
+		uvMaps[i].name = stream.readString();
+		uvMaps[i].filename = stream.readString();
+
+		var precision = stream.readFloat32();
+
+		stream.readInt32(); //packed size
+
+		var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);
+		LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+		CTM.restoreMap(uvMaps[i].uv, 2, precision);
+	}
+};
+
+CTM.ReaderMG2.prototype.readAttrMaps = function(stream, attrMaps) {
+	var i = 0;
+	for (; i < attrMaps.length; ++ i) {
+		stream.readInt32(); //magic "ATTR"
+
+		attrMaps[i].name = stream.readString();
+
+		var precision = stream.readFloat32();
+
+		stream.readInt32(); //packed size
+
+		var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);
+		LZMA.decompress(stream, stream, interleaved, interleaved.data.length);
+
+		CTM.restoreMap(attrMaps[i].attr, 4, precision);
+	}
+};
+
+CTM.restoreIndices = function(indices, len) {
+	var i = 3;
+	if (len > 0) {
+		indices[2] += indices[0];
+		indices[1] += indices[0];
+	}
+	for (; i < len; i += 3) {
+		indices[i] += indices[i - 3];
+
+		if (indices[i] === indices[i - 3]) {
+			indices[i + 1] += indices[i - 2];
+		}else {
+			indices[i + 1] += indices[i];
+		}
+
+		indices[i + 2] += indices[i];
+	}
+};
+
+CTM.restoreGridIndices = function(gridIndices, len) {
+	var i = 1;
+	for (; i < len; ++ i) {
+		gridIndices[i] += gridIndices[i - 1];
+	}
+};
+
+CTM.restoreVertices = function(vertices, grid, gridIndices, precision) {
+	var gridIdx, delta, x, y, z,
+      intVertices = new Uint32Array(vertices.buffer, vertices.byteOffset, vertices.length),
+      ydiv = grid.divx, zdiv = ydiv * grid.divy,
+      prevGridIdx = 0x7fffffff, prevDelta = 0,
+      i = 0, j = 0, len = gridIndices.length;
+
+	for (; i < len; j += 3) {
+		x = gridIdx = gridIndices[i ++];
+
+		z = ~~(x / zdiv);
+		x -= ~~(z * zdiv);
+		y = ~~(x / ydiv);
+		x -= ~~(y * ydiv);
+
+		delta = intVertices[j];
+		if (gridIdx === prevGridIdx) {
+			delta += prevDelta;
+		}
+
+		vertices[j]     = grid.lowerBoundx +
+      x * grid.sizex + precision * delta;
+		vertices[j + 1] = grid.lowerBoundy +
+      y * grid.sizey + precision * intVertices[j + 1];
+		vertices[j + 2] = grid.lowerBoundz +
+      z * grid.sizez + precision * intVertices[j + 2];
+
+		prevGridIdx = gridIdx;
+		prevDelta = delta;
+	}
+};
+
+CTM.restoreNormals = function(normals, smooth, precision) {
+	var ro, phi, theta, sinPhi,
+      nx, ny, nz, by, bz, len,
+      intNormals = new Uint32Array(normals.buffer, normals.byteOffset, normals.length),
+      i = 0, k = normals.length,
+      PI_DIV_2 = 3.141592653589793238462643 * 0.5;
+
+	for (; i < k; i += 3) {
+		ro = intNormals[i] * precision;
+		phi = intNormals[i + 1];
+
+		if (phi === 0) {
+			normals[i]     = smooth[i]     * ro;
+			normals[i + 1] = smooth[i + 1] * ro;
+			normals[i + 2] = smooth[i + 2] * ro;
+		}else {
+
+			if (phi <= 4) {
+				theta = (intNormals[i + 2] - 2) * PI_DIV_2;
+			}else {
+				theta = ( (intNormals[i + 2] * 4 / phi) - 2) * PI_DIV_2;
+			}
+
+			phi *= precision * PI_DIV_2;
+			sinPhi = ro * Math.sin(phi);
+
+			nx = sinPhi * Math.cos(theta);
+			ny = sinPhi * Math.sin(theta);
+			nz = ro * Math.cos(phi);
+
+			bz = smooth[i + 1];
+			by = smooth[i] - smooth[i + 2];
+
+			len = Math.sqrt(2 * bz * bz + by * by);
+			if (len > 1e-20) {
+				by /= len;
+				bz /= len;
+			}
+
+			normals[i] = smooth[i] * nz + (smooth[i + 1] * bz - smooth[i + 2] * by) * ny - bz * nx;
+			normals[i + 1] = smooth[i + 1] * nz - (smooth[i + 2] + smooth[i]) * bz  * ny + by * nx;
+			normals[i + 2] = smooth[i + 2] * nz + (smooth[i] * by + smooth[i + 1] * bz) * ny + bz * nx;
+		}
+	}
+};
+
+CTM.restoreMap = function(map, count, precision) {
+	var delta, value,
+      intMap = new Uint32Array(map.buffer, map.byteOffset, map.length),
+      i = 0, j, len = map.length;
+
+	for (; i < count; ++ i) {
+		delta = 0;
+
+		for (j = i; j < len; j += count) {
+			value = intMap[j];
+
+			delta += value & 1 ? -( (value + 1) >> 1) : value >> 1;
+
+			map[j] = delta * precision;
+		}
+	}
+};
+
+CTM.calcSmoothNormals = function(indices, vertices) {
+	var smooth = new Float32Array(vertices.length),
+      indx, indy, indz, nx, ny, nz,
+      v1x, v1y, v1z, v2x, v2y, v2z, len,
+      i, k;
+
+	for (i = 0, k = indices.length; i < k;) {
+		indx = indices[i ++] * 3;
+		indy = indices[i ++] * 3;
+		indz = indices[i ++] * 3;
+
+		v1x = vertices[indy]     - vertices[indx];
+		v2x = vertices[indz]     - vertices[indx];
+		v1y = vertices[indy + 1] - vertices[indx + 1];
+		v2y = vertices[indz + 1] - vertices[indx + 1];
+		v1z = vertices[indy + 2] - vertices[indx + 2];
+		v2z = vertices[indz + 2] - vertices[indx + 2];
+
+		nx = v1y * v2z - v1z * v2y;
+		ny = v1z * v2x - v1x * v2z;
+		nz = v1x * v2y - v1y * v2x;
+
+		len = Math.sqrt(nx * nx + ny * ny + nz * nz);
+		if (len > 1e-10) {
+			nx /= len;
+			ny /= len;
+			nz /= len;
+		}
+
+		smooth[indx]     += nx;
+		smooth[indx + 1] += ny;
+		smooth[indx + 2] += nz;
+		smooth[indy]     += nx;
+		smooth[indy + 1] += ny;
+		smooth[indy + 2] += nz;
+		smooth[indz]     += nx;
+		smooth[indz + 1] += ny;
+		smooth[indz + 2] += nz;
+	}
+
+	for (i = 0, k = smooth.length; i < k; i += 3) {
+		len = Math.sqrt(smooth[i] * smooth[i] +
+      smooth[i + 1] * smooth[i + 1] +
+      smooth[i + 2] * smooth[i + 2]);
+
+		if (len > 1e-10) {
+			smooth[i]     /= len;
+			smooth[i + 1] /= len;
+			smooth[i + 2] /= len;
+		}
+	}
+
+	return smooth;
+};
+
+CTM.isLittleEndian = (function() {
+	var buffer = new ArrayBuffer(2),
+      bytes = new Uint8Array(buffer),
+      ints = new Uint16Array(buffer);
+
+	bytes[0] = 1;
+
+	return ints[0] === 1;
+}());
+
+CTM.InterleavedStream = function(data, count) {
+	this.data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
+	this.offset = CTM.isLittleEndian ? 3 : 0;
+	this.count = count * 4;
+	this.len = this.data.length;
+};
+
+CTM.InterleavedStream.prototype.writeByte = function(value) {
+	this.data[this.offset] = value;
+
+	this.offset += this.count;
+	if (this.offset >= this.len) {
+
+		this.offset -= this.len - 4;
+		if (this.offset >= this.count) {
+
+			this.offset -= this.count + (CTM.isLittleEndian ? 1 : -1);
+		}
+	}
+};
+
+CTM.Stream = function(data) {
+	this.data = data;
+	this.offset = 0;
+};
+
+CTM.Stream.prototype.TWO_POW_MINUS23 = Math.pow(2, -23);
+
+CTM.Stream.prototype.TWO_POW_MINUS126 = Math.pow(2, -126);
+
+CTM.Stream.prototype.readByte = function() {
+	return this.data[this.offset ++] & 0xff;
+};
+
+CTM.Stream.prototype.readInt32 = function() {
+	var i = this.readByte();
+	i |= this.readByte() << 8;
+	i |= this.readByte() << 16;
+	return i | (this.readByte() << 24);
+};
+
+CTM.Stream.prototype.readFloat32 = function() {
+	var m = this.readByte();
+	m += this.readByte() << 8;
+
+	var b1 = this.readByte();
+	var b2 = this.readByte();
+
+	m += (b1 & 0x7f) << 16;
+	var e = ( (b2 & 0x7f) << 1) | ( (b1 & 0x80) >>> 7);
+	var s = b2 & 0x80 ? -1 : 1;
+
+	if (e === 255) {
+		return m !== 0 ? NaN : s * Infinity;
+	}
+	if (e > 0) {
+		return s * (1 + (m * this.TWO_POW_MINUS23) ) * Math.pow(2, e - 127);
+	}
+	if (m !== 0) {
+		return s * m * this.TWO_POW_MINUS126;
+	}
+	return s * 0;
+};
+
+CTM.Stream.prototype.readString = function() {
+	var len = this.readInt32();
+
+	this.offset += len;
+
+	return String.fromCharCode.apply(null, this.data.subarray(this.offset - len, this.offset));
+};
+
+CTM.Stream.prototype.readArrayInt32 = function(array) {
+	var i = 0, len = array.length;
+
+	while (i < len) {
+		array[i ++] = this.readInt32();
+	}
+
+	return array;
+};
+
+CTM.Stream.prototype.readArrayFloat32 = function(array) {
+	var i = 0, len = array.length;
+
+	while (i < len) {
+		array[i ++] = this.readFloat32();
+	}
+
+	return array;
+};

+ 517 - 0
public/static/libs/threejs/ctm/lzma.js

@@ -0,0 +1,517 @@
+
+var LZMA = LZMA || {};
+
+// browserify support
+if ( typeof module === 'object' ) {
+
+	module.exports = LZMA;
+
+}
+
+LZMA.OutWindow = function() {
+	this._windowSize = 0;
+};
+
+LZMA.OutWindow.prototype.create = function(windowSize) {
+	if ( (!this._buffer) || (this._windowSize !== windowSize) ) {
+		this._buffer = [];
+	}
+	this._windowSize = windowSize;
+	this._pos = 0;
+	this._streamPos = 0;
+};
+
+LZMA.OutWindow.prototype.flush = function() {
+	var size = this._pos - this._streamPos;
+	if (size !== 0) {
+		while (size --) {
+			this._stream.writeByte(this._buffer[this._streamPos ++]);
+		}
+		if (this._pos >= this._windowSize) {
+			this._pos = 0;
+		}
+		this._streamPos = this._pos;
+	}
+};
+
+LZMA.OutWindow.prototype.releaseStream = function() {
+	this.flush();
+	this._stream = null;
+};
+
+LZMA.OutWindow.prototype.setStream = function(stream) {
+	this.releaseStream();
+	this._stream = stream;
+};
+
+LZMA.OutWindow.prototype.init = function(solid) {
+	if (!solid) {
+		this._streamPos = 0;
+		this._pos = 0;
+	}
+};
+
+LZMA.OutWindow.prototype.copyBlock = function(distance, len) {
+	var pos = this._pos - distance - 1;
+	if (pos < 0) {
+		pos += this._windowSize;
+	}
+	while (len --) {
+		if (pos >= this._windowSize) {
+			pos = 0;
+		}
+		this._buffer[this._pos ++] = this._buffer[pos ++];
+		if (this._pos >= this._windowSize) {
+			this.flush();
+		}
+	}
+};
+
+LZMA.OutWindow.prototype.putByte = function(b) {
+	this._buffer[this._pos ++] = b;
+	if (this._pos >= this._windowSize) {
+		this.flush();
+	}
+};
+
+LZMA.OutWindow.prototype.getByte = function(distance) {
+	var pos = this._pos - distance - 1;
+	if (pos < 0) {
+		pos += this._windowSize;
+	}
+	return this._buffer[pos];
+};
+
+LZMA.RangeDecoder = function() {
+};
+
+LZMA.RangeDecoder.prototype.setStream = function(stream) {
+	this._stream = stream;
+};
+
+LZMA.RangeDecoder.prototype.releaseStream = function() {
+	this._stream = null;
+};
+
+LZMA.RangeDecoder.prototype.init = function() {
+	var i = 5;
+
+	this._code = 0;
+	this._range = -1;
+  
+	while (i --) {
+		this._code = (this._code << 8) | this._stream.readByte();
+	}
+};
+
+LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits) {
+	var result = 0, i = numTotalBits, t;
+
+	while (i --) {
+		this._range >>>= 1;
+		t = (this._code - this._range) >>> 31;
+		this._code -= this._range & (t - 1);
+		result = (result << 1) | (1 - t);
+
+		if ( (this._range & 0xff000000) === 0) {
+			this._code = (this._code << 8) | this._stream.readByte();
+			this._range <<= 8;
+		}
+	}
+
+	return result;
+};
+
+LZMA.RangeDecoder.prototype.decodeBit = function(probs, index) {
+	var prob = probs[index],
+      newBound = (this._range >>> 11) * prob;
+
+	if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ) {
+		this._range = newBound;
+		probs[index] += (2048 - prob) >>> 5;
+		if ( (this._range & 0xff000000) === 0) {
+			this._code = (this._code << 8) | this._stream.readByte();
+			this._range <<= 8;
+		}
+		return 0;
+	}
+
+	this._range -= newBound;
+	this._code -= newBound;
+	probs[index] -= prob >>> 5;
+	if ( (this._range & 0xff000000) === 0) {
+		this._code = (this._code << 8) | this._stream.readByte();
+		this._range <<= 8;
+	}
+	return 1;
+};
+
+LZMA.initBitModels = function(probs, len) {
+	while (len --) {
+		probs[len] = 1024;
+	}
+};
+
+LZMA.BitTreeDecoder = function(numBitLevels) {
+	this._models = [];
+	this._numBitLevels = numBitLevels;
+};
+
+LZMA.BitTreeDecoder.prototype.init = function() {
+	LZMA.initBitModels(this._models, 1 << this._numBitLevels);
+};
+
+LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder) {
+	var m = 1, i = this._numBitLevels;
+
+	while (i --) {
+		m = (m << 1) | rangeDecoder.decodeBit(this._models, m);
+	}
+	return m - (1 << this._numBitLevels);
+};
+
+LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder) {
+	var m = 1, symbol = 0, i = 0, bit;
+
+	for (; i < this._numBitLevels; ++ i) {
+		bit = rangeDecoder.decodeBit(this._models, m);
+		m = (m << 1) | bit;
+		symbol |= bit << i;
+	}
+	return symbol;
+};
+
+LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels) {
+	var m = 1, symbol = 0, i = 0, bit;
+
+	for (; i < numBitLevels; ++ i) {
+		bit = rangeDecoder.decodeBit(models, startIndex + m);
+		m = (m << 1) | bit;
+		symbol |= bit << i;
+	}
+	return symbol;
+};
+
+LZMA.LenDecoder = function() {
+	this._choice = [];
+	this._lowCoder = [];
+	this._midCoder = [];
+	this._highCoder = new LZMA.BitTreeDecoder(8);
+	this._numPosStates = 0;
+};
+
+LZMA.LenDecoder.prototype.create = function(numPosStates) {
+	for (; this._numPosStates < numPosStates; ++ this._numPosStates) {
+		this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);
+		this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);
+	}
+};
+
+LZMA.LenDecoder.prototype.init = function() {
+	var i = this._numPosStates;
+	LZMA.initBitModels(this._choice, 2);
+	while (i --) {
+		this._lowCoder[i].init();
+		this._midCoder[i].init();
+	}
+	this._highCoder.init();
+};
+
+LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState) {
+	if (rangeDecoder.decodeBit(this._choice, 0) === 0) {
+		return this._lowCoder[posState].decode(rangeDecoder);
+	}
+	if (rangeDecoder.decodeBit(this._choice, 1) === 0) {
+		return 8 + this._midCoder[posState].decode(rangeDecoder);
+	}
+	return 16 + this._highCoder.decode(rangeDecoder);
+};
+
+LZMA.Decoder2 = function() {
+	this._decoders = [];
+};
+
+LZMA.Decoder2.prototype.init = function() {
+	LZMA.initBitModels(this._decoders, 0x300);
+};
+
+LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder) {
+	var symbol = 1;
+
+	do {
+		symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);
+	}while (symbol < 0x100);
+
+	return symbol & 0xff;
+};
+
+LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte) {
+	var symbol = 1, matchBit, bit;
+
+	do {
+		matchBit = (matchByte >> 7) & 1;
+		matchByte <<= 1;
+		bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);
+		symbol = (symbol << 1) | bit;
+		if (matchBit !== bit) {
+			while (symbol < 0x100) {
+				symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);
+			}
+			break;
+		}
+	}while (symbol < 0x100);
+
+	return symbol & 0xff;
+};
+
+LZMA.LiteralDecoder = function() {
+};
+
+LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits) {
+	var i;
+
+	if (this._coders
+    && (this._numPrevBits === numPrevBits)
+    && (this._numPosBits === numPosBits) ) {
+		return;
+	}
+	this._numPosBits = numPosBits;
+	this._posMask = (1 << numPosBits) - 1;
+	this._numPrevBits = numPrevBits;
+
+	this._coders = [];
+
+	i = 1 << (this._numPrevBits + this._numPosBits);
+	while (i --) {
+		this._coders[i] = new LZMA.Decoder2();
+	}
+};
+
+LZMA.LiteralDecoder.prototype.init = function() {
+	var i = 1 << (this._numPrevBits + this._numPosBits);
+	while (i --) {
+		this._coders[i].init();
+	}
+};
+
+LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte) {
+	return this._coders[( (pos & this._posMask) << this._numPrevBits)
+    + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];
+};
+
+LZMA.Decoder = function() {
+	this._outWindow = new LZMA.OutWindow();
+	this._rangeDecoder = new LZMA.RangeDecoder();
+	this._isMatchDecoders = [];
+	this._isRepDecoders = [];
+	this._isRepG0Decoders = [];
+	this._isRepG1Decoders = [];
+	this._isRepG2Decoders = [];
+	this._isRep0LongDecoders = [];
+	this._posSlotDecoder = [];
+	this._posDecoders = [];
+	this._posAlignDecoder = new LZMA.BitTreeDecoder(4);
+	this._lenDecoder = new LZMA.LenDecoder();
+	this._repLenDecoder = new LZMA.LenDecoder();
+	this._literalDecoder = new LZMA.LiteralDecoder();
+	this._dictionarySize = -1;
+	this._dictionarySizeCheck = -1;
+
+	this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);
+	this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);
+	this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);
+	this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);
+};
+
+LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize) {
+	if (dictionarySize < 0) {
+		return false;
+	}
+	if (this._dictionarySize !== dictionarySize) {
+		this._dictionarySize = dictionarySize;
+		this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);
+		this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );
+	}
+	return true;
+};
+
+LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb) {
+	var numPosStates = 1 << pb;
+
+	if (lc > 8 || lp > 4 || pb > 4) {
+		return false;
+	}
+
+	this._literalDecoder.create(lp, lc);
+
+	this._lenDecoder.create(numPosStates);
+	this._repLenDecoder.create(numPosStates);
+	this._posStateMask = numPosStates - 1;
+
+	return true;
+};
+
+LZMA.Decoder.prototype.init = function() {
+	var i = 4;
+
+	this._outWindow.init(false);
+
+	LZMA.initBitModels(this._isMatchDecoders, 192);
+	LZMA.initBitModels(this._isRep0LongDecoders, 192);
+	LZMA.initBitModels(this._isRepDecoders, 12);
+	LZMA.initBitModels(this._isRepG0Decoders, 12);
+	LZMA.initBitModels(this._isRepG1Decoders, 12);
+	LZMA.initBitModels(this._isRepG2Decoders, 12);
+	LZMA.initBitModels(this._posDecoders, 114);
+
+	this._literalDecoder.init();
+
+	while (i --) {
+		this._posSlotDecoder[i].init();
+	}
+
+	this._lenDecoder.init();
+	this._repLenDecoder.init();
+	this._posAlignDecoder.init();
+	this._rangeDecoder.init();
+};
+
+LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize) {
+	var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,
+      posState, decoder2, len, distance, posSlot, numDirectBits;
+
+	this._rangeDecoder.setStream(inStream);
+	this._outWindow.setStream(outStream);
+
+	this.init();
+
+	while (outSize < 0 || nowPos64 < outSize) {
+		posState = nowPos64 & this._posStateMask;
+
+		if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0) {
+			decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);
+
+			if (state >= 7) {
+				prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );
+			}else {
+				prevByte = decoder2.decodeNormal(this._rangeDecoder);
+			}
+			this._outWindow.putByte(prevByte);
+
+			state = state < 4 ? 0 : state - (state < 10 ? 3 : 6);
+
+		}else {
+
+			if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1) {
+				len = 0;
+				if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0) {
+					if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0) {
+						state = state < 7 ? 9 : 11;
+						len = 1;
+					}
+				}else {
+					if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0) {
+						distance = rep1;
+					}else {
+						if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0) {
+							distance = rep2;
+						}else {
+							distance = rep3;
+							rep3 = rep2;
+						}
+						rep2 = rep1;
+					}
+					rep1 = rep0;
+					rep0 = distance;
+				}
+				if (len === 0) {
+					len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);
+					state = state < 7 ? 8 : 11;
+				}
+			}else {
+				rep3 = rep2;
+				rep2 = rep1;
+				rep1 = rep0;
+
+				len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);
+				state = state < 7 ? 7 : 10;
+
+				posSlot = this._posSlotDecoder[len <= 5 ? len - 2 : 3].decode(this._rangeDecoder);
+				if (posSlot >= 4) {
+
+					numDirectBits = (posSlot >> 1) - 1;
+					rep0 = (2 | (posSlot & 1) ) << numDirectBits;
+
+					if (posSlot < 14) {
+						rep0 += LZMA.reverseDecode2(this._posDecoders,
+                rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);
+					}else {
+						rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;
+						rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);
+						if (rep0 < 0) {
+							if (rep0 === -1) {
+								break;
+							}
+							return false;
+						}
+					}
+				}else {
+					rep0 = posSlot;
+				}
+			}
+
+			if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck) {
+				return false;
+			}
+
+			this._outWindow.copyBlock(rep0, len);
+			nowPos64 += len;
+			prevByte = this._outWindow.getByte(0);
+		}
+	}
+
+	this._outWindow.flush();
+	this._outWindow.releaseStream();
+	this._rangeDecoder.releaseStream();
+
+	return true;
+};
+
+LZMA.Decoder.prototype.setDecoderProperties = function(properties) {
+	var value, lc, lp, pb, dictionarySize;
+
+	if (properties.size < 5) {
+		return false;
+	}
+
+	value = properties.readByte();
+	lc = value % 9;
+	value = ~~(value / 9);
+	lp = value % 5;
+	pb = ~~(value / 5);
+
+	if ( !this.setLcLpPb(lc, lp, pb) ) {
+		return false;
+	}
+
+	dictionarySize = properties.readByte();
+	dictionarySize |= properties.readByte() << 8;
+	dictionarySize |= properties.readByte() << 16;
+	dictionarySize += properties.readByte() * 16777216;
+
+	return this.setDictionarySize(dictionarySize);
+};
+
+LZMA.decompress = function(properties, inStream, outStream, outSize) {
+	var decoder = new LZMA.Decoder();
+
+	if ( !decoder.setDecoderProperties(properties) ) {
+		throw "Incorrect stream properties";
+	}
+
+	if ( !decoder.decode(inStream, outStream, outSize) ) {
+		throw "Error in data stream";
+	}
+
+	return true;
+};

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/libs/threejs/dat.gui.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 13 - 0
public/static/libs/threejs/dat.gui.min.js


+ 521 - 0
public/static/libs/threejs/draco/DRACOLoader.js

@@ -0,0 +1,521 @@
+// Copyright 2016 The Draco Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+'use strict';
+
+/**
+ * @param {THREE.LoadingManager} manager
+ */
+THREE.DRACOLoader = function(manager) {
+    this.timeLoaded = 0;
+    this.manager = manager || THREE.DefaultLoadingManager;
+    this.materials = null;
+    this.verbosity = 0;
+    this.attributeOptions = {};
+    this.drawMode = THREE.TrianglesDrawMode;
+    // Native Draco attribute type to Three.JS attribute type.
+    this.nativeAttributeMap = {
+      'position' : 'POSITION',
+      'normal' : 'NORMAL',
+      'color' : 'COLOR',
+      'uv' : 'TEX_COORD'
+    };
+};
+
+THREE.DRACOLoader.prototype = {
+
+    constructor: THREE.DRACOLoader,
+
+    load: function(url, onLoad, onProgress, onError) {
+        var scope = this;
+        var loader = new THREE.FileLoader(scope.manager);
+        loader.setPath(this.path);
+        loader.setResponseType('arraybuffer');
+        loader.load(url, function(blob) {
+            scope.decodeDracoFile(blob, onLoad);
+        }, onProgress, onError);
+    },
+
+    setPath: function(value) {
+        this.path = value;
+        return this;
+    },
+
+    setVerbosity: function(level) {
+        this.verbosity = level;
+        return this;
+    },
+
+    /**
+     *  Sets desired mode for generated geometry indices.
+     *  Can be either:
+     *      THREE.TrianglesDrawMode
+     *      THREE.TriangleStripDrawMode
+     */
+    setDrawMode: function(drawMode) {
+        this.drawMode = drawMode;
+        return this;
+    },
+
+    /**
+     * Skips dequantization for a specific attribute.
+     * |attributeName| is the THREE.js name of the given attribute type.
+     * The only currently supported |attributeName| is 'position', more may be
+     * added in future.
+     */
+    setSkipDequantization: function(attributeName, skip) {
+        var skipDequantization = true;
+        if (typeof skip !== 'undefined')
+          skipDequantization = skip;
+        this.getAttributeOptions(attributeName).skipDequantization =
+            skipDequantization;
+        return this;
+    },
+
+    /**
+     * Decompresses a Draco buffer. Names of attributes (for ID and type maps)
+     * must be one of the supported three.js types, including: position, color,
+     * normal, uv, uv2, skinIndex, skinWeight.
+     *
+     * @param {ArrayBuffer} rawBuffer
+     * @param {Function} callback
+     * @param {Object|undefined} attributeUniqueIdMap Provides a pre-defined ID
+     *     for each attribute in the geometry to be decoded. If given,
+     *     `attributeTypeMap` is required and `nativeAttributeMap` will be
+     *     ignored.
+     * @param {Object|undefined} attributeTypeMap Provides a predefined data
+     *     type (as a typed array constructor) for each attribute in the
+     *     geometry to be decoded.
+     */
+    decodeDracoFile: function(rawBuffer, callback, attributeUniqueIdMap,
+                              attributeTypeMap) {
+      var scope = this;
+      THREE.DRACOLoader.getDecoderModule()
+          .then( function ( module ) {
+            scope.decodeDracoFileInternal( rawBuffer, module.decoder, callback,
+              attributeUniqueIdMap, attributeTypeMap);
+          });
+    },
+
+    decodeDracoFileInternal: function(rawBuffer, dracoDecoder, callback,
+                                      attributeUniqueIdMap, attributeTypeMap) {
+      /*
+       * Here is how to use Draco Javascript decoder and get the geometry.
+       */
+      var buffer = new dracoDecoder.DecoderBuffer();
+      buffer.Init(new Int8Array(rawBuffer), rawBuffer.byteLength);
+      var decoder = new dracoDecoder.Decoder();
+
+      /*
+       * Determine what type is this file: mesh or point cloud.
+       */
+      var geometryType = decoder.GetEncodedGeometryType(buffer);
+      if (geometryType == dracoDecoder.TRIANGULAR_MESH) {
+        if (this.verbosity > 0) {
+          console.log('Loaded a mesh.');
+        }
+      } else if (geometryType == dracoDecoder.POINT_CLOUD) {
+        if (this.verbosity > 0) {
+          console.log('Loaded a point cloud.');
+        }
+      } else {
+        var errorMsg = 'THREE.DRACOLoader: Unknown geometry type.';
+        console.error(errorMsg);
+        throw new Error(errorMsg);
+      }
+      callback(this.convertDracoGeometryTo3JS(dracoDecoder, decoder,
+          geometryType, buffer, attributeUniqueIdMap, attributeTypeMap));
+    },
+
+    addAttributeToGeometry: function(dracoDecoder, decoder, dracoGeometry,
+                                     attributeName, attributeType, attribute,
+                                     geometry, geometryBuffer) {
+      if (attribute.ptr === 0) {
+        var errorMsg = 'THREE.DRACOLoader: No attribute ' + attributeName;
+        console.error(errorMsg);
+        throw new Error(errorMsg);
+      }
+
+      var numComponents = attribute.num_components();
+      var numPoints = dracoGeometry.num_points();
+      var numValues = numPoints * numComponents;
+      var attributeData;
+      var TypedBufferAttribute;
+
+      switch ( attributeType ) {
+
+        case Float32Array:
+          attributeData = new dracoDecoder.DracoFloat32Array();
+          decoder.GetAttributeFloatForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Float32Array( numValues );
+          TypedBufferAttribute = THREE.Float32BufferAttribute;
+          break;
+
+        case Int8Array:
+          attributeData = new dracoDecoder.DracoInt8Array();
+          decoder.GetAttributeInt8ForAllPoints(
+            dracoGeometry, attribute, attributeData );
+          geometryBuffer[ attributeName ] = new Int8Array( numValues );
+          TypedBufferAttribute = THREE.Int8BufferAttribute;
+          break;
+
+        case Int16Array:
+          attributeData = new dracoDecoder.DracoInt16Array();
+          decoder.GetAttributeInt16ForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Int16Array( numValues );
+          TypedBufferAttribute = THREE.Int16BufferAttribute;
+          break;
+
+        case Int32Array:
+          attributeData = new dracoDecoder.DracoInt32Array();
+          decoder.GetAttributeInt32ForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Int32Array( numValues );
+          TypedBufferAttribute = THREE.Int32BufferAttribute;
+          break;
+
+        case Uint8Array:
+          attributeData = new dracoDecoder.DracoUInt8Array();
+          decoder.GetAttributeUInt8ForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Uint8Array( numValues );
+          TypedBufferAttribute = THREE.Uint8BufferAttribute;
+          break;
+
+        case Uint16Array:
+          attributeData = new dracoDecoder.DracoUInt16Array();
+          decoder.GetAttributeUInt16ForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Uint16Array( numValues );
+          TypedBufferAttribute = THREE.Uint16BufferAttribute;
+          break;
+
+        case Uint32Array:
+          attributeData = new dracoDecoder.DracoUInt32Array();
+          decoder.GetAttributeUInt32ForAllPoints(
+            dracoGeometry, attribute, attributeData);
+          geometryBuffer[ attributeName ] = new Uint32Array( numValues );
+          TypedBufferAttribute = THREE.Uint32BufferAttribute;
+          break;
+
+        default:
+          var errorMsg = 'THREE.DRACOLoader: Unexpected attribute type.';
+          console.error( errorMsg );
+          throw new Error( errorMsg );
+
+      }
+
+      // Copy data from decoder.
+      for (var i = 0; i < numValues; i++) {
+        geometryBuffer[attributeName][i] = attributeData.GetValue(i);
+      }
+      // Add attribute to THREEJS geometry for rendering.
+      geometry.addAttribute(attributeName,
+          new TypedBufferAttribute(geometryBuffer[attributeName],
+            numComponents));
+      dracoDecoder.destroy(attributeData);
+    },
+
+    convertDracoGeometryTo3JS: function(dracoDecoder, decoder, geometryType,
+                                        buffer, attributeUniqueIdMap,
+                                        attributeTypeMap) {
+        // TODO: Should not assume native Draco attribute IDs apply.
+        if (this.getAttributeOptions('position').skipDequantization === true) {
+          decoder.SkipAttributeTransform(dracoDecoder.POSITION);
+        }
+        var dracoGeometry;
+        var decodingStatus;
+        var start_time = performance.now();
+        if (geometryType === dracoDecoder.TRIANGULAR_MESH) {
+          dracoGeometry = new dracoDecoder.Mesh();
+          decodingStatus = decoder.DecodeBufferToMesh(buffer, dracoGeometry);
+        } else {
+          dracoGeometry = new dracoDecoder.PointCloud();
+          decodingStatus =
+              decoder.DecodeBufferToPointCloud(buffer, dracoGeometry);
+        }
+        if (!decodingStatus.ok() || dracoGeometry.ptr == 0) {
+          var errorMsg = 'THREE.DRACOLoader: Decoding failed: ';
+          errorMsg += decodingStatus.error_msg();
+          console.error(errorMsg);
+          dracoDecoder.destroy(decoder);
+          dracoDecoder.destroy(dracoGeometry);
+          throw new Error(errorMsg);
+        }
+
+        var decode_end = performance.now();
+        dracoDecoder.destroy(buffer);
+        /*
+         * Example on how to retrieve mesh and attributes.
+         */
+        var numFaces;
+        if (geometryType == dracoDecoder.TRIANGULAR_MESH) {
+          numFaces = dracoGeometry.num_faces();
+          if (this.verbosity > 0) {
+            console.log('Number of faces loaded: ' + numFaces.toString());
+          }
+        } else {
+          numFaces = 0;
+        }
+
+        var numPoints = dracoGeometry.num_points();
+        var numAttributes = dracoGeometry.num_attributes();
+        if (this.verbosity > 0) {
+          console.log('Number of points loaded: ' + numPoints.toString());
+          console.log('Number of attributes loaded: ' +
+              numAttributes.toString());
+        }
+
+        // Verify if there is position attribute.
+        // TODO: Should not assume native Draco attribute IDs apply.
+        var posAttId = decoder.GetAttributeId(dracoGeometry,
+                                              dracoDecoder.POSITION);
+        if (posAttId == -1) {
+          var errorMsg = 'THREE.DRACOLoader: No position attribute found.';
+          console.error(errorMsg);
+          dracoDecoder.destroy(decoder);
+          dracoDecoder.destroy(dracoGeometry);
+          throw new Error(errorMsg);
+        }
+        var posAttribute = decoder.GetAttribute(dracoGeometry, posAttId);
+
+        // Structure for converting to THREEJS geometry later.
+        var geometryBuffer = {};
+        // Import data to Three JS geometry.
+        var geometry = new THREE.BufferGeometry();
+
+        // Do not use both the native attribute map and a provided (e.g. glTF) map.
+        if ( attributeUniqueIdMap ) {
+
+          // Add attributes of user specified unique id. E.g. GLTF models.
+          for (var attributeName in attributeUniqueIdMap) {
+            var attributeType = attributeTypeMap[attributeName];
+            var attributeId = attributeUniqueIdMap[attributeName];
+            var attribute = decoder.GetAttributeByUniqueId(dracoGeometry,
+                                                           attributeId);
+            this.addAttributeToGeometry(dracoDecoder, decoder, dracoGeometry,
+                attributeName, attributeType, attribute, geometry, geometryBuffer);
+          }
+
+        } else {
+
+          // Add native Draco attribute type to geometry.
+          for (var attributeName in this.nativeAttributeMap) {
+            var attId = decoder.GetAttributeId(dracoGeometry,
+                dracoDecoder[this.nativeAttributeMap[attributeName]]);
+            if (attId !== -1) {
+              if (this.verbosity > 0) {
+                console.log('Loaded ' + attributeName + ' attribute.');
+              }
+              var attribute = decoder.GetAttribute(dracoGeometry, attId);
+              this.addAttributeToGeometry(dracoDecoder, decoder, dracoGeometry,
+                  attributeName, Float32Array, attribute, geometry, geometryBuffer);
+            }
+          }
+
+        }
+
+        // For mesh, we need to generate the faces.
+        if (geometryType == dracoDecoder.TRIANGULAR_MESH) {
+          if (this.drawMode === THREE.TriangleStripDrawMode) {
+            var stripsArray = new dracoDecoder.DracoInt32Array();
+            var numStrips = decoder.GetTriangleStripsFromMesh(
+                dracoGeometry, stripsArray);
+            geometryBuffer.indices = new Uint32Array(stripsArray.size());
+            for (var i = 0; i < stripsArray.size(); ++i) {
+              geometryBuffer.indices[i] = stripsArray.GetValue(i);
+            }
+            dracoDecoder.destroy(stripsArray);
+          } else {
+            var numIndices = numFaces * 3;
+            geometryBuffer.indices = new Uint32Array(numIndices);
+            var ia = new dracoDecoder.DracoInt32Array();
+            for (var i = 0; i < numFaces; ++i) {
+              decoder.GetFaceFromMesh(dracoGeometry, i, ia);
+              var index = i * 3;
+              geometryBuffer.indices[index] = ia.GetValue(0);
+              geometryBuffer.indices[index + 1] = ia.GetValue(1);
+              geometryBuffer.indices[index + 2] = ia.GetValue(2);
+            }
+            dracoDecoder.destroy(ia);
+         }
+        }
+
+        geometry.drawMode = this.drawMode;
+        if (geometryType == dracoDecoder.TRIANGULAR_MESH) {
+          geometry.setIndex(new(geometryBuffer.indices.length > 65535 ?
+                THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute)
+              (geometryBuffer.indices, 1));
+        }
+
+        // TODO: Should not assume native Draco attribute IDs apply.
+        // TODO: Can other attribute types be quantized?
+        var posTransform = new dracoDecoder.AttributeQuantizationTransform();
+        if (posTransform.InitFromAttribute(posAttribute)) {
+          // Quantized attribute. Store the quantization parameters into the
+          // THREE.js attribute.
+          geometry.attributes['position'].isQuantized = true;
+          geometry.attributes['position'].maxRange = posTransform.range();
+          geometry.attributes['position'].numQuantizationBits =
+              posTransform.quantization_bits();
+          geometry.attributes['position'].minValues = new Float32Array(3);
+          for (var i = 0; i < 3; ++i) {
+            geometry.attributes['position'].minValues[i] =
+                posTransform.min_value(i);
+          }
+        }
+        dracoDecoder.destroy(posTransform);
+        dracoDecoder.destroy(decoder);
+        dracoDecoder.destroy(dracoGeometry);
+
+        this.decode_time = decode_end - start_time;
+        this.import_time = performance.now() - decode_end;
+
+        if (this.verbosity > 0) {
+          console.log('Decode time: ' + this.decode_time);
+          console.log('Import time: ' + this.import_time);
+        }
+        return geometry;
+    },
+
+    isVersionSupported: function(version, callback) {
+        THREE.DRACOLoader.getDecoderModule()
+            .then( function ( module ) {
+              callback( module.decoder.isVersionSupported( version ) );
+            });
+    },
+
+    getAttributeOptions: function(attributeName) {
+        if (typeof this.attributeOptions[attributeName] === 'undefined')
+          this.attributeOptions[attributeName] = {};
+        return this.attributeOptions[attributeName];
+    }
+};
+
+THREE.DRACOLoader.decoderPath = './';
+THREE.DRACOLoader.decoderConfig = {};
+THREE.DRACOLoader.decoderModulePromise = null;
+
+/**
+ * Sets the base path for decoder source files.
+ * @param {string} path
+ */
+THREE.DRACOLoader.setDecoderPath = function ( path ) {
+  THREE.DRACOLoader.decoderPath = path;
+};
+
+/**
+ * Sets decoder configuration and releases singleton decoder module. Module
+ * will be recreated with the next decoding call.
+ * @param {Object} config
+ */
+THREE.DRACOLoader.setDecoderConfig = function ( config ) {
+  var wasmBinary = THREE.DRACOLoader.decoderConfig.wasmBinary;
+  THREE.DRACOLoader.decoderConfig = config || {};
+  THREE.DRACOLoader.releaseDecoderModule();
+
+  // Reuse WASM binary.
+  if ( wasmBinary ) THREE.DRACOLoader.decoderConfig.wasmBinary = wasmBinary;
+};
+
+/**
+ * Releases the singleton DracoDecoderModule instance. Module will be recreated
+ * with the next decoding call.
+ */
+THREE.DRACOLoader.releaseDecoderModule = function () {
+  THREE.DRACOLoader.decoderModulePromise = null;
+};
+
+/**
+ * Gets WebAssembly or asm.js singleton instance of DracoDecoderModule
+ * after testing for browser support. Returns Promise that resolves when
+ * module is available.
+ * @return {Promise<{decoder: DracoDecoderModule}>}
+ */
+THREE.DRACOLoader.getDecoderModule = function () {
+  var scope = this;
+  var path = THREE.DRACOLoader.decoderPath;
+  var config = THREE.DRACOLoader.decoderConfig;
+  var promise = THREE.DRACOLoader.decoderModulePromise;
+
+  if ( promise ) return promise;
+
+  // Load source files.
+  if ( typeof DracoDecoderModule !== 'undefined' ) {
+    // Loaded externally.
+    promise = Promise.resolve();
+  } else if ( typeof WebAssembly !== 'object' || config.type === 'js' ) {
+    // Load with asm.js.
+    promise = THREE.DRACOLoader._loadScript( path + 'draco_decoder.js' );
+  } else {
+    // Load with WebAssembly.
+    config.wasmBinaryFile = path + 'draco_decoder.wasm';
+    promise = THREE.DRACOLoader._loadScript( path + 'draco_wasm_wrapper.js' )
+        .then( function () {
+          return THREE.DRACOLoader._loadArrayBuffer( config.wasmBinaryFile );
+        } )
+        .then( function ( wasmBinary ) {
+          config.wasmBinary = wasmBinary;
+        } );
+  }
+
+  // Wait for source files, then create and return a decoder.
+  promise = promise.then( function () {
+    return new Promise( function ( resolve ) {
+      config.onModuleLoaded = function ( decoder ) {
+        scope.timeLoaded = performance.now();
+        // Module is Promise-like. Wrap before resolving to avoid loop.
+        resolve( { decoder: decoder } );
+      };
+      DracoDecoderModule( config );
+    } );
+  } );
+
+  THREE.DRACOLoader.decoderModulePromise = promise;
+  return promise;
+};
+
+/**
+ * @param {string} src
+ * @return {Promise}
+ */
+THREE.DRACOLoader._loadScript = function ( src ) {
+  var prevScript = document.getElementById( 'decoder_script' );
+  if ( prevScript !== null ) {
+    prevScript.parentNode.removeChild( prevScript );
+  }
+  var head = document.getElementsByTagName( 'head' )[ 0 ];
+  var script = document.createElement( 'script' );
+  script.id = 'decoder_script';
+  script.type = 'text/javascript';
+  script.src = src;
+  return new Promise( function ( resolve ) {
+    script.onload = resolve;
+    head.appendChild( script );
+  });
+};
+
+/**
+ * @param {string} src
+ * @return {Promise}
+ */
+THREE.DRACOLoader._loadArrayBuffer = function ( src ) {
+  var loader = new THREE.FileLoader();
+  loader.setResponseType( 'arraybuffer' );
+  return new Promise( function( resolve, reject ) {
+    loader.load( src, resolve, undefined, reject );
+  });
+};

Diferenças do arquivo suprimidas por serem muito extensas
+ 32 - 0
public/static/libs/threejs/draco/draco_decoder.js


BIN
public/static/libs/threejs/draco/draco_decoder.wasm


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
public/static/libs/threejs/stats.min.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 47349 - 0
public/static/libs/threejs/three.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 949 - 0
public/static/libs/threejs/three.min.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 46939 - 0
public/static/libs/threejs/three.module.js


BIN
public/static/models/KongMingDian - 副本.jpg


BIN
public/static/models/KongMingDian.jpg


Diferenças do arquivo suprimidas por serem muito extensas
+ 517895 - 0
public/static/models/KongMingDian.obj


BIN
public/static/models/KongMingDian_2048.jpg


BIN
public/static/models/KongMingDian_512.jpg


BIN
public/static/models/LiuBeiDian - 副本.jpg


BIN
public/static/models/LiuBeiDian.jpg


Diferenças do arquivo suprimidas por serem muito extensas
+ 374989 - 0
public/static/models/LiuBeiDian.obj


BIN
public/static/models/LiuBeiDian_2048.jpg


BIN
public/static/models/LiuBeiDian_512.jpg


BIN
public/static/models/TangBei - 副本.jpg


BIN
public/static/models/TangBei.jpg


Diferenças do arquivo suprimidas por serem muito extensas
+ 123286 - 0
public/static/models/TangBei.obj


BIN
public/static/models/TangBei_2048.jpg


BIN
public/static/models/TangBei_512.jpg


BIN
public/static/models/WenChenLang - 副本.jpg


BIN
public/static/models/WenChenLang.jpg


Diferenças do arquivo suprimidas por serem muito extensas
+ 261775 - 0
public/static/models/WenChenLang.obj


BIN
public/static/models/WenChenLang_2048.jpg


BIN
public/static/models/WenChenLang_512.jpg


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/all2(1)_lod10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/all2(2)_lod10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/all_lod10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/di(1)_lod10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/di(2)_lod10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/di_lod10.json


+ 1 - 0
public/static/points/fileNames.txt

@@ -0,0 +1 @@
+["all_lod10.json","all2(1)_lod10.json","all2(2)_lod10.json","di(1)_lod10.json","di(2)_lod10.json","di_lod10.json"]

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_0.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_1.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_10.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_100.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_101.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_102.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_103.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_104.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_105.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_106.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_107.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_108.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_109.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_11.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_110.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_111.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_112.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_113.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_114.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_115.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_116.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_117.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_118.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_119.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_12.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_120.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_121.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_122.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_123.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_124.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_125.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_126.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_127.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_128.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_129.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_13.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_130.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_131.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_132.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_133.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_134.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_135.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_136.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_137.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_138.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_139.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_14.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_140.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
public/static/points/point_141.json


+ 0 - 0
public/static/points/point_142.json


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff