diff --git a/build/js/potree.js b/build/js/potree.js index 2b4dc98e..8b7b3e6f 100644 --- a/build/js/potree.js +++ b/build/js/potree.js @@ -147,76 +147,78 @@ function POCLoader(){ * @param url * @param loadingFinishedListener executed after loading the binary has been finished */ -POCLoader.load = function load(url, params) { - var parameters = params || {}; - var toOrigin = parameters.toOrigin || false; - +POCLoader.load = function load(url, callback) { try{ var pco = new Potree.PointCloudOctreeGeometry(); pco.url = url; var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.send(null); - if(xhr.status === 200 || xhr.status === 0){ - var fMno = JSON.parse(xhr.responseText); - if(Potree.utils.pathExists(fMno.octreeDir + "/r")){ - pco.octreeDir = fMno.octreeDir; - }else{ - pco.octreeDir = url + "/../" + fMno.octreeDir; - } - - pco.spacing = fMno.spacing; + xhr.open('GET', url, true); + + xhr.onreadystatechange = function(){ + if(xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)){ + var fMno = JSON.parse(xhr.responseText); + + // assume octreeDir is absolute if it starts with http + if(fMno.octreeDir.indexOf("http") === 0){ + pco.octreeDir = fMno.octreeDir; + }else{ + pco.octreeDir = url + "/../" + fMno.octreeDir; + } + + pco.spacing = fMno.spacing; - pco.pointAttributes = fMno.pointAttributes; - - var min = new THREE.Vector3(fMno.boundingBox.lx, fMno.boundingBox.ly, fMno.boundingBox.lz); - var max = new THREE.Vector3(fMno.boundingBox.ux, fMno.boundingBox.uy, fMno.boundingBox.uz); - var boundingBox = new THREE.Box3(min, max); - var offset = new THREE.Vector3(0,0,0); - - if(toOrigin){ + pco.pointAttributes = fMno.pointAttributes; + + var min = new THREE.Vector3(fMno.boundingBox.lx, fMno.boundingBox.ly, fMno.boundingBox.lz); + var max = new THREE.Vector3(fMno.boundingBox.ux, fMno.boundingBox.uy, fMno.boundingBox.uz); + var boundingBox = new THREE.Box3(min, max); + var offset = new THREE.Vector3(0,0,0); + offset.set(-min.x, -min.y, -min.z); boundingBox.min.add(offset); boundingBox.max.add(offset); - } - pco.boundingBox = boundingBox; - pco.offset = offset; - - var nodes = {}; - - { // load root - var name = "r"; - var root = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); - root.level = 0; - root.numPoints = fMno.hierarchy[0][1]; - pco.root = root; - pco.root.load(); - nodes[name] = root; - } - - // load remaining hierarchy - for( var i = 1; i < fMno.hierarchy.length; i++){ - var name = fMno.hierarchy[i][0]; - var numPoints = fMno.hierarchy[i][1]; - var index = parseInt(name.charAt(name.length-1)); - var parentName = name.substring(0, name.length-1); - var parentNode = nodes[parentName]; - var level = name.length-1; - var boundingBox = POCLoader.createChildAABB(parentNode.boundingBox, index); + pco.boundingBox = boundingBox; + pco.boundingSphere = boundingBox.getBoundingSphere(); + pco.offset = offset; - var node = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); - node.level = level; - node.numPoints = numPoints; - parentNode.addChild(node); - nodes[name] = node; + var nodes = {}; + + { // load root + var name = "r"; + + var root = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); + root.level = 0; + root.numPoints = fMno.hierarchy[0][1]; + pco.root = root; + pco.root.load(); + nodes[name] = root; + } + + // load remaining hierarchy + for( var i = 1; i < fMno.hierarchy.length; i++){ + var name = fMno.hierarchy[i][0]; + var numPoints = fMno.hierarchy[i][1]; + var index = parseInt(name.charAt(name.length-1)); + var parentName = name.substring(0, name.length-1); + var parentNode = nodes[parentName]; + var level = name.length-1; + var boundingBox = POCLoader.createChildAABB(parentNode.boundingBox, index); + + var node = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); + node.level = level; + node.numPoints = numPoints; + parentNode.addChild(node); + nodes[name] = node; + } + + pco.nodes = nodes; + + callback(pco); } - - pco.nodes = nodes; - } - return pco; + xhr.send(null); }catch(e){ console.log("loading failed: '" + url + "'"); console.log(e); @@ -543,219 +545,247 @@ LasLazLoader.loadData = function loadData(buffer, handler){ }); } -Potree.PointCloudRGBMaterial = function(parameters){ - parameters = parameters || {}; - - var attributes = {}; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 10 } - }; - - var pointSize = parameters.size || 1.0; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudRGBMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: pointSize, - alphaTest: 0.9, - }); +Potree.PointSizeType = { + FIXED: 0, + ATTENUATED: 1, + ADAPTIVE: 2 }; -Potree.PointCloudRGBMaterial.prototype = new THREE.ShaderMaterial(); +Potree.PointShape = { + SQUARE: 0, + CIRCLE: 1 +}; -Object.defineProperty(Potree.PointCloudRGBMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); +Potree.PointColorType = { + RGB: 0, + COLOR: 1, + DEPTH: 2, + HEIGHT: 3, + INTENSITY: 4, + INTENSITY_GRADIENT: 5, + OCTREE_DEPTH: 6, + POINT_INDEX: 7 +}; -Potree.PointCloudRGBMaterial.vs_points = [ - "uniform float size; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = color; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudRGBMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - - - -Potree.PointCloudRGBInterpolationMaterial = function(parameters){ +Potree.PointCloudMaterial = function(parameters){ parameters = parameters || {}; + + var color = new THREE.Color( 0x000000 ); + var map = THREE.ImageUtils.generateDataTexture( 2048, 1, color ); + map.magFilter = THREE.NearestFilter; + this.visibleNodesTexture = map; + + var pointSize = parameters.size || 1.0; + var minSize = parameters.minSize || 1.0; + var nodeSize = 1.0; + + this._pointSizeType = Potree.PointSizeType.ATTENUATED; + this._pointShape = Potree.PointShape.SQUARE; + this._interpolate = false; + this._pointColorType = Potree.PointColorType.RGB; + this._octreeLevels = 6.0; + + this.gradientTexture = Potree.PointCloudMaterial.generateGradient(); var attributes = {}; var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, + uColor: { type: "c", value: new THREE.Color( 0xff0000 ) }, + opacity: { type: "f", value: 1.0 }, size: { type: "f", value: 10 }, - blendDepth: { type: "f", value: 0.01 } + minSize: { type: "f", value: 2 }, + nodeSize: { type: "f", value: nodeSize }, + heightMin: { type: "f", value: 0.0 }, + heightMax: { type: "f", value: 1.0 }, + intensityMin: { type: "f", value: 0.0 }, + intensityMax: { type: "f", value: 1.0 }, + visibleNodes: { type: "t", value: this.visibleNodesTexture }, + pcIndex: { type: "f", value: 0 }, + gradient: {type: "t", value: this.gradientTexture}, }; - var pointSize = parameters.size || 1.0; - var vs; - var fs; - var frag_depth_ext = renderer.context.getExtension('EXT_frag_depth'); - if(!frag_depth_ext){ - vs = Potree.PointCloudRGBMaterial.vs_points.join("\n"); - fs = Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n"); - }else{ - vs = Potree.PointCloudRGBInterpolationMaterial.vs_points.join("\n"); - fs = Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb.join("\n"); - } this.setValues({ uniforms: uniforms, attributes: attributes, - vertexShader: vs, - fragmentShader: fs, + vertexShader: this.getDefines() + Potree.PointCloudMaterial.vs_points.join("\n"), + fragmentShader: this.getDefines() + Potree.PointCloudMaterial.fs_points_rgb.join("\n"), vertexColors: THREE.VertexColors, size: pointSize, - alphaTest: 0.9, - }); -}; - -Potree.PointCloudRGBInterpolationMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype, "blendDepth", { - get: function(){ - return this.uniforms.blendDepth.value; - }, - set: function(value){ - this.uniforms.blendDepth.value = value; - } -}); - -Potree.PointCloudRGBInterpolationMaterial.vs_points = [ - " ", - " ", - " ", - "uniform float size; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = color; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb = [ - "#extension GL_EXT_frag_depth : enable ", - "varying vec3 vColor; ", - "uniform float blendDepth; ", - " ", - " ", - "void main() { ", - " ", - " float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " float c = 1.0 - (a + b); ", - " ", - " if(c < 0.0){ ", - " discard; ", - " } ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - " gl_FragDepthEXT = gl_FragCoord.z + blendDepth*(1.0-pow(c, 1.0)) * gl_FragCoord.w ; ", - "} "]; - - - - - - - - - - - - - - - - -Potree.PointCloudIntensityMaterial = function(parameters){ - parameters = parameters || {}; - - var size = parameters.size || 1.0; - this.min = parameters.min || 0; - this.max = parameters.max || 1; - - var attributes = { - intensity: { type: "f", value: [] } - }; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 1 }, - uMin: { type: "f", value: this.min }, - uMax: { type: "f", value: this.max } - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudIntensityMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudIntensityMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, + minSize: minSize, + nodeSize: nodeSize, + pcIndex: 0, alphaTest: 0.9 }); }; -Potree.PointCloudIntensityMaterial.prototype = new THREE.ShaderMaterial(); +Potree.PointCloudMaterial.prototype = new THREE.RawShaderMaterial(); -Object.defineProperty(Potree.PointCloudIntensityMaterial.prototype, "size", { +Potree.PointCloudMaterial.prototype.updateShaderSource = function(){ + + var attributes = {}; + if(this.pointColorType === Potree.PointColorType.INTENSITY + || this.pointColorType === Potree.PointColorType.INTENSITY_GRADIENT){ + attributes.intensity = { type: "f", value: [] }; + } + + this.setValues({ + attributes: attributes, + vertexShader: this.getDefines() + Potree.PointCloudMaterial.vs_points.join("\n"), + fragmentShader: this.getDefines() + Potree.PointCloudMaterial.fs_points_rgb.join("\n") + }); + + if(this.opacity === 1.0){ + this.setValues({ + blending: THREE.NoBlending, + transparent: false, + depthTest: true, + depthWrite: true + }); + }else{ + this.setValues({ + blending: THREE.AdditiveBlending, + transparent: true, + depthTest: false, + depthWrite: true + }); + //this.setValues({ + // transparent: true + //}); + } + + this.needsUpdate = true; +}; + +Potree.PointCloudMaterial.prototype.getDefines = function(){ + + var defines = ""; + + if(this.pointSizeType === Potree.PointSizeType.FIXED){ + defines += "#define fixed_point_size\n"; + }else if(this.pointSizeType === Potree.PointSizeType.ATTENUATED){ + defines += "#define attenuated_point_size\n"; + }else if(this.pointSizeType === Potree.PointSizeType.ADAPTIVE){ + defines += "#define adaptive_point_size\n"; + defines += "#define octreeLevels " + Math.max(0, this._octreeLevels - 2).toFixed(1) + "\n"; + } + + if(this.pointShape === Potree.PointShape.SQUARE){ + defines += "#define square_point_shape\n"; + }else if(this.pointShape === Potree.PointShape.CIRCLE){ + defines += "#define circle_point_shape\n"; + } + + if(this._interpolate){ + defines += "#define use_interpolation\n"; + } + + if(this._pointColorType === Potree.PointColorType.RGB){ + defines += "#define color_type_rgb\n"; + }else if(this._pointColorType === Potree.PointColorType.COLOR){ + defines += "#define color_type_color\n"; + }else if(this._pointColorType === Potree.PointColorType.DEPTH){ + defines += "#define color_type_depth\n"; + }else if(this._pointColorType === Potree.PointColorType.HEIGHT){ + defines += "#define color_type_height\n"; + }else if(this._pointColorType === Potree.PointColorType.INTENSITY){ + defines += "#define color_type_intensity\n"; + }else if(this._pointColorType === Potree.PointColorType.INTENSITY_GRADIENT){ + defines += "#define color_type_intensity_gradient\n"; + }else if(this._pointColorType === Potree.PointColorType.OCTREE_DEPTH){ + defines += "#define color_type_octree_depth\n"; + }else if(this._pointColorType === Potree.PointColorType.POINT_INDEX){ + defines += "#define color_type_point_index\n"; + } + + return defines; +}; + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "opacity", { + get: function(){ + return this.uniforms.opacity.value; + }, + set: function(value){ + if(this.uniforms.opacity.value !== value){ + this.uniforms.opacity.value = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "octreeLevels", { + get: function(){ + return this._octreeLevels; + }, + set: function(value){ + if(this._octreeLevels !== value){ + this._octreeLevels = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointColorType", { + get: function(){ + return this._pointColorType; + }, + set: function(value){ + if(this._pointColorType !== value){ + this._pointColorType = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointSizeType", { + get: function(){ + return this._pointSizeType; + }, + set: function(value){ + if(this._pointSizeType !== value){ + this._pointSizeType = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "interpolate", { + get: function(){ + return this._interpolate; + }, + set: function(value){ + if(this._interpolate !== value){ + this._interpolate = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "color", { + get: function(){ + return this.uniforms.uColor.value; + }, + set: function(value){ + if(this.uniforms.uColor.value !== value){ + this.uniforms.uColor.value.copy(value); + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointShape", { + get: function(){ + return this._pointShape; + }, + set: function(value){ + if(this._pointShape !== value){ + this._pointShape = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "size", { get: function(){ return this.uniforms.size.value; }, @@ -764,85 +794,61 @@ Object.defineProperty(Potree.PointCloudIntensityMaterial.prototype, "size", { } }); -Potree.PointCloudIntensityMaterial.vs_points = [ - "attribute float intensity; ", - "uniform float size; ", - "uniform float uMin; ", - "uniform float uMax; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = vec3(1.0, 1.0, 1.0) * (intensity -uMin) / uMax; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " //gl_PointSize = size * 1.0 / length( mvPosition.xyz ); ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; +Object.defineProperty(Potree.PointCloudMaterial.prototype, "minSize", { + get: function(){ + return this.uniforms.minSize.value; + }, + set: function(value){ + this.uniforms.minSize.value = value; + } +}); -Potree.PointCloudIntensityMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; +Object.defineProperty(Potree.PointCloudMaterial.prototype, "heightMin", { + get: function(){ + return this.uniforms.heightMin.value; + }, + set: function(value){ + this.uniforms.heightMin.value = value; + } +}); +Object.defineProperty(Potree.PointCloudMaterial.prototype, "heightMax", { + get: function(){ + return this.uniforms.heightMax.value; + }, + set: function(value){ + this.uniforms.heightMax.value = value; + } +}); +Object.defineProperty(Potree.PointCloudMaterial.prototype, "intensityMin", { + get: function(){ + return this.uniforms.intensityMin.value; + }, + set: function(value){ + this.uniforms.intensityMin.value = value; + } +}); +Object.defineProperty(Potree.PointCloudMaterial.prototype, "intensityMax", { + get: function(){ + return this.uniforms.intensityMax.value; + }, + set: function(value){ + this.uniforms.intensityMax.value = value; + } +}); +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pcIndex", { + get: function(){ + return this.uniforms.pcIndex.value; + }, + set: function(value){ + this.uniforms.pcIndex.value = value; + } +}); - - - - - - - - - - - -Potree.PointCloudHeightMaterial = function(parameters){ - parameters = parameters || {}; - - var size = parameters.size || 1.0; - this.min = parameters.min || 0; - this.max = parameters.max || 1; - - var gradientTexture = Potree.PointCloudHeightMaterial.generateGradient(); - - var attributes = {}; - var uniforms = { - uCol: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 1 }, - uMin: { type: "f", value: this.min }, - uMax: { type: "f", value: this.max }, - gradient: {type: "t", value: gradientTexture} - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudHeightMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudHeightMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9, - }); -}; - - -Potree.PointCloudHeightMaterial.generateGradient = function() { +Potree.PointCloudMaterial.generateGradient = function() { var size = 64; // create canvas @@ -874,163 +880,193 @@ Potree.PointCloudHeightMaterial.generateGradient = function() { return texture; } -Potree.PointCloudHeightMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudHeightMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Potree.PointCloudHeightMaterial.prototype.setBoundingBox = function(boundingBox){ - this.min = boundingBox.min.y; - this.max = boundingBox.max.y; - - this.uniforms.uMin.value = this.min; - this.uniforms.uMax.value = this.max; -} - -Potree.PointCloudHeightMaterial.vs_points = [ - "uniform float size; ", - "uniform float uMin; ", - "uniform float uMax; ", - "uniform sampler2D gradient; ", - " ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " vec4 world = modelMatrix * vec4( position, 1.0 ); ", - " float w = (world.y - uMin) / (uMax-uMin); ", - " ", - " vec4 gCol = texture2D(gradient, vec2(w,1.0-w)); ", - " vColor = gCol.rgb; ", - " ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudHeightMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - - - -Potree.PointCloudColorMaterial = function(parameters){ - parameters = parameters || {}; - - var color = parameters.color || new THREE.Color().setRGB(1, 0, 0); - var size = parameters.size || 1.0; - - var attributes = {}; - var uniforms = { - uCol: { type: "c", value: color }, - size: { type: "f", value: 1 } - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudColorMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudColorMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9, - }); -}; - -Potree.PointCloudColorMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudColorMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Object.defineProperty(Potree.PointCloudColorMaterial.prototype, "color", { - get: function(){ - return this.uniforms.uCol.value; - }, - set: function(value){ - this.uniforms.uCol.value.copy(value); - } -}); - -Potree.PointCloudColorMaterial.vs_points = [ - "uniform float size; ", - "uniform vec3 uCol; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = uCol; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudColorMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - +Potree.PointCloudMaterial.vs_points = [ + "precision highp float; ", + "precision highp int; ", + " ", + "attribute vec3 position; ", + "attribute vec3 color; ", + "attribute float intensity; ", + "attribute vec4 indices; ", + " ", + "uniform mat4 modelMatrix; ", + "uniform mat4 modelViewMatrix; ", + "uniform mat4 projectionMatrix; ", + "uniform mat4 viewMatrix; ", + "uniform mat3 normalMatrix; ", + "uniform vec3 cameraPosition; ", + " ", + "uniform float heightMin; ", + "uniform float heightMax; ", + "uniform float intensityMin; ", + "uniform float intensityMax; ", + "uniform float size; ", + "uniform float minSize; ", + "uniform float nodeSize; ", + "uniform vec3 uColor; ", + " ", + "uniform sampler2D visibleNodes; ", + "uniform sampler2D gradient; ", + " ", + " ", + "varying vec3 vColor; ", + " ", + " ", + "#if defined(adaptive_point_size) || defined(color_type_octree_depth) ", + "/** ", + " * number of 1-bits up to inclusive index position ", + " * number is treated as if it were an integer in the range 0-255 ", + " * ", + " */ ", + "float numberOfOnes(float number, float index){ ", + " float tmp = mod(number, pow(2.0, index + 1.0)); ", + " float numOnes = 0.0; ", + " for(float i = 0.0; i < 8.0; i++){ ", + " if(mod(tmp, 2.0) != 0.0){ ", + " numOnes++; ", + " } ", + " tmp = floor(tmp / 2.0); ", + " } ", + " return numOnes; ", + "} ", + " ", + " ", + "/** ", + " * checks whether the bit at index is 1 ", + " * number is treated as if it were an integer in the range 0-255 ", + " * ", + " */ ", + "bool isBitSet(float number, float index){ ", + " return mod(floor(number / pow(2.0, index)), 2.0) != 0.0; ", + "} ", + " ", + " ", + "/** ", + " * find the octree depth at the point position ", + " */ ", + "float getOctreeDepth(){ ", + " vec3 offset = vec3(0.0, 0.0, 0.0); ", + " float iOffset = 0.0; ", + " float depth = 0.0; ", + " for(float i = 0.0; i <= octreeLevels + 1.0; i++){ ", + " ", + " float nodeSizeAtLevel = nodeSize / pow(2.0, i); ", + " vec3 index3d = (position - offset) / nodeSizeAtLevel; ", + " index3d = floor(index3d + 0.5); ", + " float index = 4.0*index3d.x + 2.0*index3d.y + index3d.z; ", + " ", + " vec4 value = texture2D(visibleNodes, vec2(iOffset / 2048.0, 0.0)); ", + " float mask = value.r * 255.0; ", + " if(isBitSet(mask, index)){ ", + " // there are more visible child nodes at this position ", + " iOffset = iOffset + value.g * 255.0 + numberOfOnes(mask, index - 1.0); ", + " depth++; ", + " }else{ ", + " // no more visible child nodes at this position ", + " return depth; ", + " } ", + " offset = offset + (vec3(1.0, 1.0, 1.0) * nodeSizeAtLevel * 0.5) * index3d; ", + " } ", + " ", + " return depth; ", + "} ", + " ", + "#endif ", + " ", + " ", + " ", + "void main() { ", + " ", + " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", + " gl_Position = projectionMatrix * mvPosition; ", + " ", + " ", + " // COLOR TYPES ", + " ", + " #ifdef color_type_rgb ", + " vColor = color; ", + " #elif defined color_type_height ", + " vec4 world = modelMatrix * vec4( position, 1.0 ); ", + " float w = (world.y - heightMin) / (heightMax-heightMin); ", + " ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_depth ", + " vColor = vec3(1.0, 1.0, 1.0) * gl_Position.w * 0.0001; ", + " #elif defined color_type_intensity ", + " float w = (intensity - intensityMin) / intensityMax; ", + " vColor = vec3(w, w, w); ", + " //vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_intensity_gradient ", + " float w = (intensity - intensityMin) / intensityMax; ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_color ", + " vColor = uColor; ", + " #elif defined color_type_octree_depth ", + " float depth = getOctreeDepth(); ", + " float w = depth / 10.0; ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_point_index ", + " vColor = indices.rgb; ", + " #endif ", + " ", + " ", + " // ", + " // POINT SIZE TYPES ", + " // ", + " #if defined fixed_point_size ", + " gl_PointSize = size; ", + " #elif defined attenuated_point_size ", + " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", + " #elif defined adaptive_point_size ", + " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", + " gl_PointSize = gl_PointSize / pow(1.9, getOctreeDepth()); ", + " #endif ", + " ", + " gl_PointSize = max(minSize, gl_PointSize); ", + " gl_PointSize = min(30.0, gl_PointSize); ", + " ", + " ", + "} "]; +Potree.PointCloudMaterial.fs_points_rgb = [ + "#if defined use_interpolation ", + " #extension GL_EXT_frag_depth : enable ", + "#endif ", + " ", + "precision highp float; ", + "precision highp int; ", + " ", + "uniform float opacity; ", + "uniform float pcIndex; ", + " ", + "varying vec3 vColor; ", + " ", + " ", + "void main() { ", + " ", + " #if defined(circle_point_shape) || defined(use_interpolation) ", + " float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", + " float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", + " float c = 1.0 - (a + b); ", + " ", + " if(c < 0.0){ ", + " discard; ", + " } ", + " #endif ", + " ", + " #if defined use_interpolation ", + " gl_FragDepthEXT = gl_FragCoord.z + 0.002*(1.0-pow(c, 1.0)) * gl_FragCoord.w; ", + " #endif ", + " ", + " ", + " #if defined color_type_point_index ", + " gl_FragColor = vec4(vColor, pcIndex / 255.0); ", + " #else ", + " gl_FragColor = vec4(vColor, opacity); ", + " #endif ", + " ", + " ", + "} "]; @@ -1518,6 +1554,7 @@ Potree.PointCloudOctreeProxyNode = function(geometryNode){ this.geometryNode = geometryNode; this.boundingBox = geometryNode.boundingBox; + this.boundingSphere = this.boundingBox.getBoundingSphere(); this.name = geometryNode.name; this.level = geometryNode.level; this.numPoints = geometryNode.numPoints; @@ -1525,25 +1562,67 @@ Potree.PointCloudOctreeProxyNode = function(geometryNode){ Potree.PointCloudOctreeProxyNode.prototype = Object.create(THREE.Object3D.prototype); + + + + + + + +Potree.ProfileRequest = function(start, end, width, depth, callback){ + this.start = start; + this.end = end; + this.width = width; + this.depth = depth; + + //var up = start.clone(); + //up.y += 10; + //this.plane = new THREE.Plane().setFromCoplanarPoints(start, end, up); + this.callback = callback; + this.loadQueue = []; + + var center = new THREE.Vector3().addVectors(end, start).multiplyScalar(0.5); + var length = new THREE.Vector3().subVectors(end, start).length(); + var side = new THREE.Vector3().subVectors(end, start).normalize(); + var up = new THREE.Vector3(0, 1, 0); + var forward = new THREE.Vector3().crossVectors(side, up).normalize(); + var N = forward; + this.plane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); +}; + + + + + + + + Potree.PointCloudOctree = function(geometry, material){ THREE.Object3D.call( this ); Potree.PointCloudOctree.lru = Potree.PointCloudOctree.lru || new LRU(); this.pcoGeometry = geometry; - //this.boundingBox = this.pcoGeometry.boundingBox; this.boundingBox = this.pcoGeometry.root.boundingBox; - this.material = material; - this.maxVisibleNodes = 2000; - this.maxVisiblePoints = 20*1000*1000; + this.boundingSphere = this.boundingBox.getBoundingSphere(); + this.material = material || new Potree.PointCloudMaterial(); + this.visiblePointsTarget = 2*1000*1000; this.level = 0; + this.position.sub(geometry.offset); + this.updateMatrix(); this.LODDistance = 20; this.LODFalloff = 1.3; this.LOD = 4; this.showBoundingBox = false; this.loadQueue = []; - + this.visibleBounds = new THREE.Box3(); + this.profileRequests = []; + this.visibleNodes = []; + this.visibleGeometry = []; + this.pickTarget; + this.pickMaterial; + this.maxLevel = 0; var rootProxy = new Potree.PointCloudOctreeProxyNode(this.pcoGeometry.root); this.add(rootProxy); @@ -1552,9 +1631,202 @@ Potree.PointCloudOctree = function(geometry, material){ Potree.PointCloudOctree.prototype = Object.create(THREE.Object3D.prototype); Potree.PointCloudOctree.prototype.update = function(camera){ + this.updateMatrixWorld(true); + + this.visibleGeometry = this.getVisibleGeometry(camera); + var visibleGeometryNames = []; + + for(var i = 0; i < this.visibleGeometry.length; i++){ + visibleGeometryNames.push(this.visibleGeometry[i].node.name); + } + + for(var i = 0; i < this.profileRequests.length; i++){ + var profileRequest = this.profileRequests[i]; + profileRequest.loadQueue = []; + } + + this.loadQueue = []; + this.visibleNodes = []; this.numVisibleNodes = 0; this.numVisiblePoints = 0; - this.loadQueue = []; + + this.hideDescendants(this.children[0]); + + var stack = []; + stack.push({node: this.children[0], weight: 1}); //TODO don't do it like that + while(stack.length > 0){ + var element = stack.shift(); + var node = element.node; + var weight = element.weight; + + node.visible = true; + + if (node instanceof Potree.PointCloudOctreeProxyNode) { + var geometryNode = node.geometryNode; + if(geometryNode.loaded === true){ + this.replaceProxy(node); + }else{ + this.loadQueue.push(element); + } + }else if(node instanceof THREE.PointCloud){ + this.numVisibleNodes++; + this.numVisiblePoints += node.numPoints; + node.material = this.material; + this.visibleNodes.push(element); + + if(node.level){ + this.maxLevel = Math.max(node.level, this.maxLevel); + } + + //if(!node.boundingBoxNode){ + // var boxHelper = new THREE.BoxHelper(node); + // scene.add(boxHelper); + // node.boundingBoxNode = boxHelper; + //} + + for(var i = 0; i < node.children.length; i++){ + var child = node.children[i]; + var visible = visibleGeometryNames.indexOf(child.name) >= 0; + if(visible){ + for(var j = 0; j < this.visibleGeometry.length; j++){ + if(this.visibleGeometry[j].node.name === child.name){ + stack.push({node: child, weight: this.visibleGeometry[j].weight}); + } + }; + } + } + } + } + + this.material.octreeLevels = this.maxLevel; + + // check profile cut plane intersections + for(var i = 0; i < this.profileRequests.length; i++){ + var profileRequest = this.profileRequests[i]; + var plane = profileRequest.plane; + var start = profileRequest.start; + var end = profileRequest.end; + var depth = profileRequest.depth; + + var stack = []; + stack.push(this); + while(stack.length > 0){ + var object = stack.shift(); + + if(object instanceof Potree.PointCloudOctreeProxyNode){ + var box = Potree.utils.computeTransformedBoundingBox(object.boundingBox, object.matrixWorld); + + var sphere = box.getBoundingSphere(); + if(Math.abs(plane.distanceToPoint(sphere.center)) < sphere.radius){ + profileRequest.loadQueue.push(object); + } + } + + + if(object.level < depth){ + for(var i = 0; i < object.children.length; i++){ + var child = object.children[i]; + + if(child instanceof Potree.PointCloudOctreeProxyNode || child instanceof THREE.PointCloud){ + stack.push(object.children[i]); + } + } + } + } + + } + + var leafNodes = []; + for(var i = 0; i < this.visibleNodes.length; i++){ + var element = this.visibleNodes[i]; + var node = element.node; + var isLeaf = true; + + for(var j = 0; j < node.children.length; j++){ + var child = node.children[j]; + if(child instanceof THREE.PointCloud){ + isLeaf = isLeaf && !child.visible; + } + } + + if(isLeaf){ + leafNodes.push(node); + } + } + + this.visibleBounds.min = new THREE.Vector3( Infinity, Infinity, Infinity ); + this.visibleBounds.max = new THREE.Vector3( - Infinity, - Infinity, - Infinity ); + for(var i = 0; i < leafNodes.length; i++){ + var node = leafNodes[i]; + + this.visibleBounds.expandByPoint(node.boundingBox.min); + this.visibleBounds.expandByPoint(node.boundingBox.max); + //this.visibleBounds.intersect(node.boundingBox); + } + + // schedule nodes needed for a profile request + var finishedRequests = []; + for(var i = 0; i < this.profileRequests.length; i++){ + var request = this.profileRequests[i]; + + if(request.loadQueue.length > 0){ + var object = request.loadQueue[0]; + var geometryNode = object.geometryNode; + if(geometryNode.loaded === true && object.parent !== undefined){ + var node = this.replaceProxy(object); + node.updateMatrixWorld(); + node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + + //var boxHelper = new THREE.BoxHelper(node); + //scene.add(boxHelper); + }else{ + object.geometryNode.load(); + } + }else{ + var points = this.getProfile(request.start, request.end, request.width, request.depth); + + request.callback({type: "finished", points: points}); + finishedRequests.push(request); + } + } + + for(var i = 0; i < finishedRequests.length; i++){ + var index = this.profileRequests.indexOf(finishedRequests[i]); + if (index > -1) { + this.profileRequests.splice(index, 1); + } + } + + + + if(this.loadQueue.length > 0){ + if(this.loadQueue.length >= 2){ + this.loadQueue.sort(function(a,b){return b.weight - a.weight}); + } + + for(var i = 0; i < Math.min(5, this.loadQueue.length); i++){ + this.loadQueue[i].node.geometryNode.load(); + } + } + + this.hideDescendants(this.children[0]); + for(var i = 0; i < this.visibleNodes.length; i++){ + this.visibleNodes[i].node.visible = true + } + + if(this.material.pointSizeType){ + if(this.material.pointSizeType === Potree.PointSizeType.ADAPTIVE + || this.material.pointColorType === Potree.PointColorType.OCTREE_DEPTH){ + this.updateVisibilityTexture(); + } + } +}; + +Potree.PointCloudOctree.prototype.getVisibleGeometry = function(camera){ + + var visibleGeometry = []; + var geometry = this.pcoGeometry; + // create frustum in object space camera.updateMatrixWorld(); @@ -1571,97 +1843,208 @@ Potree.PointCloudOctree.prototype.update = function(camera){ var camMatrixObject = new THREE.Matrix4().multiply(worldI).multiply(view); var camObjPos = new THREE.Vector3().setFromMatrixPosition( camMatrixObject ); - var ray = new THREE.Ray(camera.position, new THREE.Vector3( 0, 0, -1 ).applyQuaternion( camera.quaternion ) ); + var sortWeightFunction = function(a, b){return b.weight - a.weight}; - // check visibility + var root = geometry.root; var stack = []; - stack.push(this); + var pointCount = 0; + + var sphere = root.boundingBox.getBoundingSphere(); + var distance = sphere.center.distanceTo(camObjPos); + //var weight = sphere.radius / distance; + var weight = 1 / Math.max(0.1, sphere.center.distanceTo(camObjPos) - sphere.radius); + stack.push({node: root, weight: weight}); + var nodesTested = 0; while(stack.length > 0){ - var object = stack.shift(); + nodesTested++; + var element = stack.shift(); + var node = element.node; - if(object instanceof THREE.Mesh || object instanceof THREE.Line ){ - object.visible = true; - continue; - } + var box = node.boundingBox; + var sphere = node.boundingSphere; + //var insideFrustum = frustum.intersectsSphere(sphere); + var insideFrustum = frustum.intersectsBox(box); + - var box = object.boundingBox; - var distance = box.center().distanceTo(camObjPos); - var radius = box.size().length() * 0.5; - - var visible = true; - visible = visible && frustum.intersectsBox(box); - if(object.level > 0){ - // cull detail nodes based in distance to camera - visible = visible && Math.pow(radius, 0.8) / distance > (1 / this.LOD); - visible = visible && (this.numVisiblePoints + object.numPoints < Potree.pointLoadLimit); - visible = visible && (this.numVisibleNodes <= this.maxVisibleNodes); - visible = visible && (this.numVisiblePoints <= this.maxVisiblePoints); - - } - - // trying to skip higher detail nodes, if parents already cover all holes - //if(this.pcoGeometry !== undefined && this.pcoGeometry.spacing !== undefined){ - // var spacing = this.pcoGeometry.spacing / Math.pow(2, object.level); - // spacing *= 10; - // if(spacing < this.material.size * 1.5){ - // visible = false; - // } - //} - - //if(object.level > 0){ - // visible = parseInt(object.name.charAt(object.name.length-1)) == 0; - //} - - object.visible = visible; + var visible = insideFrustum; // && node.level <= 1; + //visible = visible && "r2".indexOf(node.name) === 0; if(!visible){ - this.hideDescendants(object); continue; - }else if(visible && this.showBoundingBox && object instanceof THREE.PointCloud){ - if(object.boundingBoxNode === undefined && object.boundingBox !== undefined){ - var boxHelper = new THREE.BoxHelper(object); - object.add(boxHelper); - object.boundingBoxNode = boxHelper; - } - }else if(!this.showBoundingBox){ - if(object.boundingBoxNode !== undefined){ - object.remove(object.boundingBoxNode); - object.boundingBoxNode = undefined; - } } - if(object instanceof THREE.PointCloud){ - this.numVisibleNodes++; - this.numVisiblePoints += object.numPoints; - Potree.PointCloudOctree.lru.touch(object); - object.material = this.material; - }else if (object instanceof Potree.PointCloudOctreeProxyNode) { - var geometryNode = object.geometryNode; - if(geometryNode.loaded === true){ - this.replaceProxy(object); + if(pointCount + node.numPoints > this.visiblePointsTarget){ + break; + } + + pointCount += node.numPoints; + visibleGeometry.push(element); + + for(var i in node.children){ + var child = node.children[i]; + + var sphere = child.boundingSphere; + var distance = sphere.center.distanceTo(camObjPos); + var radius = sphere.radius; + var weight = sphere.radius / distance; + //var weight = (1 / Math.max(0.001, distance - radius)) * distance; + + // discarding nodes which are very small when projected onto the screen + // TODO: pr threshold was a value choosen by trial & error. Validate that this is fine. + // see http://stackoverflow.com/questions/21648630/radius-of-projected-sphere-in-screen-space + var fov = camera.fov / 2 * Math.PI / 180.0; + var pr = 1 / Math.tan(fov) * radius / Math.sqrt(distance * distance - radius * radius); + if(pr < 0.1){ + continue; + } + + weight = pr; + if(distance - radius < 0){ + weight = Number.MAX_VALUE; + } + + if(stack.length === 0){ + stack.push({node: child, weight: weight}); }else{ - this.loadQueue.push({node: object, lod: Math.pow(radius, 0.8) / distance}); + var ipos = 0; + + for(var j = 0; j < stack.length; j++){ + if(weight > stack[j].weight){ + var ipos = j; + break; + }else if(j == stack.length -1){ + ipos = stack.length; + break; + } + + + } + + //if(stack.length < 200){ + stack.splice(ipos, 0, {node: child, weight: weight}); + //} + + //console.log(ipos); } + + //stack.push({node: child, weight: weight}); + //} } - for(var i = 0; i < object.children.length; i++){ - stack.push(object.children[i]); - } - - //console.log(object.name); + //stack.sort(sortWeightFunction); + var a = 1; + } + //console.log(nodesTested); + + return visibleGeometry; +}; + +Potree.PointCloudOctree.prototype.updateVisibilityTexture = function(){ + + if(!this.material){ + return; } - if(this.loadQueue.length > 0){ - if(this.loadQueue.length >= 2){ - this.loadQueue.sort(function(a,b){return b.lod - a.lod}); + var texture = this.material.visibleNodesTexture; + var data = texture.image.data; + + var visibleNodes = []; + for(var i = 0; i < this.visibleNodes.length; i++){ + visibleNodes.push(this.visibleNodes[i].node); + } + + + // sort by level and index, e.g. r, r0, r3, r4, r01, r07, r30, ... + var sort = function(a, b){ + var na = a.name; + var nb = b.name; + if(na.length != nb.length) return na.length - nb.length; + if(na < nb) return -1; + if(na > nb) return 1; + return 0; + }; + visibleNodes.sort(sort); + + for(var i = 0; i < visibleNodes.length; i++){ + var node = visibleNodes[i]; + var children = []; + for(var j = 0; j < node.children.length; j++){ + var child = node.children[j]; + if(child instanceof THREE.PointCloud && child.visible){ + children.push(child); + } } + children.sort(function(a, b){ + if(a.name < b.name) return -1; + if(a.name > b.name) return 1; + return 0; + }); - for(var i = 0; i < Math.min(5, this.loadQueue.length); i++){ - this.loadQueue[i].node.geometryNode.load(); + data[i*3 + 0] = 0; + data[i*3 + 1] = 0; + data[i*3 + 2] = 0; + for(var j = 0; j < children.length; j++){ + var child = children[j]; + var index = parseInt(child.name.substr(-1)); + data[i*3 + 0] += Math.pow(2, index); + + if(j === 0){ + var vArrayIndex = visibleNodes.indexOf(child); + data[i*3 + 1] = vArrayIndex - i; + } + } } + + + this.material.uniforms.nodeSize.value = this.boundingBox.size().x; + texture.needsUpdate = true; } +Potree.PointCloudOctree.prototype.nodesOnRay = function(nodes, ray){ + var nodesOnRay = []; + + var _ray = ray.clone(); + for(var i = 0; i < nodes.length; i++){ + var node = nodes[i].node; + var inverseWorld = new THREE.Matrix4().getInverse(node.matrixWorld); + var sphere = node.boundingSphere.clone().applyMatrix4(node.matrixWorld); + + if(_ray.isIntersectionSphere(sphere)){ + nodesOnRay.push(nodes[i]); + //node.visible = true; + }else{ + //node.visible = false; + } + } + + return nodesOnRay; +}; + +Potree.PointCloudOctree.prototype.updateMatrixWorld = function( force ){ + //node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + + if ( this.matrixAutoUpdate === true ) this.updateMatrix(); + + if ( this.matrixWorldNeedsUpdate === true || force === true ) { + + if ( this.parent === undefined ) { + + this.matrixWorld.copy( this.matrix ); + + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + } + + this.matrixWorldNeedsUpdate = false; + + force = true; + + } +}; + Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ @@ -1673,11 +2056,14 @@ Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ node.level = proxy.level; node.numPoints = proxy.numPoints; node.boundingBox = geometry.boundingBox; + node.boundingSphere = node.boundingBox.getBoundingSphere(); node.pcoGeometry = geometryNode; var parent = proxy.parent; parent.remove(proxy); parent.add(node); + node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + for(var i = 0; i < 8; i++){ if(geometryNode.children[i] !== undefined){ var child = geometryNode.children[i]; @@ -1685,6 +2071,8 @@ Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ node.add(childProxy); } } + + return node; } } @@ -1713,7 +2101,7 @@ Potree.PointCloudOctree.prototype.hideDescendants = function(object){ Potree.PointCloudOctree.prototype.moveToOrigin = function(){ this.position.set(0,0,0); - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -1721,7 +2109,7 @@ Potree.PointCloudOctree.prototype.moveToOrigin = function(){ } Potree.PointCloudOctree.prototype.moveToGroundPlane = function(){ - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -1729,7 +2117,7 @@ Potree.PointCloudOctree.prototype.moveToGroundPlane = function(){ } Potree.PointCloudOctree.prototype.getBoundingBoxWorld = function(){ - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -1737,51 +2125,67 @@ Potree.PointCloudOctree.prototype.getBoundingBoxWorld = function(){ return tBox; } -Potree.PointCloudOctree.prototype.getProfile = function(start, end, width, depth){ - var stack = []; - stack.push(this); - - var side = new THREE.Vector3().subVectors(end, start).normalize(); - var up = new THREE.Vector3(0, 1, 0); - var forward = new THREE.Vector3().crossVectors(side, up).normalize(); - var N = forward; - var cutPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); - - var inside = []; - - - while(stack.length > 0){ - var object = stack.shift(); +Potree.PointCloudOctree.prototype.getProfile = function(start, end, width, depth, callback){ + if(callback !== undefined){ + this.profileRequests.push(new Potree.ProfileRequest(start, end, width, depth, callback)); + }else{ + var stack = []; + stack.push(this); - console.log("traversing: " + object.name); + var center = new THREE.Vector3().addVectors(end, start).multiplyScalar(0.5); + var length = new THREE.Vector3().subVectors(end, start).length(); + var side = new THREE.Vector3().subVectors(end, start).normalize(); + var up = new THREE.Vector3(0, 1, 0); + var forward = new THREE.Vector3().crossVectors(side, up).normalize(); + var N = forward; + var cutPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); + var halfPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(side, center); - if(object instanceof THREE.PointCloud){ - var geometry = object.geometry; - var positions = geometry.attributes.position; - var p = positions.array; - var pointCount = positions.length / positions.itemSize; + var inside = []; + + + while(stack.length > 0){ + var object = stack.shift(); - for(var i = 0; i < pointCount; i++){ - var pos = new THREE.Vector3(p[3*i], p[3*i+1], p[3*i+2]); - pos.applyMatrix4(this.matrixWorld); - var distance = Math.abs(cutPlane.distanceToPoint(pos)); + + var pointsFound = 0; + + if(object instanceof THREE.PointCloud){ + var geometry = object.geometry; + var positions = geometry.attributes.position; + var p = positions.array; + var pointCount = positions.length / positions.itemSize; - if(distance < width/2){ - inside.push(pos); + for(var i = 0; i < pointCount; i++){ + var pos = new THREE.Vector3(p[3*i], p[3*i+1], p[3*i+2]); + pos.applyMatrix4(this.matrixWorld); + var distance = Math.abs(cutPlane.distanceToPoint(pos)); + var centerDistance = Math.abs(halfPlane.distanceToPoint(pos)); + + if(distance < width / 2 && centerDistance < length / 2){ + inside.push(pos); + pointsFound++; + } + } + } + + //console.log("traversing: " + object.name + ", #points found: " + pointsFound); + + if(object == this || object.level < depth){ + for(var i = 0; i < object.children.length; i++){ + var child = object.children[i]; + if(child instanceof THREE.PointCloud){ + var sphere = child.boundingSphere.clone().applyMatrix4(child.matrixWorld); + if(cutPlane.distanceToSphere(sphere) < sphere.radius){ + stack.push(child); + } + } } } } - if(object == this || object.level < depth){ - for(var i = 0; i < object.children.length; i++){ - stack.push(object.children[i]); - } - } + return inside; } - - console.log("points inside: " + inside.length); - - return inside; } /** @@ -1840,6 +2244,135 @@ Potree.PointCloudOctree.disposeNode = function(node){ }; } +Potree.PointCloudOctree.prototype.getVisibleExtent = function(){ + return this.visibleBounds.applyMatrix4(this.matrixWorld); +}; + +var point = Potree.PointCloudOctree.prototype.pick = function(renderer, camera, ray, params){ + var params = params || {}; + var accuracy = params.accuracy || 0.5; + + var nodes = this.nodesOnRay(this.visibleNodes, ray); + + if(nodes.length === 0){ + return null; + } + + var width = Math.ceil(renderer.domElement.clientWidth * accuracy); + var height = Math.ceil(renderer.domElement.clientHeight * accuracy); + + if(!this.pickTarget){ + this.pickTarget = new THREE.WebGLRenderTarget( + 1, 1, + { minFilter: THREE.LinearFilter, + magFilter: THREE.NearestFilter, + format: THREE.RGBAFormat } + ); + } + + if(!this.pickMaterial){ + //this.pickMaterial = new Potree.PointCloudIndexMaterial({ size: 0.01, minSize: 3}); + this.pickMaterial = new Potree.PointCloudMaterial(); + this.pickMaterial.pointColorType = Potree.PointColorType.POINT_INDEX; + this.pickMaterial.pointSizeType = Potree.PointSizeType.FIXED; + this.pickMaterial.size = accuracy * 5; + } + + // TODO + // Right now point size for picking is fixed + // To work with adaptive size, the pick hierarchy texture must + // be updated to the hierarchy that is rendered during picking + + this.pickTarget.setSize(width, height); + + //this.pickMaterial.size = accuracy * (this.material.size || 0.01); + //this.pickMaterial.minSize = accuracy * (this.material.minSize || 1); + //this.pickMaterial.pointColorType = this.material.pointColorType; + //this.pickMaterial.pointSizeType = this.material.pointSizeType; + //this.pickMaterial.pointShape = this.material.pointShape; + + var _gl = renderer.context; + + var material = this.pickMaterial; + + renderer.setRenderTarget( this.pickTarget ); + + renderer.setDepthTest( material.depthTest ); + renderer.setDepthWrite( material.depthWrite ) + renderer.setBlending( THREE.NoBlending ); + + renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); + + for(var i = 0; i < nodes.length; i++){ + var object = nodes[i].node; + var geometry = object.geometry; + + if(!geometry.attributes.indices.buffer){ + continue; + } + + material.pcIndex = i; + + if(material.program){ + var program = material.program.program; + _gl.useProgram( program ); + //_gl.disable( _gl.BLEND ); + + var attributePointer = _gl.getAttribLocation(program, "indices"); + var attributeSize = 4; + _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.attributes.indices.buffer ); + //if(!bufferSubmitted){ + // _gl.bufferData( _gl.ARRAY_BUFFER, new Uint8Array(geometry.attributes.indices.array), _gl.STATIC_DRAW ); + // bufferSubmitted = true; + //} + _gl.enableVertexAttribArray( attributePointer ); + _gl.vertexAttribPointer( attributePointer, attributeSize, _gl.UNSIGNED_BYTE, true, 0, 0 ); + + _gl.uniform1f(material.program.uniforms.pcIndex, material.pcIndex); + } + + renderer.renderBufferDirect(camera, [], null, material, geometry, object); + } + + + //_gl.bindTexture( _gl.TEXTURE_2D, this.pickTarget.__webglTexture ); + //_gl.generateMipmap( _gl.TEXTURE_2D ); + //_gl.bindTexture( _gl.TEXTURE_2D, null ); + + + var ps = new THREE.Vector3().addVectors(camera.position, ray.direction).project(camera); + ps.addScalar(1).multiplyScalar(0.5); + + var buffer = new ArrayBuffer(4); + var pixels = new Uint8Array(buffer); + var ibuffer = new Uint32Array(buffer); + renderer.context.readPixels( + ps.x * width, ps.y * height, + 1, 1, + renderer.context.RGBA, renderer.context.UNSIGNED_BYTE, pixels); + var pcIndex = pixels[3]; + pixels[3] = 0; + var pIndex = ibuffer[0]; + + //console.log(pcIndex); + // + //return null; + + var pc = nodes[pcIndex].node; + var positionArray = pc.geometry.attributes.position.array; + var x = positionArray[3*pIndex+0]; + var y = positionArray[3*pIndex+1]; + var z = positionArray[3*pIndex+2]; + var position = new THREE.Vector3(x, y, z); + position.applyMatrix4(this.matrixWorld); + + if(pIndex === 0 && pcIndex === 0){ + return null; + } + + return {position: position}; +} + var nodesLoadTimes = {}; Potree.PointCloudOctreeGeometry = function(){ @@ -1860,6 +2393,7 @@ Potree.PointCloudOctreeGeometryNode = function(name, pcoGeometry, boundingBox){ this.index = parseInt(name.charAt(name.length-1)); this.pcoGeometry = pcoGeometry; this.boundingBox = boundingBox; + this.boundingSphere = boundingBox.getBoundingSphere(); this.children = {}; this.numPoints = 0; this.level = null; @@ -1983,11 +2517,14 @@ Potree.PointCloudOctreeGeometryNode.prototype.load = function(){ var positions = new Float32Array(numPoints*3); var colors = new Float32Array(numPoints*3); + var indices = new ArrayBuffer(numPoints*4); var color = new THREE.Color(); var fView = new Float32Array(buffer); var uiView = new Uint8Array(buffer); + var iIndices = new Uint32Array(indices); + for(var i = 0; i < numPoints; i++){ positions[3*i+0] = fView[4*i+0] + node.pcoGeometry.offset.x; positions[3*i+1] = fView[4*i+1] + node.pcoGeometry.offset.y; @@ -1997,10 +2534,13 @@ Potree.PointCloudOctreeGeometryNode.prototype.load = function(){ colors[3*i+0] = color.r / 255; colors[3*i+1] = color.g / 255; colors[3*i+2] = color.b / 255; + + iIndices[i] = i; } geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3)); + geometry.addAttribute('indices', new THREE.BufferAttribute(indices, 1)); geometry.boundingBox = node.boundingBox; node.geometry = geometry; node.loaded = true; @@ -2356,15 +2896,17 @@ Potree.TextSprite.prototype.roundRect = function(ctx, x, y, w, h, r) { -Potree.MeasuringTool = function(scene, camera, domElement){ +Potree.MeasuringTool = function(scene, camera, renderer){ var scope = this; this.scene = scene; this.camera = camera; - this.domElement = domElement; + this.renderer = renderer; + this.domElement = renderer.domElement; this.mouse = {x: 0, y: 0}; + this.accuracy = 0.5; var STATE = { DEFAULT: 0, @@ -2537,12 +3079,10 @@ Potree.MeasuringTool = function(scene, camera, domElement){ function getMousePointCloudIntersection(){ var vector = new THREE.Vector3( scope.mouse.x, scope.mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); - - var raycaster = new THREE.Raycaster(); - raycaster.params = {"PointCloud" : {threshold: 1}}; - raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); + vector.unproject(scope.camera); + + var direction = vector.sub(scope.camera.position).normalize(); + var ray = new THREE.Ray(scope.camera.position, direction); var pointClouds = []; scope.scene.traverse(function(object){ @@ -2551,15 +3091,26 @@ Potree.MeasuringTool = function(scene, camera, domElement){ } }); - var intersects = raycaster.intersectObjects(pointClouds, true); + var closestPoint = null; + var closestPointDistance = null; - if(intersects.length > 0){ - var I = intersects[0]; + for(var i = 0; i < pointClouds.length; i++){ + var pointcloud = pointClouds[i]; + var point = pointcloud.pick(scope.renderer, scope.camera, ray, {accuracy: scope.accuracy}); - return I.point; - }else{ - return undefined; + if(!point){ + continue; + } + + var distance = scope.camera.position.distanceTo(point.position); + + if(!closestPoint || distance < closestPointDistance){ + closestPoint = point; + closestPointDistance = distance; + } } + + return closestPoint ? closestPoint.position : null; } this.domElement.addEventListener("dblclick", onDoubleClick, false); @@ -2592,6 +3143,14 @@ Potree.ProfileTool = function(width, height, depth){ this.hudElement = new THREE.Mesh(this.hudGeometry, this.hudMaterial); this.hudElement.scale.set(1,1,1); this.hudElement.position.set(0, 0, 0); + + //var lblMax = new Potree.TextSprite("max"); + //lblMax.scale.multiplyScalar(0.05); + //this.hudElement.add(lblMax); + + var start = new THREE.Vector3(0,0,0); + var end = new THREE.Vector3(10,0,0); + this.setCoordinates(start, end); } Potree.ProfileTool.prototype = Object.create( THREE.Object3D.prototype ); @@ -2619,6 +3178,21 @@ Potree.ProfileTool.prototype.setOrientation = function(forward, side){ this.camera.lookAt(oldPosition); } +Potree.ProfileTool.prototype.setCoordinates = function(start, end){ + var width = start.distanceTo(end); + this.setDimension(width, this.height, this.depth); + + var center = new THREE.Vector3().addVectors(start, end).multiplyScalar(0.5); + var diff = new THREE.Vector3().subVectors(end, start); + var target = new THREE.Vector3(diff.z, 0, -diff.x); + this.position.set(0,0,0); + this.lookAt(target); + this.position.copy(center); + + this.start = start; + this.end = end; +} + Potree.ProfileTool.prototype.render = function(renderer, scene){ this.camera.matrixWorld.copy(this.matrixWorld); @@ -2639,12 +3213,6 @@ Potree.ProfileTool.prototype.render = function(renderer, scene){ object.material.size = object.material.oldSize; } }); - - //this.hudElement.scale.x = 0.5; - //this.hudElement.scale.y = 0.5 * (renderer.domElement.clientWidth / renderer.domElement.clientHeight) * (this.height / this.width); - //this.hudElement.position.x = 0.7; - //this.hudElement.position.y = -0.7; - } @@ -2770,8 +3338,7 @@ Potree.TranslationTool = function(camera) { this.getHoveredObject = function(mouse){ var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); + vector.unproject(scope.camera); var raycaster = new THREE.Raycaster(); raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); @@ -2804,9 +3371,7 @@ Potree.TranslationTool = function(camera) { var directionDistance = new THREE.Vector3().subVectors(mousePoint, origin).dot(direction); var pointOnLine = direction.clone().multiplyScalar(directionDistance).add(origin); - - var projector = new THREE.Projector(); - projector.unprojectVector(pointOnLine, scope.camera); + pointOnLine.unproject(scope.camera); var diff = pointOnLine.clone().sub(scope.position); scope.position.copy(pointOnLine); @@ -2842,11 +3407,8 @@ Potree.TranslationTool = function(camera) { lineEnd.z -= 2; } - //lineEnd = scope.position.clone(); - - var projector = new THREE.Projector(); - projector.projectVector( lineStart, scope.camera ); - projector.projectVector( lineEnd, scope.camera ); + lineStart.project(scope.camera); + lineEnd.project(scope.camera); scope.start = { mouse: event.normalizedPosition, diff --git a/build/js/potree.min.js b/build/js/potree.min.js index 33566021..08102dd9 100644 --- a/build/js/potree.min.js +++ b/build/js/potree.min.js @@ -1,2 +1,3 @@ -function Potree(){}function POCLoader(){}function PointAttributeNames(){}function PointAttribute(e,t,o){this.name=e,this.type=t,this.numElements=o,this.byteSize=this.numElements*this.type.size}function PointAttributes(e){if(this.attributes=new Array,this.byteSize=0,this.size=0,null!=e)for(var t in e){var o=e[t];this.attributes.push(o),this.byteSize+=o.byteSize,this.size++}}function LasLazLoader(){}function LRUItem(e){this.previous=null,this.next=null,this.node=e}function LRU(){this.first=null,this.last=null,this.items={},this.elements=0,this.numPoints=0}Potree.pointLoadLimit=5e7,Potree.workers={},Potree.WorkerManager=function(e){this.code=e,this.instances=[],this.createdInstances=0},Potree.WorkerManager.prototype.getWorker=function(){var e=this.instances.pop();return void 0===e&&(e=Potree.utils.createWorker(this.code),this.createdInstances++),e},Potree.WorkerManager.prototype.returnWorker=function(e){this.instances.push(e)},Potree.WorkerManager.fromUrls=function(e){for(var t="",o=0;o=r?i.pointsCount:i.pointsCount/r,s=function(){var e=o.readData(1e6,0,r);return e.then(function(e){return t.push(new LASDecoder(e.buffer,i.pointsFormatId,i.pointsStructSize,e.count,i.scale,i.offset,i.mins,i.maxs)),n+=e.count,LasLazLoader.progressCB(n/a),e.hasMoreData?s():(i.totalRead=n,i.versionAsString=o.versionAsString,i.isCompressed=o.isCompressed,[o,i,t])})};return s()}).then(function(e){var t=e[0];return LasLazLoader.progressCB(1),t.close().then(function(){return t.isOpen=!1,Promise.delay(200).cancellable()}).then(function(){return e.slice(1)})}).catch(Promise.CancellationError,function(e){if(o.isOpen)return o.close().then(function(){throw o.isOpen=!1,e});throw e})},Potree.PointCloudRGBMaterial=function(e){e=e||{};var t={},o={color:{type:"c",value:new THREE.Color(16777215)},size:{type:"f",value:10}},i=e.size||1;this.setValues({uniforms:o,attributes:t,vertexShader:Potree.PointCloudRGBMaterial.vs_points.join("\n"),fragmentShader:Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n"),vertexColors:THREE.VertexColors,size:i,alphaTest:.9})},Potree.PointCloudRGBMaterial.prototype=new THREE.ShaderMaterial,Object.defineProperty(Potree.PointCloudRGBMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Potree.PointCloudRGBMaterial.vs_points=["uniform float size; ","varying vec3 vColor; "," ","void main() { "," vColor = color; "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = max(2.0, gl_PointSize); "," gl_Position = projectionMatrix * mvPosition; ","} "],Potree.PointCloudRGBMaterial.fs_points_rgb=["varying vec3 vColor; "," ","void main() { "," "," //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," //float c = 1.0 - (a + b); "," // "," //if(c < 0.0){ "," // discard; "," //} "," "," gl_FragColor = vec4(vColor, 1.0); ","} "],Potree.PointCloudRGBInterpolationMaterial=function(e){e=e||{};var t,o,i={},r={color:{type:"c",value:new THREE.Color(16777215)},size:{type:"f",value:10},blendDepth:{type:"f",value:.01}},n=e.size||1,a=renderer.context.getExtension("EXT_frag_depth");a?(t=Potree.PointCloudRGBInterpolationMaterial.vs_points.join("\n"),o=Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb.join("\n")):(t=Potree.PointCloudRGBMaterial.vs_points.join("\n"),o=Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n")),this.setValues({uniforms:r,attributes:i,vertexShader:t,fragmentShader:o,vertexColors:THREE.VertexColors,size:n,alphaTest:.9})},Potree.PointCloudRGBInterpolationMaterial.prototype=new THREE.ShaderMaterial,Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype,"blendDepth",{get:function(){return this.uniforms.blendDepth.value},set:function(e){this.uniforms.blendDepth.value=e}}),Potree.PointCloudRGBInterpolationMaterial.vs_points=[" "," "," ","uniform float size; ","varying vec3 vColor; "," ","void main() { "," vColor = color; "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = max(2.0, gl_PointSize); "," gl_Position = projectionMatrix * mvPosition; ","} "],Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb=["#extension GL_EXT_frag_depth : enable ","varying vec3 vColor; ","uniform float blendDepth; "," "," ","void main() { "," "," float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," float c = 1.0 - (a + b); "," "," if(c < 0.0){ "," discard; "," } "," "," gl_FragColor = vec4(vColor, 1.0); "," gl_FragDepthEXT = gl_FragCoord.z + blendDepth*(1.0-pow(c, 1.0)) * gl_FragCoord.w ; ","} "],Potree.PointCloudIntensityMaterial=function(e){e=e||{};var t=e.size||1;this.min=e.min||0,this.max=e.max||1;var o={intensity:{type:"f",value:[]}},i={color:{type:"c",value:new THREE.Color(16777215)},size:{type:"f",value:1},uMin:{type:"f",value:this.min},uMax:{type:"f",value:this.max}};this.setValues({uniforms:i,attributes:o,vertexShader:Potree.PointCloudIntensityMaterial.vs_points.join("\n"),fragmentShader:Potree.PointCloudIntensityMaterial.fs_points_rgb.join("\n"),vertexColors:THREE.VertexColors,size:t,alphaTest:.9})},Potree.PointCloudIntensityMaterial.prototype=new THREE.ShaderMaterial,Object.defineProperty(Potree.PointCloudIntensityMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Potree.PointCloudIntensityMaterial.vs_points=["attribute float intensity; ","uniform float size; ","uniform float uMin; ","uniform float uMax; ","varying vec3 vColor; "," ","void main() { "," vColor = vec3(1.0, 1.0, 1.0) * (intensity -uMin) / uMax; "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," "," //gl_PointSize = size * 1.0 / length( mvPosition.xyz ); "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = max(2.0, gl_PointSize); "," gl_Position = projectionMatrix * mvPosition; ","} "],Potree.PointCloudIntensityMaterial.fs_points_rgb=["varying vec3 vColor; "," ","void main() { "," "," //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," //float c = 1.0 - (a + b); "," // "," //if(c < 0.0){ "," // discard; "," //} "," "," gl_FragColor = vec4(vColor, 1.0); ","} "],Potree.PointCloudHeightMaterial=function(e){e=e||{};var t=e.size||1;this.min=e.min||0,this.max=e.max||1;var o=Potree.PointCloudHeightMaterial.generateGradient(),i={},r={uCol:{type:"c",value:new THREE.Color(16777215)},size:{type:"f",value:1},uMin:{type:"f",value:this.min},uMax:{type:"f",value:this.max},gradient:{type:"t",value:o}};this.setValues({uniforms:r,attributes:i,vertexShader:Potree.PointCloudHeightMaterial.vs_points.join("\n"),fragmentShader:Potree.PointCloudHeightMaterial.fs_points_rgb.join("\n"),vertexColors:THREE.VertexColors,size:t,alphaTest:.9})},Potree.PointCloudHeightMaterial.generateGradient=function(){var e=64;canvas=document.createElement("canvas"),canvas.width=e,canvas.height=e;var t=canvas.getContext("2d");t.rect(0,0,e,e);var o=t.createLinearGradient(0,0,e,e);o.addColorStop(0,"blue"),o.addColorStop(.2,"aqua"),o.addColorStop(.4,"green"),o.addColorStop(.6,"yellow"),o.addColorStop(.8,"orange"),o.addColorStop(1,"red"),t.fillStyle=o,t.fill();var i=new THREE.Texture(canvas);return i.needsUpdate=!0,textureImage=i.image,i},Potree.PointCloudHeightMaterial.prototype=new THREE.ShaderMaterial,Object.defineProperty(Potree.PointCloudHeightMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Potree.PointCloudHeightMaterial.prototype.setBoundingBox=function(e){this.min=e.min.y,this.max=e.max.y,this.uniforms.uMin.value=this.min,this.uniforms.uMax.value=this.max},Potree.PointCloudHeightMaterial.vs_points=["uniform float size; ","uniform float uMin; ","uniform float uMax; ","uniform sampler2D gradient; "," ","varying vec3 vColor; "," ","void main() { "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," vec4 world = modelMatrix * vec4( position, 1.0 ); "," float w = (world.y - uMin) / (uMax-uMin); "," "," vec4 gCol = texture2D(gradient, vec2(w,1.0-w)); "," vColor = gCol.rgb; "," "," "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = max(2.0, gl_PointSize); "," gl_Position = projectionMatrix * mvPosition; ","} "],Potree.PointCloudHeightMaterial.fs_points_rgb=["varying vec3 vColor; "," ","void main() { "," "," //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," //float c = 1.0 - (a + b); "," // "," //if(c < 0.0){ "," // discard; "," //} "," "," gl_FragColor = vec4(vColor, 1.0); ","} "],Potree.PointCloudColorMaterial=function(e){e=e||{};var t=e.color||(new THREE.Color).setRGB(1,0,0),o=e.size||1,i={},r={uCol:{type:"c",value:t},size:{type:"f",value:1}};this.setValues({uniforms:r,attributes:i,vertexShader:Potree.PointCloudColorMaterial.vs_points.join("\n"),fragmentShader:Potree.PointCloudColorMaterial.fs_points_rgb.join("\n"),vertexColors:THREE.VertexColors,size:o,alphaTest:.9})},Potree.PointCloudColorMaterial.prototype=new THREE.ShaderMaterial,Object.defineProperty(Potree.PointCloudColorMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Object.defineProperty(Potree.PointCloudColorMaterial.prototype,"color",{get:function(){return this.uniforms.uCol.value},set:function(e){this.uniforms.uCol.value.copy(e)}}),Potree.PointCloudColorMaterial.vs_points=["uniform float size; ","uniform vec3 uCol; ","varying vec3 vColor; "," ","void main() { "," vColor = uCol; "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = max(2.0, gl_PointSize); "," gl_Position = projectionMatrix * mvPosition; ","} "],Potree.PointCloudColorMaterial.fs_points_rgb=["varying vec3 vColor; "," ","void main() { "," "," //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," //float c = 1.0 - (a + b); "," // "," //if(c < 0.0){ "," // discard; "," //} "," "," gl_FragColor = vec4(vColor, 1.0); ","} "],THREE.FirstPersonControls=function(e,t){function o(e){l.enabled!==!1&&(e.preventDefault(),0===e.button?(x=g.ROTATE,d.set(e.clientX,e.clientY)):2===e.button&&(x=g.PAN,h.set(e.clientX,e.clientY)),l.domElement.addEventListener("mousemove",i,!1),l.domElement.addEventListener("mouseup",r,!1),l.dispatchEvent(R))}function i(e){if(l.enabled!==!1){e.preventDefault();var t=l.domElement===document?l.domElement.body:l.domElement;x===g.ROTATE?(c.set(e.clientX,e.clientY),u.subVectors(c,d),l.rotateLeft(2*Math.PI*u.x/t.clientWidth*l.rotateSpeed),l.rotateUp(2*Math.PI*u.y/t.clientHeight*l.rotateSpeed),d.copy(c)):x===g.PAN&&(p.set(e.clientX,e.clientY),m.subVectors(p,h),m.multiplyScalar(5e-4).multiplyScalar(l.moveSpeed),l.pan(m.x,m.y),h.copy(p))}}function r(){l.enabled!==!1&&(l.domElement.removeEventListener("mousemove",i,!1),l.domElement.removeEventListener("mouseup",r,!1),l.dispatchEvent(w),x=g.NONE)}function n(e){if(l.enabled!==!1&&l.noZoom!==!0){e.preventDefault();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),l.moveSpeed+=.001*l.moveSpeed*t,l.moveSpeed=Math.max(.1,l.moveSpeed),l.dispatchEvent(R),l.dispatchEvent(w)}}function a(e){if(l.enabled!==!1)switch(e.keyCode){case l.keys.UP:l.moveForward=!0;break;case l.keys.BOTTOM:l.moveBackward=!0;break;case l.keys.LEFT:l.moveLeft=!0;break;case l.keys.RIGHT:l.moveRight=!0;break;case l.keys.W:l.moveForward=!0;break;case l.keys.S:l.moveBackward=!0;break;case l.keys.A:l.moveLeft=!0;break;case l.keys.D:l.moveRight=!0}}function s(e){switch(e.keyCode){case l.keys.W:l.moveForward=!1;break;case l.keys.S:l.moveBackward=!1;break;case l.keys.A:l.moveLeft=!1;break;case l.keys.D:l.moveRight=!1;break;case l.keys.UP:l.moveForward=!1;break;case l.keys.BOTTOM:l.moveBackward=!1;break;case l.keys.LEFT:l.moveLeft=!1;break;case l.keys.RIGHT:l.moveRight=!1}}this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.rotateSpeed=1,this.moveSpeed=10,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40,A:"A".charCodeAt(0),S:"S".charCodeAt(0),D:"D".charCodeAt(0),W:"W".charCodeAt(0)};var l=this,d=new THREE.Vector2,c=new THREE.Vector2,u=new THREE.Vector2,h=new THREE.Vector2,p=new THREE.Vector2,m=new THREE.Vector2,E=new THREE.Vector3,v=(new THREE.Vector3,0),f=0,T=1,P=new THREE.Vector3,y=new THREE.Vector3,g={NONE:-1,ROTATE:0,SPEEDCHANGE:1,PAN:2},x=g.NONE;this.position0=this.object.position.clone();var b={type:"change"},R={type:"start"},w={type:"end"};this.rotateLeft=function(e){f-=e},this.rotateUp=function(e){v-=e},this.panLeft=function(e){var t=this.object.matrix.elements;E.set(t[0],t[1],t[2]),E.multiplyScalar(-e),P.add(E)},this.panUp=function(e){var t=this.object.matrix.elements;E.set(t[4],t[5],t[6]),E.multiplyScalar(e),P.add(E)},this.panForward=function(e){var t=this.object.matrix.elements;E.set(t[8],t[9],t[10]),E.multiplyScalar(e),P.add(E)},this.pan=function(e,t){var o=l.domElement===document?l.domElement.body:l.domElement;if(void 0!==l.object.fov){var i=l.object.position,r=i.clone(),n=r.length();n*=Math.tan(l.object.fov/2*Math.PI/180),l.panLeft(2*e*n/o.clientHeight),l.panUp(2*t*n/o.clientHeight)}else void 0!==l.object.top?(l.panLeft(e*(l.object.right-l.object.left)/o.clientWidth),l.panUp(t*(l.object.top-l.object.bottom)/o.clientHeight)):console.warn("WARNING: FirstPersonControls.js encountered an unknown camera type - pan disabled.")},this.update=function(e){var t=this.object.position;if(void 0!==e&&(this.moveRight&&this.panLeft(-e*this.moveSpeed),this.moveLeft&&this.panLeft(e*this.moveSpeed),this.moveForward&&this.panForward(-e*this.moveSpeed),this.moveBackward&&this.panForward(e*this.moveSpeed)),!P.equals(new THREE.Vector3(0,0,0))){var o={type:"move",translation:P.clone()};this.dispatchEvent(o)}t.add(P),this.object.updateMatrix();var i=(new THREE.Matrix4).makeRotationY(f),r=(new THREE.Matrix4).multiplyMatrices(i,this.object.matrix);this.object.quaternion.setFromRotationMatrix(r),this.object.rotation.x+=v,f=0,v=0,T=1,P.set(0,0,0),y.distanceTo(this.object.position)>0&&(this.dispatchEvent(b),y.copy(this.object.position))},this.reset=function(){x=g.NONE,this.object.position.copy(this.position0)},this.domElement.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mousewheel",n,!1),this.domElement.addEventListener("DOMMouseScroll",n,!1),window.addEventListener("keydown",a,!1),window.addEventListener("keyup",s,!1)},THREE.FirstPersonControls.prototype=Object.create(THREE.EventDispatcher.prototype),LRU.prototype.size=function(){return this.elements},LRU.prototype.contains=function(e){return null==this.items[e.id]},LRU.prototype.touch=function(e){var t;null==this.items[e.id]?(t=new LRUItem(e),t.previous=this.last,this.last=t,null!==t.previous&&(t.previous.next=t),this.items[e.id]=t,this.elements++,null===this.first&&(this.first=t),this.numPoints+=e.numPoints):(t=this.items[e.id],null===t.previous?null!==t.next&&(this.first=t.next,this.first.previous=null,t.previous=this.last,t.next=null,this.last=t,t.previous.next=t):null===t.next||(t.previous.next=t.next,t.next.previous=t.previous,t.previous=this.last,t.next=null,this.last=t,t.previous.next=t))},LRU.prototype.remove=function(){if(null===this.first)return null;var e=this.first;return null!==e.next?(this.first=e.next,this.first.previous=null):(this.first=null,this.last=null),delete this.items[e.node.id],this.elements--,this.numPoints-=e.node.numPoints,e.node},LRU.prototype.getLRUItem=function(){if(null===this.first)return null;var e=this.first;return e.node},LRU.prototype.toString=function(){for(var e="{ ",t=this.first;null!==t;)e+=t.node.id,null!==t.next&&(e+=", "),t=t.next;return e+="}",e+="("+this.size()+")"},Potree.PointCloudOctreeProxyNode=function(e){THREE.Object3D.call(this),this.geometryNode=e,this.boundingBox=e.boundingBox,this.name=e.name,this.level=e.level,this.numPoints=e.numPoints},Potree.PointCloudOctreeProxyNode.prototype=Object.create(THREE.Object3D.prototype),Potree.PointCloudOctree=function(e,t){THREE.Object3D.call(this),Potree.PointCloudOctree.lru=Potree.PointCloudOctree.lru||new LRU,this.pcoGeometry=e,this.boundingBox=this.pcoGeometry.root.boundingBox,this.material=t,this.maxVisibleNodes=2e3,this.maxVisiblePoints=2e7,this.level=0,this.LODDistance=20,this.LODFalloff=1.3,this.LOD=4,this.showBoundingBox=!1,this.loadQueue=[];var o=new Potree.PointCloudOctreeProxyNode(this.pcoGeometry.root);this.add(o)},Potree.PointCloudOctree.prototype=Object.create(THREE.Object3D.prototype),Potree.PointCloudOctree.prototype.update=function(e){this.numVisibleNodes=0,this.numVisiblePoints=0,this.loadQueue=[],e.updateMatrixWorld();var t=new THREE.Frustum,o=e.matrixWorldInverse,i=this.matrixWorld,r=e.projectionMatrix,n=(new THREE.Matrix4).multiply(r).multiply(o).multiply(i);t.setFromMatrix(n);var a=e.matrixWorld,s=(new THREE.Matrix4).getInverse(i),l=(new THREE.Matrix4).multiply(s).multiply(a),d=(new THREE.Vector3).setFromMatrixPosition(l),c=(new THREE.Ray(e.position,new THREE.Vector3(0,0,-1).applyQuaternion(e.quaternion)),[]);for(c.push(this);c.length>0;){var u=c.shift();if(u instanceof THREE.Mesh||u instanceof THREE.Line)u.visible=!0;else{var h=u.boundingBox,p=h.center().distanceTo(d),m=.5*h.size().length(),E=!0;if(E=E&&t.intersectsBox(h),u.level>0&&(E=E&&Math.pow(m,.8)/p>1/this.LOD,E=E&&this.numVisiblePoints+u.numPoints0){this.loadQueue.length>=2&&this.loadQueue.sort(function(e,t){return t.lod-e.lod});for(var T=0;Tn;n++)if(void 0!==t.children[n]){var a=t.children[n],s=new Potree.PointCloudOctreeProxyNode(a);i.add(s)}}},Potree.PointCloudOctree.prototype.hideDescendants=function(e){for(var t=[],o=0;o0;){var e=t.shift();e.visible=!1;for(var o=0;o0;){var u=r.shift();if(console.log("traversing: "+u.name),u instanceof THREE.PointCloud)for(var h=u.geometry,p=h.attributes.position,m=p.array,E=p.length/p.itemSize,v=0;E>v;v++){var f=new THREE.Vector3(m[3*v],m[3*v+1],m[3*v+2]);f.applyMatrix4(this.matrixWorld);var T=Math.abs(d.distanceToPoint(f));o/2>T&&c.push(f)}if(u==this||u.levelt)},Potree.PointCloudOctree.disposeNode=function(e){var t=0,o=0,i=[];e.traverse(function(e){i.push(e)});for(var r=0;r5)){this.loading=!0,Potree.PointCloudOctree.lru.numPoints+this.numPoints>=Potree.pointLoadLimit&&Potree.PointCloudOctree.disposeLeastRecentlyUsed(this.numPoints),this.pcoGeometry.numNodesLoading++;var e=this.pcoGeometry.pointAttributes;if("LAS"===e||"LAZ"===e){var t=this.pcoGeometry.octreeDir+"/"+this.name+"."+e.toLowerCase();nodesLoadTimes[t]={},nodesLoadTimes[t].start=(new Date).getTime(),LasLazLoader.load(t,new Potree.LasLazBatcher(this,t))}else if("POT"===e){var o=function(e,t){var o=new DataView(t,0,4),i=o.getUint32(0,!0),r=4+i,n=t.slice(4,4+i),a=String.fromCharCode.apply(null,new Uint8Array(n));a=JSON.parse(a),console.log(a);for(var s=a.attributes[0].scale,l=a.attributes[0].offset,d=a.attributes[0].encoding,c=new THREE.Vector3(s[0],s[1],s[2]),u=new THREE.Vector3(l[0],l[1],l[2]),h=d.min,p=(d.max,d.bits),m=t.slice(r,r+t.byteLength-r),E=new BitReader(m),v=E.read(32),f=E.read(32),T=E.read(32),P=E.read(8),g=E.read(8),b=E.read(8),R=new THREE.BufferGeometry,w=a.pointcount,C=new Float32Array(3*w),H=new Float32Array(3*w),A=(new THREE.Color,0);Ac;c++)n[3*c+0]=l[4*c+0]+e.pcoGeometry.offset.x,n[3*c+1]=l[4*c+1]+e.pcoGeometry.offset.y,n[3*c+2]=l[4*c+2]+e.pcoGeometry.offset.z,s.setRGB(d[16*c+12],d[16*c+13],d[16*c+14]),a[3*c+0]=s.r/255,a[3*c+1]=s.g/255,a[3*c+2]=s.b/255;i.addAttribute("position",new THREE.BufferAttribute(n,3)),i.addAttribute("color",new THREE.BufferAttribute(a,3)),i.boundingBox=e.boundingBox,e.geometry=i,e.loaded=!0,e.loading=!1,e.pcoGeometry.numNodesLoading--,nodesLoadTimes[t].end=(new Date).getTime();nodesLoadTimes[t].end-nodesLoadTimes[t].start};nodesLoadTimes[t]={},nodesLoadTimes[t].start=(new Date).getTime(),Potree.BinaryNodeLoader.load(this,"",o)}}},Potree.BinaryNodeLoader=function(){},Potree.BinaryNodeLoader.load=function(e,t,o){var i=e.pcoGeometry.octreeDir+"/"+e.name;void 0!==t&&t.length>0&&(i+="."+t);var r=new XMLHttpRequest;r.open("GET",i,!0),r.responseType="arraybuffer",r.overrideMimeType("text/plain; charset=x-user-defined"),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||0===r.status){var t=r.response;o(e,t)}else console.log("Failed to load file! HTTP status: "+r.status+", file: "+i)};try{r.send(null)}catch(n){console.log("fehler beim laden der punktwolke: "+n)}},Potree.LasLazBatcher=function(e,t){this.push=function(o){var i=Potree.workers.lasdecoder.getWorker(),r=new THREE.Vector3(o.mins[0],o.mins[1],o.mins[2]),n=new THREE.Vector3(o.maxs[0],o.maxs[1],o.maxs[2]);r.add(e.pcoGeometry.offset),n.add(e.pcoGeometry.offset),i.onmessage=function(a){for(var s=new THREE.BufferGeometry,l=o.pointsCount,d=a.data.position,c=a.data.color,u=a.data.intensity,h=new Uint8Array(a.data.classification),p=new Float32Array(h.byteLength),m=new THREE.Box3,E=new Float32Array(d),v=0;l>v;v++)p[v]=h[v],m.expandByPoint(new THREE.Vector3(E[3*v+0],E[3*v+1],E[3*v+2]));s.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3)),s.addAttribute("color",new THREE.BufferAttribute(new Float32Array(c),3)),s.addAttribute("intensity",new THREE.BufferAttribute(new Float32Array(u),1)),s.addAttribute("classification",new THREE.BufferAttribute(new Float32Array(p),1)),s.boundingBox=new THREE.Box3(r,n),e.boundingBox=s.boundingBox,e.geometry=s,e.loaded=!0,e.loading=!1,e.pcoGeometry.numNodesLoading--,nodesLoadTimes[t].end=(new Date).getTime();nodesLoadTimes[t].end-nodesLoadTimes[t].start;Potree.workers.lasdecoder.returnWorker(i)};var a={buffer:o.arrayb,numPoints:o.pointsCount,pointSize:o.pointSize,pointFormatID:2,scale:o.scale,offset:o.offset,mins:[e.pcoGeometry.boundingBox.min.x,e.pcoGeometry.boundingBox.min.y,e.pcoGeometry.boundingBox.min.z],maxs:[e.pcoGeometry.boundingBox.max.x,e.pcoGeometry.boundingBox.max.y,e.pcoGeometry.boundingBox.max.z],bbOffset:[e.pcoGeometry.offset.x,e.pcoGeometry.offset.y,e.pcoGeometry.offset.z]};i.postMessage(a,[a.buffer])}},Potree.PointCloudOctreeGeometryNode.prototype.dispose=function(){delete this.geometry,this.loaded=!1},Potree.utils=function(){},Potree.utils.pathExists=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),200!==t.status?!1:!0},Potree.utils.computeTransformedBoundingBox=function(e,t){var o=[new THREE.Vector3(e.min.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.max.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.min.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.max.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.max.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.min.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.max.y,e.max.z).applyMatrix4(t)],i=new THREE.Box3;return i.setFromPoints(o),i},Potree.utils.addCommas=function(e){e+="",x=e.split("."),x1=x[0],x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2},Potree.utils.createWorker=function(e){var t=new Blob([e],{type:"application/javascript"}),o=new Worker(URL.createObjectURL(t));return o},Potree.utils.loadSkybox=function(e){var t=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,1,1e5),o=new THREE.Scene,i=".jpg",r=[e+"px"+i,e+"nx"+i,e+"py"+i,e+"ny"+i,e+"pz"+i,e+"nz"+i],n=THREE.ImageUtils.loadTextureCube(r,new THREE.CubeRefractionMapping),a=new THREE.MeshBasicMaterial({color:16777215,envMap:n,refractionRatio:.95}),s=THREE.ShaderLib.cube;s.uniforms.tCube.value=n;var a=new THREE.ShaderMaterial({fragmentShader:s.fragmentShader,vertexShader:s.vertexShader,uniforms:s.uniforms,depthWrite:!1,side:THREE.BackSide}),l=new THREE.Mesh(new THREE.BoxGeometry(100,100,100),a);return o.add(l),{camera:t,scene:o}},Potree.utils.createGrid=function(e,t,o,i){for(var r=new THREE.LineBasicMaterial({color:i||8947848}),n=new THREE.Geometry,a=0;t>=a;a++)n.vertices.push(new THREE.Vector3(-(o*e)/2,0,a*o-o*t/2)),n.vertices.push(new THREE.Vector3(+(o*e)/2,0,a*o-o*t/2));for(var a=0;e>=a;a++)n.vertices.push(new THREE.Vector3(a*o-o*e/2,0,-(o*t)/2)),n.vertices.push(new THREE.Vector3(a*o-o*e/2,0,+(o*t)/2));var s=new THREE.Line(n,r,THREE.LinePieces);return s.receiveShadow=!0,s},Potree.TextSprite=function(e){var t=new THREE.Texture,o=new THREE.SpriteMaterial({map:t,useScreenCoordinates:!1});THREE.Sprite.call(this,o),this.borderThickness=4,this.fontface="Arial",this.fontsize=28,this.borderColor={r:0,g:0,b:0,a:1},this.backgroundColor={r:255,g:255,b:255,a:1},this.text="",this.setText(e)},Potree.TextSprite.prototype=new THREE.Sprite,Potree.TextSprite.prototype.setText=function(e){this.text=e,this.update()},Potree.TextSprite.prototype.setBorderColor=function(e){this.borderColor=e,this.update()},Potree.TextSprite.prototype.setBackgroundColor=function(e){this.backgroundColor=e,this.update()},Potree.TextSprite.prototype.update=function(){var e=document.createElement("canvas"),t=e.getContext("2d");t.font="Bold "+this.fontsize+"px "+this.fontface;var o=t.measureText(this.text),i=o.width,r=i+2*this.borderThickness,n=1.4*this.fontsize+2*this.borderThickness,e=document.createElement("canvas"),t=e.getContext("2d");t.canvas.width=r,t.canvas.height=n,t.font="Bold "+this.fontsize+"px "+this.fontface,t.fillStyle="rgba("+this.backgroundColor.r+","+this.backgroundColor.g+","+this.backgroundColor.b+","+this.backgroundColor.a+")",t.strokeStyle="rgba("+this.borderColor.r+","+this.borderColor.g+","+this.borderColor.b+","+this.borderColor.a+")",t.lineWidth=this.borderThickness,this.roundRect(t,this.borderThickness/2,this.borderThickness/2,i+this.borderThickness,1.4*this.fontsize+this.borderThickness,6),t.strokeStyle="rgba(0, 0, 0, 1.0)",t.strokeText(this.text,this.borderThickness,this.fontsize+this.borderThickness),t.fillStyle="rgba(255, 255, 255, 1.0)",t.fillText(this.text,this.borderThickness,this.fontsize+this.borderThickness);var a=new THREE.Texture(e);a.needsUpdate=!0,this.material.map=a,this.scale.set(.01*r,.01*n,1)},Potree.TextSprite.prototype.roundRect=function(e,t,o,i,r,n){e.beginPath(),e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath(),e.fill(),e.stroke()},Potree.MeasuringTool=function(e,t,o){function i(){this.points=[],this.spheres=[],this.edges=[],this.sphereLabels=[],this.edgeLabels=[]}function r(e){var t=l();if(t){var o=t.clone(),r=new THREE.MeshNormalMaterial({shading:THREE.SmoothShading}),n=new THREE.SphereGeometry(.4,10,10),a=new THREE.Mesh(n,r);a.position.copy(t),d.sceneRoot.add(a);var s=new THREE.Mesh(n,r);s.position.copy(t),d.sceneRoot.add(s);var h=o.x.toFixed(2)+" / "+o.y.toFixed(2)+" / "+o.z.toFixed(2),p=new Potree.TextSprite(h);p.setBorderColor({r:0,g:255,b:0,a:1}),p.material.depthTest=!1,p.material.opacity=0,p.position.copy(t),p.position.y+=.5,d.sceneRoot.add(p);var m=new Potree.TextSprite(h);m.setBorderColor({r:0,g:255,b:0,a:1}),m.material.depthTest=!1,m.material.opacity=0,m.position.copy(t),m.position.y+=.5,d.sceneRoot.add(m);var E=new THREE.Color(16711680),v=new THREE.Geometry;v.vertices.push(t.clone(),t.clone()),v.colors.push(E,E,E);var f=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});f.depthTest=!1,sConnection=new THREE.Line(v,f),d.sceneRoot.add(sConnection);var T=new Potree.TextSprite(0);T.setBorderColor({r:0,g:255,b:0,a:0}),T.setBackgroundColor({r:0,g:255,b:0,a:0}),T.material.depthTest=!1,T.position.copy(t),T.position.y+=.5,d.sceneRoot.add(T),u===c.DEFAULT?(u=c.PICKING,d.activeMeasurement=new i,d.activeMeasurement.spheres.push(a)):u===c.PICKING,d.activeMeasurement.points.push(t),d.activeMeasurement.spheres.push(s),d.activeMeasurement.sphereLabels.push(p),d.activeMeasurement.sphereLabels.push(m),d.activeMeasurement.edges.push(sConnection),d.activeMeasurement.edgeLabels.push(T);var e={type:"newpoint",position:o.clone()};d.dispatchEvent(e)}}function n(e){if(d.mouse.x=e.clientX/d.domElement.clientWidth*2-1,d.mouse.y=2*-(e.clientY/d.domElement.clientHeight)+1,u==c.PICKING&&d.activeMeasurement){var t=l();if(t){var o=t.clone(),i=d.activeMeasurement.spheres.length,r=d.activeMeasurement.spheres[i-1],n=d.activeMeasurement.sphereLabels[i-1],a=d.activeMeasurement.edges[i-2],s=d.activeMeasurement.edgeLabels[i-2],h=o.x.toFixed(2)+" / "+o.y.toFixed(2)+" / "+o.z.toFixed(2);n.setText(h),r.position.copy(t),n.position.copy(t),n.position.y+=.5,a.geometry.vertices[1].copy(t),a.geometry.verticesNeedUpdate=!0,a.geometry.computeBoundingSphere();var p=a.geometry.vertices[1].clone().add(a.geometry.vertices[0]).multiplyScalar(.5),m=a.geometry.vertices[0].distanceTo(a.geometry.vertices[1]).toFixed(2);s.position.copy(p),s.setText(m),s.scale.multiplyScalar(10)}}}function a(){if(u==c.PICKING){var e=d.activeMeasurement.spheres.pop(),t=d.activeMeasurement.edges.pop(),o=d.activeMeasurement.sphereLabels.pop(),i=d.activeMeasurement.edgeLabels.pop();d.sceneRoot.remove(e),d.sceneRoot.remove(t),d.sceneRoot.remove(o),d.sceneRoot.remove(i),d.measurements.push(d.activeMeasurement),d.activeMeasurement=void 0,u=c.DEFAULT}}function s(e){3===e.which&&a(e)}function l(){var e=new THREE.Vector3(d.mouse.x,d.mouse.y,.5),t=new THREE.Projector;t.unprojectVector(e,d.camera);var o=new THREE.Raycaster;o.params={PointCloud:{threshold:1}},o.ray.set(d.camera.position,e.sub(d.camera.position).normalize());var i=[];d.scene.traverse(function(e){e instanceof Potree.PointCloudOctree&&i.push(e)});var r=o.intersectObjects(i,!0);if(r.length>0){var n=r[0];return n.point}return void 0}var d=this;this.scene=e,this.camera=t,this.domElement=o,this.mouse={x:0,y:0};var c={DEFAULT:0,PICKING:1},u=c.DEFAULT;this.activeMeasurement,this.measurements=[],this.sceneMeasurement=new THREE.Scene,this.sceneRoot=new THREE.Object3D,this.sceneMeasurement.add(this.sceneRoot),this.domElement.addEventListener("dblclick",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",s,!1)},Potree.MeasuringTool.prototype=Object.create(THREE.EventDispatcher.prototype),Potree.ProfileTool=function(e,t,o){THREE.Object3D.call(this);var i=new THREE.BoxGeometry(1,1,1,1,1,1),r=new THREE.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.3});this.profileFrustum=new THREE.Mesh(i,r),this.add(this.profileFrustum),this.camera=new THREE.OrthographicCamera(-e/2,e/2,t/2,-t/2,1,1+o),this.add(this.camera),this.setDimension(e,t,o),this.rtProfile=new THREE.WebGLRenderTarget(512,512,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBFormat}),this.hudGeometry=new THREE.BoxGeometry(2,2,1),this.hudMaterial=new THREE.MeshBasicMaterial({color:16777215,map:this.rtProfile}),this.hudMaterial.depthTest=!1,this.hudElement=new THREE.Mesh(this.hudGeometry,this.hudMaterial),this.hudElement.scale.set(1,1,1),this.hudElement.position.set(0,0,0)},Potree.ProfileTool.prototype=Object.create(THREE.Object3D.prototype),Potree.ProfileTool.prototype.setDimension=function(e,t,o){this.profileFrustum.scale.set(e,t,o),this.width=e,this.height=t,this.depth=o,this.camera.left=-e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-t/2,this.camera.updateProjectionMatrix()},Potree.ProfileTool.prototype.setOrientation=function(e){var t=this.position.clone();this.position.add(e),this.lookAt(t),this.position.copy(t),this.camera.position.copy(t.clone().add(e)),this.camera.lookAt(t)},Potree.ProfileTool.prototype.render=function(e,t){this.camera.matrixWorld.copy(this.matrixWorld),t.traverse(function(e){e instanceof Potree.PointCloudOctree&&(e.material.oldSize=e.material.size,e.material.size=0)}),e.render(t,this.camera,this.rtProfile,!0),t.traverse(function(e){e instanceof Potree.PointCloudOctree&&(e.material.size=e.material.oldSize)})},Potree.TranslationTool=function(e){THREE.Object3D.call(this);var t=this;this.camera=e,this.geometry=new THREE.Geometry,this.material=new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.STATE={DEFAULT:0,TRANSLATE_X:1,TRANSLATE_Y:2,TRANSLATE_Z:3},this.parts={ARROW_X:{name:"arrow_x",object:void 0,color:new THREE.Color(16711680),state:this.STATE.TRANSLATE_X},ARROW_Y:{name:"arrow_y",object:void 0,color:new THREE.Color(65280),state:this.STATE.TRANSLATE_Y},ARROW_Z:{name:"arrow_z",object:void 0,color:new THREE.Color(255),state:this.STATE.TRANSLATE_Z}},this.translateStart,this.state=this.STATE.DEFAULT,this.highlighted,this.targets,this.build=function(){var e=t.createArrow(t.parts.ARROW_X,t.parts.ARROW_X.color);e.rotation.z=-Math.PI/2;var o=t.createArrow(t.parts.ARROW_Y,t.parts.ARROW_Y.color),i=t.createArrow(t.parts.ARROW_Z,t.parts.ARROW_Z.color);i.rotation.x=-Math.PI/2,t.add(e),t.add(o),t.add(i);var r=t.createBox(new THREE.Color(16776960));r.scale.z=.02,r.position.set(.5,.5,0);var n=t.createBox(new THREE.Color(16711935));n.scale.y=.02,n.position.set(.5,0,-.5);var a=t.createBox(new THREE.Color(65535));a.scale.x=.02,a.position.set(0,.5,-.5),t.add(r),t.add(n),t.add(a),t.parts.ARROW_X.object=e,t.parts.ARROW_Y.object=o,t.parts.ARROW_Z.object=i,t.scale.multiplyScalar(5)},this.createBox=function(e){var t=new THREE.BoxGeometry(1,1,1),o=new THREE.MeshBasicMaterial({color:e,transparent:!0,opacity:.5}),i=new THREE.Mesh(t,o);return i},this.createArrow=function(e,t){var o=new THREE.MeshBasicMaterial({color:t}),i=new THREE.CylinderGeometry(.1,.1,3,10,1,!1),r=o,n=new THREE.Mesh(i,r);n.position.y=1.5;var a=new THREE.CylinderGeometry(0,.3,1,10,1,!1),s=o,l=new THREE.Mesh(a,s);l.position.y=3;var d=new THREE.Object3D;return d.add(n),d.add(l),d.partID=e,d.material=o,d},this.setHighlighted=function(e){return void 0===e?void(t.highlighted&&(t.highlighted.object.material.color=t.highlighted.color,t.highlighted=void 0)):(void 0!==t.highlighted&&t.highlighted!==e&&(t.highlighted.object.material.color=t.highlighted.color),t.highlighted=e,void(e.object.material.color=new THREE.Color(16776960)))},this.getHoveredObject=function(e){var o=new THREE.Vector3(e.x,e.y,.5),i=new THREE.Projector;i.unprojectVector(o,t.camera);var r=new THREE.Raycaster;r.ray.set(t.camera.position,o.sub(t.camera.position).normalize());var n=r.intersectObject(t,!0);if(0===n.length)return void t.setHighlighted(void 0);var a=n[0],s=a.object.parent.partID;return s},this.onMouseMove=function(e){var o=e.normalizedPosition;if(t.state===t.STATE.DEFAULT)t.setHighlighted(t.getHoveredObject(o));else if(t.state===t.STATE.TRANSLATE_X||t.state===t.STATE.TRANSLATE_Y||t.state===t.STATE.TRANSLATE_Z){var i=t.start.lineStart.clone(),r=t.start.lineEnd.clone().sub(t.start.lineStart);r.normalize();var n=new THREE.Vector3(o.x,o.y),a=(new THREE.Vector3).subVectors(n,i).dot(r),s=r.clone().multiplyScalar(a).add(i),l=new THREE.Projector;l.unprojectVector(s,t.camera);var d=s.clone().sub(t.position);t.position.copy(s);for(var c=0;c=r?i.pointsCount:i.pointsCount/r,s=function(){var e=o.readData(1e6,0,r);return e.then(function(e){return t.push(new LASDecoder(e.buffer,i.pointsFormatId,i.pointsStructSize,e.count,i.scale,i.offset,i.mins,i.maxs)),n+=e.count,LasLazLoader.progressCB(n/a),e.hasMoreData?s():(i.totalRead=n,i.versionAsString=o.versionAsString,i.isCompressed=o.isCompressed,[o,i,t])})};return s()}).then(function(e){var t=e[0];return LasLazLoader.progressCB(1),t.close().then(function(){return t.isOpen=!1,Promise.delay(200).cancellable()}).then(function(){return e.slice(1)})}).catch(Promise.CancellationError,function(e){if(o.isOpen)return o.close().then(function(){throw o.isOpen=!1,e});throw e})},Potree.PointSizeType={FIXED:0,ATTENUATED:1,ADAPTIVE:2},Potree.PointShape={SQUARE:0,CIRCLE:1},Potree.PointColorType={RGB:0,COLOR:1,DEPTH:2,HEIGHT:3,INTENSITY:4,INTENSITY_GRADIENT:5,OCTREE_DEPTH:6,POINT_INDEX:7},Potree.PointCloudMaterial=function(e){e=e||{};var t=new THREE.Color(0),o=THREE.ImageUtils.generateDataTexture(2048,1,t);o.magFilter=THREE.NearestFilter,this.visibleNodesTexture=o;var i=e.size||1,r=e.minSize||1,n=1;this._pointSizeType=Potree.PointSizeType.ATTENUATED,this._pointShape=Potree.PointShape.SQUARE,this._interpolate=!1,this._pointColorType=Potree.PointColorType.RGB,this._octreeLevels=6,this.gradientTexture=Potree.PointCloudMaterial.generateGradient();var a={},s={uColor:{type:"c",value:new THREE.Color(16711680)},opacity:{type:"f",value:1},size:{type:"f",value:10},minSize:{type:"f",value:2},nodeSize:{type:"f",value:n},heightMin:{type:"f",value:0},heightMax:{type:"f",value:1},intensityMin:{type:"f",value:0},intensityMax:{type:"f",value:1},visibleNodes:{type:"t",value:this.visibleNodesTexture},pcIndex:{type:"f",value:0},gradient:{type:"t",value:this.gradientTexture}};this.setValues({uniforms:s,attributes:a,vertexShader:this.getDefines()+Potree.PointCloudMaterial.vs_points.join("\n"),fragmentShader:this.getDefines()+Potree.PointCloudMaterial.fs_points_rgb.join("\n"),vertexColors:THREE.VertexColors,size:i,minSize:r,nodeSize:n,pcIndex:0,alphaTest:.9})},Potree.PointCloudMaterial.prototype=new THREE.RawShaderMaterial,Potree.PointCloudMaterial.prototype.updateShaderSource=function(){var e={};(this.pointColorType===Potree.PointColorType.INTENSITY||this.pointColorType===Potree.PointColorType.INTENSITY_GRADIENT)&&(e.intensity={type:"f",value:[]}),this.setValues({attributes:e,vertexShader:this.getDefines()+Potree.PointCloudMaterial.vs_points.join("\n"),fragmentShader:this.getDefines()+Potree.PointCloudMaterial.fs_points_rgb.join("\n")}),this.setValues(1===this.opacity?{blending:THREE.NoBlending,transparent:!1,depthTest:!0,depthWrite:!0}:{blending:THREE.AdditiveBlending,transparent:!0,depthTest:!1,depthWrite:!0}),this.needsUpdate=!0},Potree.PointCloudMaterial.prototype.getDefines=function(){var e="";return this.pointSizeType===Potree.PointSizeType.FIXED?e+="#define fixed_point_size\n":this.pointSizeType===Potree.PointSizeType.ATTENUATED?e+="#define attenuated_point_size\n":this.pointSizeType===Potree.PointSizeType.ADAPTIVE&&(e+="#define adaptive_point_size\n",e+="#define octreeLevels "+Math.max(0,this._octreeLevels-2).toFixed(1)+"\n"),this.pointShape===Potree.PointShape.SQUARE?e+="#define square_point_shape\n":this.pointShape===Potree.PointShape.CIRCLE&&(e+="#define circle_point_shape\n"),this._interpolate&&(e+="#define use_interpolation\n"),this._pointColorType===Potree.PointColorType.RGB?e+="#define color_type_rgb\n":this._pointColorType===Potree.PointColorType.COLOR?e+="#define color_type_color\n":this._pointColorType===Potree.PointColorType.DEPTH?e+="#define color_type_depth\n":this._pointColorType===Potree.PointColorType.HEIGHT?e+="#define color_type_height\n":this._pointColorType===Potree.PointColorType.INTENSITY?e+="#define color_type_intensity\n":this._pointColorType===Potree.PointColorType.INTENSITY_GRADIENT?e+="#define color_type_intensity_gradient\n":this._pointColorType===Potree.PointColorType.OCTREE_DEPTH?e+="#define color_type_octree_depth\n":this._pointColorType===Potree.PointColorType.POINT_INDEX&&(e+="#define color_type_point_index\n"),e},Object.defineProperty(Potree.PointCloudMaterial.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value!==e&&(this.uniforms.opacity.value=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"octreeLevels",{get:function(){return this._octreeLevels},set:function(e){this._octreeLevels!==e&&(this._octreeLevels=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"pointColorType",{get:function(){return this._pointColorType},set:function(e){this._pointColorType!==e&&(this._pointColorType=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"pointSizeType",{get:function(){return this._pointSizeType},set:function(e){this._pointSizeType!==e&&(this._pointSizeType=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"interpolate",{get:function(){return this._interpolate},set:function(e){this._interpolate!==e&&(this._interpolate=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"color",{get:function(){return this.uniforms.uColor.value},set:function(e){this.uniforms.uColor.value!==e&&(this.uniforms.uColor.value.copy(e),this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"pointShape",{get:function(){return this._pointShape},set:function(e){this._pointShape!==e&&(this._pointShape=e,this.updateShaderSource())}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"size",{get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"minSize",{get:function(){return this.uniforms.minSize.value},set:function(e){this.uniforms.minSize.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"heightMin",{get:function(){return this.uniforms.heightMin.value},set:function(e){this.uniforms.heightMin.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"heightMax",{get:function(){return this.uniforms.heightMax.value},set:function(e){this.uniforms.heightMax.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"intensityMin",{get:function(){return this.uniforms.intensityMin.value},set:function(e){this.uniforms.intensityMin.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"intensityMax",{get:function(){return this.uniforms.intensityMax.value},set:function(e){this.uniforms.intensityMax.value=e}}),Object.defineProperty(Potree.PointCloudMaterial.prototype,"pcIndex",{get:function(){return this.uniforms.pcIndex.value},set:function(e){this.uniforms.pcIndex.value=e}}),Potree.PointCloudMaterial.generateGradient=function(){var e=64;canvas=document.createElement("canvas"),canvas.width=e,canvas.height=e;var t=canvas.getContext("2d");t.rect(0,0,e,e);var o=t.createLinearGradient(0,0,e,e);o.addColorStop(0,"blue"),o.addColorStop(.2,"aqua"),o.addColorStop(.4,"green"),o.addColorStop(.6,"yellow"),o.addColorStop(.8,"orange"),o.addColorStop(1,"red"),t.fillStyle=o,t.fill();var i=new THREE.Texture(canvas);return i.needsUpdate=!0,textureImage=i.image,i},Potree.PointCloudMaterial.vs_points=["precision highp float; ","precision highp int; "," ","attribute vec3 position; ","attribute vec3 color; ","attribute float intensity; ","attribute vec4 indices; "," ","uniform mat4 modelMatrix; ","uniform mat4 modelViewMatrix; ","uniform mat4 projectionMatrix; ","uniform mat4 viewMatrix; ","uniform mat3 normalMatrix; ","uniform vec3 cameraPosition; "," ","uniform float heightMin; ","uniform float heightMax; ","uniform float intensityMin; ","uniform float intensityMax; ","uniform float size; ","uniform float minSize; ","uniform float nodeSize; ","uniform vec3 uColor; "," ","uniform sampler2D visibleNodes; ","uniform sampler2D gradient; "," "," ","varying vec3 vColor; "," "," ","#if defined(adaptive_point_size) || defined(color_type_octree_depth) ","/** "," * number of 1-bits up to inclusive index position "," * number is treated as if it were an integer in the range 0-255 "," * "," */ ","float numberOfOnes(float number, float index){ "," float tmp = mod(number, pow(2.0, index + 1.0)); "," float numOnes = 0.0; "," for(float i = 0.0; i < 8.0; i++){ "," if(mod(tmp, 2.0) != 0.0){ "," numOnes++; "," } "," tmp = floor(tmp / 2.0); "," } "," return numOnes; ","} "," "," ","/** "," * checks whether the bit at index is 1 "," * number is treated as if it were an integer in the range 0-255 "," * "," */ ","bool isBitSet(float number, float index){ "," return mod(floor(number / pow(2.0, index)), 2.0) != 0.0; ","} "," "," ","/** "," * find the octree depth at the point position "," */ ","float getOctreeDepth(){ "," vec3 offset = vec3(0.0, 0.0, 0.0); "," float iOffset = 0.0; "," float depth = 0.0; "," for(float i = 0.0; i <= octreeLevels + 1.0; i++){ "," "," float nodeSizeAtLevel = nodeSize / pow(2.0, i); "," vec3 index3d = (position - offset) / nodeSizeAtLevel; "," index3d = floor(index3d + 0.5); "," float index = 4.0*index3d.x + 2.0*index3d.y + index3d.z; "," "," vec4 value = texture2D(visibleNodes, vec2(iOffset / 2048.0, 0.0)); "," float mask = value.r * 255.0; "," if(isBitSet(mask, index)){ "," // there are more visible child nodes at this position "," iOffset = iOffset + value.g * 255.0 + numberOfOnes(mask, index - 1.0); "," depth++; "," }else{ "," // no more visible child nodes at this position "," return depth; "," } "," offset = offset + (vec3(1.0, 1.0, 1.0) * nodeSizeAtLevel * 0.5) * index3d; "," } "," "," return depth; ","} "," ","#endif "," "," "," ","void main() { "," "," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); "," gl_Position = projectionMatrix * mvPosition; "," "," "," // COLOR TYPES "," "," #ifdef color_type_rgb "," vColor = color; "," #elif defined color_type_height "," vec4 world = modelMatrix * vec4( position, 1.0 ); "," float w = (world.y - heightMin) / (heightMax-heightMin); "," "," vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; "," #elif defined color_type_depth "," vColor = vec3(1.0, 1.0, 1.0) * gl_Position.w * 0.0001; "," #elif defined color_type_intensity "," float w = (intensity - intensityMin) / intensityMax; "," vColor = vec3(w, w, w); "," //vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; "," #elif defined color_type_intensity_gradient "," float w = (intensity - intensityMin) / intensityMax; "," vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; "," #elif defined color_type_color "," vColor = uColor; "," #elif defined color_type_octree_depth "," float depth = getOctreeDepth(); "," float w = depth / 10.0; "," vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; "," #elif defined color_type_point_index "," vColor = indices.rgb; "," #endif "," "," "," // "," // POINT SIZE TYPES "," // "," #if defined fixed_point_size "," gl_PointSize = size; "," #elif defined attenuated_point_size "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," #elif defined adaptive_point_size "," gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); "," gl_PointSize = gl_PointSize / pow(1.9, getOctreeDepth()); "," #endif "," "," gl_PointSize = max(minSize, gl_PointSize); "," gl_PointSize = min(30.0, gl_PointSize); "," "," ","} "],Potree.PointCloudMaterial.fs_points_rgb=["#if defined use_interpolation "," #extension GL_EXT_frag_depth : enable ","#endif "," ","precision highp float; ","precision highp int; "," ","uniform float opacity; ","uniform float pcIndex; "," ","varying vec3 vColor; "," "," ","void main() { "," "," #if defined(circle_point_shape) || defined(use_interpolation) "," float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); "," float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); "," float c = 1.0 - (a + b); "," "," if(c < 0.0){ "," discard; "," } "," #endif "," "," #if defined use_interpolation "," gl_FragDepthEXT = gl_FragCoord.z + 0.002*(1.0-pow(c, 1.0)) * gl_FragCoord.w; "," #endif "," "," "," #if defined color_type_point_index "," gl_FragColor = vec4(vColor, pcIndex / 255.0); "," #else "," gl_FragColor = vec4(vColor, opacity); "," #endif "," "," ","} "],THREE.FirstPersonControls=function(e,t){function o(e){l.enabled!==!1&&(e.preventDefault(),0===e.button?(b=g.ROTATE,d.set(e.clientX,e.clientY)):2===e.button&&(b=g.PAN,h.set(e.clientX,e.clientY)),l.domElement.addEventListener("mousemove",i,!1),l.domElement.addEventListener("mouseup",r,!1),l.dispatchEvent(R))}function i(e){if(l.enabled!==!1){e.preventDefault();var t=l.domElement===document?l.domElement.body:l.domElement;b===g.ROTATE?(c.set(e.clientX,e.clientY),u.subVectors(c,d),l.rotateLeft(2*Math.PI*u.x/t.clientWidth*l.rotateSpeed),l.rotateUp(2*Math.PI*u.y/t.clientHeight*l.rotateSpeed),d.copy(c)):b===g.PAN&&(p.set(e.clientX,e.clientY),m.subVectors(p,h),m.multiplyScalar(5e-4).multiplyScalar(l.moveSpeed),l.pan(m.x,m.y),h.copy(p))}}function r(){l.enabled!==!1&&(l.domElement.removeEventListener("mousemove",i,!1),l.domElement.removeEventListener("mouseup",r,!1),l.dispatchEvent(w),b=g.NONE)}function n(e){if(l.enabled!==!1&&l.noZoom!==!0){e.preventDefault();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),l.moveSpeed+=.001*l.moveSpeed*t,l.moveSpeed=Math.max(.1,l.moveSpeed),l.dispatchEvent(R),l.dispatchEvent(w)}}function a(e){if(l.enabled!==!1)switch(e.keyCode){case l.keys.UP:l.moveForward=!0;break;case l.keys.BOTTOM:l.moveBackward=!0;break;case l.keys.LEFT:l.moveLeft=!0;break;case l.keys.RIGHT:l.moveRight=!0;break;case l.keys.W:l.moveForward=!0;break;case l.keys.S:l.moveBackward=!0;break;case l.keys.A:l.moveLeft=!0;break;case l.keys.D:l.moveRight=!0}}function s(e){switch(e.keyCode){case l.keys.W:l.moveForward=!1;break;case l.keys.S:l.moveBackward=!1;break;case l.keys.A:l.moveLeft=!1; +break;case l.keys.D:l.moveRight=!1;break;case l.keys.UP:l.moveForward=!1;break;case l.keys.BOTTOM:l.moveBackward=!1;break;case l.keys.LEFT:l.moveLeft=!1;break;case l.keys.RIGHT:l.moveRight=!1}}this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.rotateSpeed=1,this.moveSpeed=10,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40,A:"A".charCodeAt(0),S:"S".charCodeAt(0),D:"D".charCodeAt(0),W:"W".charCodeAt(0)};var l=this,d=new THREE.Vector2,c=new THREE.Vector2,u=new THREE.Vector2,h=new THREE.Vector2,p=new THREE.Vector2,m=new THREE.Vector2,f=new THREE.Vector3,E=(new THREE.Vector3,0),T=0,v=1,y=new THREE.Vector3,P=new THREE.Vector3,g={NONE:-1,ROTATE:0,SPEEDCHANGE:1,PAN:2},b=g.NONE;this.position0=this.object.position.clone();var x={type:"change"},R={type:"start"},w={type:"end"};this.rotateLeft=function(e){T-=e},this.rotateUp=function(e){E-=e},this.panLeft=function(e){var t=this.object.matrix.elements;f.set(t[0],t[1],t[2]),f.multiplyScalar(-e),y.add(f)},this.panUp=function(e){var t=this.object.matrix.elements;f.set(t[4],t[5],t[6]),f.multiplyScalar(e),y.add(f)},this.panForward=function(e){var t=this.object.matrix.elements;f.set(t[8],t[9],t[10]),f.multiplyScalar(e),y.add(f)},this.pan=function(e,t){var o=l.domElement===document?l.domElement.body:l.domElement;if(void 0!==l.object.fov){var i=l.object.position,r=i.clone(),n=r.length();n*=Math.tan(l.object.fov/2*Math.PI/180),l.panLeft(2*e*n/o.clientHeight),l.panUp(2*t*n/o.clientHeight)}else void 0!==l.object.top?(l.panLeft(e*(l.object.right-l.object.left)/o.clientWidth),l.panUp(t*(l.object.top-l.object.bottom)/o.clientHeight)):console.warn("WARNING: FirstPersonControls.js encountered an unknown camera type - pan disabled.")},this.update=function(e){var t=this.object.position;if(void 0!==e&&(this.moveRight&&this.panLeft(-e*this.moveSpeed),this.moveLeft&&this.panLeft(e*this.moveSpeed),this.moveForward&&this.panForward(-e*this.moveSpeed),this.moveBackward&&this.panForward(e*this.moveSpeed)),!y.equals(new THREE.Vector3(0,0,0))){var o={type:"move",translation:y.clone()};this.dispatchEvent(o)}t.add(y),this.object.updateMatrix();var i=(new THREE.Matrix4).makeRotationY(T),r=(new THREE.Matrix4).multiplyMatrices(i,this.object.matrix);this.object.quaternion.setFromRotationMatrix(r),this.object.rotation.x+=E,T=0,E=0,v=1,y.set(0,0,0),P.distanceTo(this.object.position)>0&&(this.dispatchEvent(x),P.copy(this.object.position))},this.reset=function(){b=g.NONE,this.object.position.copy(this.position0)},this.domElement.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mousewheel",n,!1),this.domElement.addEventListener("DOMMouseScroll",n,!1),window.addEventListener("keydown",a,!1),window.addEventListener("keyup",s,!1)},THREE.FirstPersonControls.prototype=Object.create(THREE.EventDispatcher.prototype),LRU.prototype.size=function(){return this.elements},LRU.prototype.contains=function(e){return null==this.items[e.id]},LRU.prototype.touch=function(e){var t;null==this.items[e.id]?(t=new LRUItem(e),t.previous=this.last,this.last=t,null!==t.previous&&(t.previous.next=t),this.items[e.id]=t,this.elements++,null===this.first&&(this.first=t),this.numPoints+=e.numPoints):(t=this.items[e.id],null===t.previous?null!==t.next&&(this.first=t.next,this.first.previous=null,t.previous=this.last,t.next=null,this.last=t,t.previous.next=t):null===t.next||(t.previous.next=t.next,t.next.previous=t.previous,t.previous=this.last,t.next=null,this.last=t,t.previous.next=t))},LRU.prototype.remove=function(){if(null===this.first)return null;var e=this.first;return null!==e.next?(this.first=e.next,this.first.previous=null):(this.first=null,this.last=null),delete this.items[e.node.id],this.elements--,this.numPoints-=e.node.numPoints,e.node},LRU.prototype.getLRUItem=function(){if(null===this.first)return null;var e=this.first;return e.node},LRU.prototype.toString=function(){for(var e="{ ",t=this.first;null!==t;)e+=t.node.id,null!==t.next&&(e+=", "),t=t.next;return e+="}",e+="("+this.size()+")"},Potree.PointCloudOctreeProxyNode=function(e){THREE.Object3D.call(this),this.geometryNode=e,this.boundingBox=e.boundingBox,this.boundingSphere=this.boundingBox.getBoundingSphere(),this.name=e.name,this.level=e.level,this.numPoints=e.numPoints},Potree.PointCloudOctreeProxyNode.prototype=Object.create(THREE.Object3D.prototype),Potree.ProfileRequest=function(e,t,o,i,r){this.start=e,this.end=t,this.width=o,this.depth=i,this.callback=r,this.loadQueue=[];var n=((new THREE.Vector3).addVectors(t,e).multiplyScalar(.5),(new THREE.Vector3).subVectors(t,e).length(),(new THREE.Vector3).subVectors(t,e).normalize()),a=new THREE.Vector3(0,1,0),s=(new THREE.Vector3).crossVectors(n,a).normalize(),l=s;this.plane=(new THREE.Plane).setFromNormalAndCoplanarPoint(l,e)},Potree.PointCloudOctree=function(e,t){THREE.Object3D.call(this),Potree.PointCloudOctree.lru=Potree.PointCloudOctree.lru||new LRU,this.pcoGeometry=e,this.boundingBox=this.pcoGeometry.root.boundingBox,this.boundingSphere=this.boundingBox.getBoundingSphere(),this.material=t||new Potree.PointCloudMaterial,this.visiblePointsTarget=2e6,this.level=0,this.position.sub(e.offset),this.updateMatrix(),this.LODDistance=20,this.LODFalloff=1.3,this.LOD=4,this.showBoundingBox=!1,this.loadQueue=[],this.visibleBounds=new THREE.Box3,this.profileRequests=[],this.visibleNodes=[],this.visibleGeometry=[],this.pickTarget,this.pickMaterial,this.maxLevel=0;var o=new Potree.PointCloudOctreeProxyNode(this.pcoGeometry.root);this.add(o)},Potree.PointCloudOctree.prototype=Object.create(THREE.Object3D.prototype),Potree.PointCloudOctree.prototype.update=function(e){this.updateMatrixWorld(!0),this.visibleGeometry=this.getVisibleGeometry(e);for(var t=[],o=0;o0;){{var n=r.shift(),a=n.node;n.weight}if(a.visible=!0,a instanceof Potree.PointCloudOctreeProxyNode){var s=a.geometryNode;s.loaded===!0?this.replaceProxy(a):this.loadQueue.push(n)}else if(a instanceof THREE.PointCloud){this.numVisibleNodes++,this.numVisiblePoints+=a.numPoints,a.material=this.material,this.visibleNodes.push(n),a.level&&(this.maxLevel=Math.max(a.level,this.maxLevel));for(var o=0;o=0;if(d)for(var c=0;c0;){var p=r.shift();if(p instanceof Potree.PointCloudOctreeProxyNode){var m=Potree.utils.computeTransformedBoundingBox(p.boundingBox,p.matrixWorld),f=m.getBoundingSphere();Math.abs(u.distanceToPoint(f.center))0){var p=y.loadQueue[0],s=p.geometryNode;if(s.loaded===!0&&void 0!==p.parent){var a=this.replaceProxy(p);a.updateMatrixWorld(),a.matrixWorld.multiplyMatrices(a.parent.matrixWorld,a.matrix)}else p.geometryNode.load()}else{var P=this.getProfile(y.start,y.end,y.width,y.depth);y.callback({type:"finished",points:P}),v.push(y)}}for(var o=0;o-1&&this.profileRequests.splice(g,1)}if(this.loadQueue.length>0){this.loadQueue.length>=2&&this.loadQueue.sort(function(e,t){return t.weight-e.weight});for(var o=0;o0;){v++;var y=p.shift(),P=y.node,g=P.boundingBox,f=P.boundingSphere,b=i.intersectsBox(g),x=b;if(x){if(m+P.numPoints>this.visiblePointsTarget)break;m+=P.numPoints,t.push(y);for(var R in P.children){var w=P.children[R],f=w.boundingSphere,E=f.center.distanceTo(u),A=f.radius,T=f.radius/E,C=e.fov/2*Math.PI/180,S=1/Math.tan(C)*A/Math.sqrt(E*E-A*A);if(!(.1>S))if(T=S,0>E-A&&(T=Number.MAX_VALUE),0===p.length)p.push({node:w,weight:T});else{for(var H=0,M=0;Mp[M].weight){var H=M;break}if(M==p.length-1){H=p.length;break}}p.splice(H,0,{node:w,weight:T})}}}}return t},Potree.PointCloudOctree.prototype.updateVisibilityTexture=function(){if(this.material){for(var e=this.material.visibleNodesTexture,t=e.image.data,o=[],i=0;io?-1:o>i?1:0};o.sort(r);for(var i=0;it.name?1:0}),t[3*i+0]=0,t[3*i+1]=0,t[3*i+2]=0;for(var s=0;sn;n++)if(void 0!==t.children[n]){var a=t.children[n],s=new Potree.PointCloudOctreeProxyNode(a);i.add(s)}return i}},Potree.PointCloudOctree.prototype.hideDescendants=function(e){for(var t=[],o=0;o0;){var e=t.shift();e.visible=!1;for(var o=0;o0;){var f=n.shift(),E=0;if(f instanceof THREE.PointCloud)for(var T=f.geometry,v=T.attributes.position,y=v.array,P=v.length/v.itemSize,g=0;P>g;g++){var b=new THREE.Vector3(y[3*g],y[3*g+1],y[3*g+2]);b.applyMatrix4(this.matrixWorld);var x=Math.abs(h.distanceToPoint(b)),R=Math.abs(p.distanceToPoint(b));o/2>x&&s/2>R&&(m.push(b),E++)}if(f==this||f.levelt)},Potree.PointCloudOctree.disposeNode=function(e){var t=0,o=0,i=[];e.traverse(function(e){i.push(e)});for(var r=0;r5)){this.loading=!0,Potree.PointCloudOctree.lru.numPoints+this.numPoints>=Potree.pointLoadLimit&&Potree.PointCloudOctree.disposeLeastRecentlyUsed(this.numPoints),this.pcoGeometry.numNodesLoading++;var e=this.pcoGeometry.pointAttributes;if("LAS"===e||"LAZ"===e){var t=this.pcoGeometry.octreeDir+"/"+this.name+"."+e.toLowerCase();nodesLoadTimes[t]={},nodesLoadTimes[t].start=(new Date).getTime(),LasLazLoader.load(t,new Potree.LasLazBatcher(this,t))}else if("POT"===e){var o=function(e,t){var o=new DataView(t,0,4),i=o.getUint32(0,!0),r=4+i,n=t.slice(4,4+i),a=String.fromCharCode.apply(null,new Uint8Array(n));a=JSON.parse(a),console.log(a);for(var s=a.attributes[0].scale,l=a.attributes[0].offset,d=a.attributes[0].encoding,c=new THREE.Vector3(s[0],s[1],s[2]),u=new THREE.Vector3(l[0],l[1],l[2]),h=d.min,p=(d.max,d.bits),m=t.slice(r,r+t.byteLength-r),f=new BitReader(m),E=f.read(32),T=f.read(32),v=f.read(32),P=f.read(8),g=f.read(8),b=f.read(8),R=new THREE.BufferGeometry,w=a.pointcount,A=new Float32Array(3*w),C=new Float32Array(3*w),S=(new THREE.Color,0);Sh;h++)n[3*h+0]=d[4*h+0]+e.pcoGeometry.offset.x,n[3*h+1]=d[4*h+1]+e.pcoGeometry.offset.y,n[3*h+2]=d[4*h+2]+e.pcoGeometry.offset.z,l.setRGB(c[16*h+12],c[16*h+13],c[16*h+14]),a[3*h+0]=l.r/255,a[3*h+1]=l.g/255,a[3*h+2]=l.b/255,u[h]=h;i.addAttribute("position",new THREE.BufferAttribute(n,3)),i.addAttribute("color",new THREE.BufferAttribute(a,3)),i.addAttribute("indices",new THREE.BufferAttribute(s,1)),i.boundingBox=e.boundingBox,e.geometry=i,e.loaded=!0,e.loading=!1,e.pcoGeometry.numNodesLoading--,nodesLoadTimes[t].end=(new Date).getTime();nodesLoadTimes[t].end-nodesLoadTimes[t].start};nodesLoadTimes[t]={},nodesLoadTimes[t].start=(new Date).getTime(),Potree.BinaryNodeLoader.load(this,"",o)}}},Potree.BinaryNodeLoader=function(){},Potree.BinaryNodeLoader.load=function(e,t,o){var i=e.pcoGeometry.octreeDir+"/"+e.name;void 0!==t&&t.length>0&&(i+="."+t);var r=new XMLHttpRequest;r.open("GET",i,!0),r.responseType="arraybuffer",r.overrideMimeType("text/plain; charset=x-user-defined"),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||0===r.status){var t=r.response;o(e,t)}else console.log("Failed to load file! HTTP status: "+r.status+", file: "+i)};try{r.send(null)}catch(n){console.log("fehler beim laden der punktwolke: "+n)}},Potree.LasLazBatcher=function(e,t){this.push=function(o){var i=Potree.workers.lasdecoder.getWorker(),r=new THREE.Vector3(o.mins[0],o.mins[1],o.mins[2]),n=new THREE.Vector3(o.maxs[0],o.maxs[1],o.maxs[2]);r.add(e.pcoGeometry.offset),n.add(e.pcoGeometry.offset),i.onmessage=function(a){for(var s=new THREE.BufferGeometry,l=o.pointsCount,d=a.data.position,c=a.data.color,u=a.data.intensity,h=new Uint8Array(a.data.classification),p=new Float32Array(h.byteLength),m=new THREE.Box3,f=new Float32Array(d),E=0;l>E;E++)p[E]=h[E],m.expandByPoint(new THREE.Vector3(f[3*E+0],f[3*E+1],f[3*E+2]));s.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3)),s.addAttribute("color",new THREE.BufferAttribute(new Float32Array(c),3)),s.addAttribute("intensity",new THREE.BufferAttribute(new Float32Array(u),1)),s.addAttribute("classification",new THREE.BufferAttribute(new Float32Array(p),1)),s.boundingBox=new THREE.Box3(r,n),e.boundingBox=s.boundingBox,e.geometry=s,e.loaded=!0,e.loading=!1,e.pcoGeometry.numNodesLoading--,nodesLoadTimes[t].end=(new Date).getTime();nodesLoadTimes[t].end-nodesLoadTimes[t].start;Potree.workers.lasdecoder.returnWorker(i)};var a={buffer:o.arrayb,numPoints:o.pointsCount,pointSize:o.pointSize,pointFormatID:2,scale:o.scale,offset:o.offset,mins:[e.pcoGeometry.boundingBox.min.x,e.pcoGeometry.boundingBox.min.y,e.pcoGeometry.boundingBox.min.z],maxs:[e.pcoGeometry.boundingBox.max.x,e.pcoGeometry.boundingBox.max.y,e.pcoGeometry.boundingBox.max.z],bbOffset:[e.pcoGeometry.offset.x,e.pcoGeometry.offset.y,e.pcoGeometry.offset.z]};i.postMessage(a,[a.buffer])}},Potree.PointCloudOctreeGeometryNode.prototype.dispose=function(){delete this.geometry,this.loaded=!1},Potree.utils=function(){},Potree.utils.pathExists=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),200!==t.status?!1:!0},Potree.utils.computeTransformedBoundingBox=function(e,t){var o=[new THREE.Vector3(e.min.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.min.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.max.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.min.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.min.x,e.max.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.max.y,e.min.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.min.y,e.max.z).applyMatrix4(t),new THREE.Vector3(e.max.x,e.max.y,e.max.z).applyMatrix4(t)],i=new THREE.Box3;return i.setFromPoints(o),i},Potree.utils.addCommas=function(e){e+="",x=e.split("."),x1=x[0],x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2},Potree.utils.createWorker=function(e){var t=new Blob([e],{type:"application/javascript"}),o=new Worker(URL.createObjectURL(t));return o},Potree.utils.loadSkybox=function(e){var t=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,1,1e5),o=new THREE.Scene,i=".jpg",r=[e+"px"+i,e+"nx"+i,e+"py"+i,e+"ny"+i,e+"pz"+i,e+"nz"+i],n=THREE.ImageUtils.loadTextureCube(r,new THREE.CubeRefractionMapping),a=new THREE.MeshBasicMaterial({color:16777215,envMap:n,refractionRatio:.95}),s=THREE.ShaderLib.cube;s.uniforms.tCube.value=n;var a=new THREE.ShaderMaterial({fragmentShader:s.fragmentShader,vertexShader:s.vertexShader,uniforms:s.uniforms,depthWrite:!1,side:THREE.BackSide}),l=new THREE.Mesh(new THREE.BoxGeometry(100,100,100),a);return o.add(l),{camera:t,scene:o}},Potree.utils.createGrid=function(e,t,o,i){for(var r=new THREE.LineBasicMaterial({color:i||8947848}),n=new THREE.Geometry,a=0;t>=a;a++)n.vertices.push(new THREE.Vector3(-(o*e)/2,0,a*o-o*t/2)),n.vertices.push(new THREE.Vector3(+(o*e)/2,0,a*o-o*t/2));for(var a=0;e>=a;a++)n.vertices.push(new THREE.Vector3(a*o-o*e/2,0,-(o*t)/2)),n.vertices.push(new THREE.Vector3(a*o-o*e/2,0,+(o*t)/2));var s=new THREE.Line(n,r,THREE.LinePieces);return s.receiveShadow=!0,s},Potree.TextSprite=function(e){var t=new THREE.Texture,o=new THREE.SpriteMaterial({map:t,useScreenCoordinates:!1});THREE.Sprite.call(this,o),this.borderThickness=4,this.fontface="Arial",this.fontsize=28,this.borderColor={r:0,g:0,b:0,a:1},this.backgroundColor={r:255,g:255,b:255,a:1},this.text="",this.setText(e)},Potree.TextSprite.prototype=new THREE.Sprite,Potree.TextSprite.prototype.setText=function(e){this.text=e,this.update()},Potree.TextSprite.prototype.setBorderColor=function(e){this.borderColor=e,this.update()},Potree.TextSprite.prototype.setBackgroundColor=function(e){this.backgroundColor=e,this.update()},Potree.TextSprite.prototype.update=function(){var e=document.createElement("canvas"),t=e.getContext("2d");t.font="Bold "+this.fontsize+"px "+this.fontface;var o=t.measureText(this.text),i=o.width,r=i+2*this.borderThickness,n=1.4*this.fontsize+2*this.borderThickness,e=document.createElement("canvas"),t=e.getContext("2d");t.canvas.width=r,t.canvas.height=n,t.font="Bold "+this.fontsize+"px "+this.fontface,t.fillStyle="rgba("+this.backgroundColor.r+","+this.backgroundColor.g+","+this.backgroundColor.b+","+this.backgroundColor.a+")",t.strokeStyle="rgba("+this.borderColor.r+","+this.borderColor.g+","+this.borderColor.b+","+this.borderColor.a+")",t.lineWidth=this.borderThickness,this.roundRect(t,this.borderThickness/2,this.borderThickness/2,i+this.borderThickness,1.4*this.fontsize+this.borderThickness,6),t.strokeStyle="rgba(0, 0, 0, 1.0)",t.strokeText(this.text,this.borderThickness,this.fontsize+this.borderThickness),t.fillStyle="rgba(255, 255, 255, 1.0)",t.fillText(this.text,this.borderThickness,this.fontsize+this.borderThickness);var a=new THREE.Texture(e);a.needsUpdate=!0,this.material.map=a,this.scale.set(.01*r,.01*n,1)},Potree.TextSprite.prototype.roundRect=function(e,t,o,i,r,n){e.beginPath(),e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath(),e.fill(),e.stroke()},Potree.MeasuringTool=function(e,t,o){function i(){this.points=[],this.spheres=[],this.edges=[],this.sphereLabels=[],this.edgeLabels=[]}function r(e){var t=l();if(t){var o=t.clone(),r=new THREE.MeshNormalMaterial({shading:THREE.SmoothShading}),n=new THREE.SphereGeometry(.4,10,10),a=new THREE.Mesh(n,r);a.position.copy(t),d.sceneRoot.add(a);var s=new THREE.Mesh(n,r);s.position.copy(t),d.sceneRoot.add(s);var h=o.x.toFixed(2)+" / "+o.y.toFixed(2)+" / "+o.z.toFixed(2),p=new Potree.TextSprite(h);p.setBorderColor({r:0,g:255,b:0,a:1}),p.material.depthTest=!1,p.material.opacity=0,p.position.copy(t),p.position.y+=.5,d.sceneRoot.add(p);var m=new Potree.TextSprite(h);m.setBorderColor({r:0,g:255,b:0,a:1}),m.material.depthTest=!1,m.material.opacity=0,m.position.copy(t),m.position.y+=.5,d.sceneRoot.add(m);var f=new THREE.Color(16711680),E=new THREE.Geometry;E.vertices.push(t.clone(),t.clone()),E.colors.push(f,f,f);var T=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});T.depthTest=!1,sConnection=new THREE.Line(E,T),d.sceneRoot.add(sConnection);var v=new Potree.TextSprite(0);v.setBorderColor({r:0,g:255,b:0,a:0}),v.setBackgroundColor({r:0,g:255,b:0,a:0}),v.material.depthTest=!1,v.position.copy(t),v.position.y+=.5,d.sceneRoot.add(v),u===c.DEFAULT?(u=c.PICKING,d.activeMeasurement=new i,d.activeMeasurement.spheres.push(a)):u===c.PICKING,d.activeMeasurement.points.push(t),d.activeMeasurement.spheres.push(s),d.activeMeasurement.sphereLabels.push(p),d.activeMeasurement.sphereLabels.push(m),d.activeMeasurement.edges.push(sConnection),d.activeMeasurement.edgeLabels.push(v);var e={type:"newpoint",position:o.clone()};d.dispatchEvent(e)}}function n(e){if(d.mouse.x=e.clientX/d.domElement.clientWidth*2-1,d.mouse.y=2*-(e.clientY/d.domElement.clientHeight)+1,u==c.PICKING&&d.activeMeasurement){var t=l();if(t){var o=t.clone(),i=d.activeMeasurement.spheres.length,r=d.activeMeasurement.spheres[i-1],n=d.activeMeasurement.sphereLabels[i-1],a=d.activeMeasurement.edges[i-2],s=d.activeMeasurement.edgeLabels[i-2],h=o.x.toFixed(2)+" / "+o.y.toFixed(2)+" / "+o.z.toFixed(2);n.setText(h),r.position.copy(t),n.position.copy(t),n.position.y+=.5,a.geometry.vertices[1].copy(t),a.geometry.verticesNeedUpdate=!0,a.geometry.computeBoundingSphere();var p=a.geometry.vertices[1].clone().add(a.geometry.vertices[0]).multiplyScalar(.5),m=a.geometry.vertices[0].distanceTo(a.geometry.vertices[1]).toFixed(2);s.position.copy(p),s.setText(m),s.scale.multiplyScalar(10)}}}function a(){if(u==c.PICKING){var e=d.activeMeasurement.spheres.pop(),t=d.activeMeasurement.edges.pop(),o=d.activeMeasurement.sphereLabels.pop(),i=d.activeMeasurement.edgeLabels.pop();d.sceneRoot.remove(e),d.sceneRoot.remove(t),d.sceneRoot.remove(o),d.sceneRoot.remove(i),d.measurements.push(d.activeMeasurement),d.activeMeasurement=void 0,u=c.DEFAULT}}function s(e){3===e.which&&a(e)}function l(){var e=new THREE.Vector3(d.mouse.x,d.mouse.y,.5);e.unproject(d.camera);var t=e.sub(d.camera.position).normalize(),o=new THREE.Ray(d.camera.position,t),i=[];d.scene.traverse(function(e){e instanceof Potree.PointCloudOctree&&i.push(e)});for(var r=null,n=null,a=0;ac)&&(r=l,n=c)}}return r?r.position:null}var d=this;this.scene=e,this.camera=t,this.renderer=o,this.domElement=o.domElement,this.mouse={x:0,y:0},this.accuracy=.5;var c={DEFAULT:0,PICKING:1},u=c.DEFAULT;this.activeMeasurement,this.measurements=[],this.sceneMeasurement=new THREE.Scene,this.sceneRoot=new THREE.Object3D,this.sceneMeasurement.add(this.sceneRoot),this.domElement.addEventListener("dblclick",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",s,!1)},Potree.MeasuringTool.prototype=Object.create(THREE.EventDispatcher.prototype),Potree.ProfileTool=function(e,t,o){THREE.Object3D.call(this);var i=new THREE.BoxGeometry(1,1,1,1,1,1),r=new THREE.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.3});this.profileFrustum=new THREE.Mesh(i,r),this.add(this.profileFrustum),this.camera=new THREE.OrthographicCamera(-e/2,e/2,t/2,-t/2,1,1+o),this.add(this.camera),this.setDimension(e,t,o),this.rtProfile=new THREE.WebGLRenderTarget(512,512,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBFormat}),this.hudGeometry=new THREE.BoxGeometry(2,2,1),this.hudMaterial=new THREE.MeshBasicMaterial({color:16777215,map:this.rtProfile}),this.hudMaterial.depthTest=!1,this.hudElement=new THREE.Mesh(this.hudGeometry,this.hudMaterial),this.hudElement.scale.set(1,1,1),this.hudElement.position.set(0,0,0);var n=new THREE.Vector3(0,0,0),a=new THREE.Vector3(10,0,0);this.setCoordinates(n,a)},Potree.ProfileTool.prototype=Object.create(THREE.Object3D.prototype),Potree.ProfileTool.prototype.setDimension=function(e,t,o){this.profileFrustum.scale.set(e,t,o),this.width=e,this.height=t,this.depth=o,this.camera.left=-e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-t/2,this.camera.updateProjectionMatrix()},Potree.ProfileTool.prototype.setOrientation=function(e){var t=this.position.clone();this.position.add(e),this.lookAt(t),this.position.copy(t),this.camera.position.copy(t.clone().add(e)),this.camera.lookAt(t)},Potree.ProfileTool.prototype.setCoordinates=function(e,t){var o=e.distanceTo(t);this.setDimension(o,this.height,this.depth);var i=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5),r=(new THREE.Vector3).subVectors(t,e),n=new THREE.Vector3(r.z,0,-r.x);this.position.set(0,0,0),this.lookAt(n),this.position.copy(i),this.start=e,this.end=t},Potree.ProfileTool.prototype.render=function(e,t){this.camera.matrixWorld.copy(this.matrixWorld),t.traverse(function(e){e instanceof Potree.PointCloudOctree&&(e.material.oldSize=e.material.size,e.material.size=0) +}),e.render(t,this.camera,this.rtProfile,!0),t.traverse(function(e){e instanceof Potree.PointCloudOctree&&(e.material.size=e.material.oldSize)})},Potree.TranslationTool=function(e){THREE.Object3D.call(this);var t=this;this.camera=e,this.geometry=new THREE.Geometry,this.material=new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.STATE={DEFAULT:0,TRANSLATE_X:1,TRANSLATE_Y:2,TRANSLATE_Z:3},this.parts={ARROW_X:{name:"arrow_x",object:void 0,color:new THREE.Color(16711680),state:this.STATE.TRANSLATE_X},ARROW_Y:{name:"arrow_y",object:void 0,color:new THREE.Color(65280),state:this.STATE.TRANSLATE_Y},ARROW_Z:{name:"arrow_z",object:void 0,color:new THREE.Color(255),state:this.STATE.TRANSLATE_Z}},this.translateStart,this.state=this.STATE.DEFAULT,this.highlighted,this.targets,this.build=function(){var e=t.createArrow(t.parts.ARROW_X,t.parts.ARROW_X.color);e.rotation.z=-Math.PI/2;var o=t.createArrow(t.parts.ARROW_Y,t.parts.ARROW_Y.color),i=t.createArrow(t.parts.ARROW_Z,t.parts.ARROW_Z.color);i.rotation.x=-Math.PI/2,t.add(e),t.add(o),t.add(i);var r=t.createBox(new THREE.Color(16776960));r.scale.z=.02,r.position.set(.5,.5,0);var n=t.createBox(new THREE.Color(16711935));n.scale.y=.02,n.position.set(.5,0,-.5);var a=t.createBox(new THREE.Color(65535));a.scale.x=.02,a.position.set(0,.5,-.5),t.add(r),t.add(n),t.add(a),t.parts.ARROW_X.object=e,t.parts.ARROW_Y.object=o,t.parts.ARROW_Z.object=i,t.scale.multiplyScalar(5)},this.createBox=function(e){var t=new THREE.BoxGeometry(1,1,1),o=new THREE.MeshBasicMaterial({color:e,transparent:!0,opacity:.5}),i=new THREE.Mesh(t,o);return i},this.createArrow=function(e,t){var o=new THREE.MeshBasicMaterial({color:t}),i=new THREE.CylinderGeometry(.1,.1,3,10,1,!1),r=o,n=new THREE.Mesh(i,r);n.position.y=1.5;var a=new THREE.CylinderGeometry(0,.3,1,10,1,!1),s=o,l=new THREE.Mesh(a,s);l.position.y=3;var d=new THREE.Object3D;return d.add(n),d.add(l),d.partID=e,d.material=o,d},this.setHighlighted=function(e){return void 0===e?void(t.highlighted&&(t.highlighted.object.material.color=t.highlighted.color,t.highlighted=void 0)):(void 0!==t.highlighted&&t.highlighted!==e&&(t.highlighted.object.material.color=t.highlighted.color),t.highlighted=e,void(e.object.material.color=new THREE.Color(16776960)))},this.getHoveredObject=function(e){var o=new THREE.Vector3(e.x,e.y,.5);o.unproject(t.camera);var i=new THREE.Raycaster;i.ray.set(t.camera.position,o.sub(t.camera.position).normalize());var r=i.intersectObject(t,!0);if(0===r.length)return void t.setHighlighted(void 0);var n=r[0],a=n.object.parent.partID;return a},this.onMouseMove=function(e){var o=e.normalizedPosition;if(t.state===t.STATE.DEFAULT)t.setHighlighted(t.getHoveredObject(o));else if(t.state===t.STATE.TRANSLATE_X||t.state===t.STATE.TRANSLATE_Y||t.state===t.STATE.TRANSLATE_Z){var i=t.start.lineStart.clone(),r=t.start.lineEnd.clone().sub(t.start.lineStart);r.normalize();var n=new THREE.Vector3(o.x,o.y),a=(new THREE.Vector3).subVectors(n,i).dot(r),s=r.clone().multiplyScalar(a).add(i);s.unproject(t.camera);var l=s.clone().sub(t.position);t.position.copy(s);for(var d=0;d - -Lion - - - - - - - - - - - - - - - -
abc
- -
-
- - - - - - diff --git a/examples/georeferencing.html b/examples/georeferencing.html deleted file mode 100644 index 625f0e7b..00000000 --- a/examples/georeferencing.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - - - - - - - - - - Georeferencing Example - - -
-
- -
- potree.org
- - Georeferencing (sync with OpenLayers3) and Measurement.
- Double click to generate measurement points. Measurement points will be displayed - in the point cloud as well as the OpenStreetMap window. - -

- Point cloud courtesy of sigeom sa
- Rue des Oeuches 45
- 2740 Moutier
- Switzerland
- -
- -
- - - - \ No newline at end of file diff --git a/examples/georeferencing_measurement_heightprofile.html b/examples/georeferencing_measurement_heightprofile.html new file mode 100644 index 00000000..03b6981d --- /dev/null +++ b/examples/georeferencing_measurement_heightprofile.html @@ -0,0 +1,833 @@ + + + + + + Georeferencing Example + + + +
+ + + + + + + + + + + + + + + +
+ test +
+ +
+ potree.org
+ Point cloud courtesy of sigeom sa
+
+ +
+ +
+ Georeferencing, Height Profile and Measurement.
+ Double click to generate measurement points.
+ Drag endpoints of red line in map window to modify the profile.
+ Check "coordinates" to display mouse hover coordinates on the bottom left.
+ Push the button to create some spheres along the profile
+
+ + +
+ + + \ No newline at end of file diff --git a/examples/js/ProgressBar.js b/examples/js/ProgressBar.js new file mode 100644 index 00000000..e6b35e7f --- /dev/null +++ b/examples/js/ProgressBar.js @@ -0,0 +1,56 @@ + + +function ProgressBar(){ + this._progress = 0; + this._message = ""; + + this.maxOpacity = 0.6; + + this.element = document.createElement("div"); + this.element.innerHTML = ""; + this.element.style.position = "fixed"; + this.element.style.bottom = "20px"; + this.element.style.width = "200px"; + this.element.style.marginLeft = "-100px"; + this.element.style.left = "50%"; + this.element.style.borderRadius = "5px"; + this.element.style.border = "1px solid #727678"; + this.element.style.height = "16px"; + this.element.style.padding = "1px"; + // this.element.style.backgroundColor = "white"; + this.element.style.backgroundImage = "-webkit-linear-gradient(right, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%)"; + this.element.style.textAlign = "center"; + this.element.style.opacity = this.maxOpacity; + + document.body.appendChild(this.element); +}; + +ProgressBar.prototype.hide = function(){ + this.element.style.opacity = 0; + this.element.style.transition = "all 0.2s ease"; +}; + +ProgressBar.prototype.show = function(){ + this.element.style.opacity = this.maxOpacity; + this.element.style.transition = "all 0.2s ease"; +}; + +Object.defineProperty(ProgressBar.prototype, "progress", { + get: function(){ + return this._progress; + }, + set: function(value){ + this._progress = value; + this.element.style.backgroundImage = "-webkit-linear-gradient(left, #f2f6f8 0%,#d8e1e7 " + (value * 100) + "%,#b5c6d0 " + (value * 100 + 1) + "%,#e0eff9 100%)"; + } +}); + +Object.defineProperty(ProgressBar.prototype, "message", { + get: function(){ + return this._message; + }, + set: function(message){ + this._message = message; + this.element.innerHTML = message; + } +}); \ No newline at end of file diff --git a/examples/lion.html b/examples/lion.html index 474af6ef..92c58ca7 100644 --- a/examples/lion.html +++ b/examples/lion.html @@ -1,7 +1,6 @@ - - + Lion @@ -9,8 +8,13 @@ @@ -9,8 +8,13 @@ @@ -9,8 +8,13 @@ - - - - - - - - - - - - Georeferencing Example - - -
-
- -
- potree.org
- - Georeferencing (sync with OpenLayers3) and Measurement.
- Double click to generate measurement points. - -

- Point cloud courtesy of sigeom sa
- Rue des Oeuches 45
- 2740 Moutier
- Switzerland
-
- - - - \ No newline at end of file diff --git a/examples/profile.js b/examples/profile.js deleted file mode 100644 index 6a94877e..00000000 --- a/examples/profile.js +++ /dev/null @@ -1,774 +0,0 @@ - -function initSignals(){ - viewerControls = new ViewerControls(renderer.domElement, camera, scene); - - measuringControl = new Potree.MeasuringControls(scene, camera); - viewerControls.addControl(measuringControl); - - - viewerControls.addControl(translationTool); - - - var firstPersonControls = new THREE.FirstPersonControls(camera, renderer.domElement); - firstPersonControls.moveSpeed *= 10; - viewerControls.addControl(firstPersonControls); -} - - -ViewerControls = function(element, camera, scene){ - - var scope = this; - - this.mouse = {x: 0, y: 0}; - this.element = element; - this.camera = camera; - this.scene = scene; - - this.events = { - mousemove : new signals.Signal(), - mouseclick : new signals.Signal(), - mousedown : new signals.Signal(), - mouseup : new signals.Signal(), - mousewheel : new signals.Signal(), - dblclick : new signals.Signal(), - update : new signals.Signal(), - keydown: new signals.Signal(), - keyup: new signals.Signal() - }; - - - - this.addControl = function(control){ - if(control.onMouseMove !== undefined){ - scope.events.mousemove.add(control.onMouseMove); - } - - if(control.onMouseClick !== undefined){ - scope.events.mouseclick.add(control.onMouseClick); - } - - if(control.onMouseDown !== undefined){ - scope.events.mousedown.add(control.onMouseDown); - } - - if(control.onMouseUp !== undefined){ - scope.events.mouseup.add(control.onMouseUp); - } - - if(control.onMouseWheel !== undefined){ - scope.events.mousewheel.add(control.onMouseWheel); - } - - if(control.onDoubleClick !== undefined){ - scope.events.dblclick.add(control.onDoubleClick); - } - - if(control.update !== undefined){ - scope.events.update.add(control.update); - } - - if(control.onKeyDown !== undefined){ - scope.events.keydown.add(control.onKeyDown); - } - - if(control.onKeyUp !== undefined){ - scope.events.keyup.add(control.onKeyUp); - } - } - - this.onMouseMove = function(event){ - scope.mouse.x = ( event.clientX / scope.element.clientWidth ) * 2 - 1; - scope.mouse.y = - ( event.clientY / scope.element.clientHeight ) * 2 + 1; - - var vector = new THREE.Vector3( scope.mouse.x, scope.mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); - - scope.mouse.relativePosition = {x: event.clientX, y: event.clientY}; - scope.mouse.normalizedPosition = {x: scope.mouse.x, y: scope.mouse.y}; - scope.mouse.scenePosition = vector; - - var message = { - relativePosition: scope.mouse.relativePosition, - normalizedPosition: scope.mouse.normalizedPosition, - scenePosition: scope.mouse.scenePosition, - signal: scope.events.mousemove - }; - - scope.events.mousemove.dispatch(message); - } - - this.onMouseClick = function(event){ - var message = { - - }; - - scope.events.mouseclick.dispatch(message); - } - - this.onDoubleClick = function(event){ - - var message = { - relativePosition: scope.mouse.relativePosition, - normalizedPosition: scope.mouse.normalizedPosition, - scenePosition: scope.mouse.scenePosition - }; - - - scope.events.dblclick.dispatch(message); - } - - this.onMouseDown = function(event){ - event.preventDefault(); - - var message = { - which: event.which, - button: event.button, - relativePosition: scope.mouse.relativePosition, - normalizedPosition: scope.mouse.normalizedPosition, - scenePosition: scope.mouse.scenePosition, - signal: scope.events.mousedown - }; - - scope.events.mousedown.dispatch(message); - } - - this.onMouseUp = function(event){ - event.preventDefault(); - - var message = { - - }; - - scope.events.mouseup.dispatch(message); - } - - this.update = function(time){ - var message = { - time: time - }; - - scope.events.update.dispatch(message); - } - - this.onKeyDown = function(event){ - var message = { - keyCode: event.keyCode - }; - - scope.events.keydown.dispatch(message); - } - - this.onKeyUp = function(event){ - var message = { - keyCode: event.keyCode - }; - - scope.events.keyup.dispatch(message); - } - - this.onContextMenu = function(event){ - event.preventDefault(); - } - - this.onMouseWheel = function(event){ - event.preventDefault(); - - var delta = 0; - if ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9 - delta = event.wheelDelta; - } else if ( event.detail !== undefined ) { // Firefox - delta = - event.detail; - } - - var message = { - delta: delta - }; - - scope.events.mousewheel.dispatch(message); - } - - - element.addEventListener("mousemove", this.onMouseMove); - element.addEventListener("click", this.onMouseClick); - element.addEventListener("dblclick", this.onDoubleClick); - element.addEventListener("mousedown", this.onMouseDown); - element.addEventListener("mouseup", this.onMouseUp); - element.addEventListener("contextmenu", this.onContextMenu); - element.addEventListener("mousewheel", this.onMouseWheel); - - window.addEventListener("keydown", this.onKeyDown); - window.addEventListener("keyup", this.onKeyUp); -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Potree.MeasuringControls = function(scene, camera){ - - var scope = this; - - this.scene = scene; - this.camera = camera; - - this.mouse = {x: 0, y: 0}; - - var STATE = { - DEFAULT: 0, - PICKING: 1 - }; - - var state = STATE.DEFAULT; - - this.activeMeasurement; - this.measurements = []; - this.sceneMeasurement = new THREE.Scene(); - this.sceneRoot = new THREE.Object3D(); - this.sceneMeasurement.add(this.sceneRoot); - - function Measure(){ - this.points = []; - this.spheres = []; - this.edges = []; - this.sphereLabels = []; - this.edgeLabels = []; - } - - - this.onDoubleClick = function(event){ - var I = getMousePointCloudIntersection(event.normalizedPosition); - if(I){ - var pos = I.clone(); - - var sphereMaterial = new THREE.MeshNormalMaterial({shading: THREE.SmoothShading}) - var sphereGeometry = new THREE.SphereGeometry(0.4, 10, 10); - - var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial); - sphere.position.copy(I); - scope.sceneRoot.add(sphere); - - var sphereEnd = new THREE.Mesh(sphereGeometry, sphereMaterial); - sphereEnd.position.copy(I); - scope.sceneRoot.add(sphereEnd); - - var msg = pos.x.toFixed(2) + " / " + pos.y.toFixed(2) + " / " + pos.z.toFixed(2); - - var label = new Potree.TextSprite(msg); - label.setBorderColor({r:0, g:255, b:0, a:1.0}); - label.material.depthTest = false; - label.material.opacity = 0; - label.position.copy(I); - label.position.y += 0.5; - scope.sceneRoot.add( label ); - - var labelEnd = new Potree.TextSprite(msg); - labelEnd.setBorderColor({r:0, g:255, b:0, a:1.0}); - labelEnd.material.depthTest = false; - labelEnd.material.opacity = 0; - labelEnd.position.copy(I); - labelEnd.position.y += 0.5; - scope.sceneRoot.add( labelEnd ); - - var lc = new THREE.Color( 0xff0000 ); - var lineGeometry = new THREE.Geometry(); - lineGeometry.vertices.push(I.clone(), I.clone()); - lineGeometry.colors.push(lc, lc, lc); - var lineMaterial = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } ); - lineMaterial.depthTest = false; - sConnection = new THREE.Line(lineGeometry, lineMaterial); - scope.sceneRoot.add(sConnection); - - var edgeLabel = new Potree.TextSprite(0); - edgeLabel.setBorderColor({r:0, g:255, b:0, a:0.0}); - edgeLabel.setBackgroundColor({r:0, g:255, b:0, a:0.0}); - edgeLabel.material.depthTest = false; - edgeLabel.position.copy(I); - edgeLabel.position.y += 0.5; - scope.sceneRoot.add( edgeLabel ); - - - //floatingOrigin.addReferenceFrame(sphere); - //floatingOrigin.addReferenceFrame(sphereEnd); - //floatingOrigin.addReferenceFrame(label); - //floatingOrigin.addReferenceFrame(labelEnd); - //floatingOrigin.addReferenceFrame(sConnection); - //floatingOrigin.addReferenceFrame(edgeLabel); - - if(state === STATE.DEFAULT){ - state = STATE.PICKING; - scope.activeMeasurement = new Measure(); - - scope.activeMeasurement.spheres.push(sphere); - }else if(state === STATE.PICKING){ - - } - - scope.activeMeasurement.points.push(I); - - scope.activeMeasurement.spheres.push(sphereEnd); - scope.activeMeasurement.sphereLabels.push(label); - scope.activeMeasurement.sphereLabels.push(labelEnd); - scope.activeMeasurement.edges.push(sConnection); - scope.activeMeasurement.edgeLabels.push(edgeLabel); - - - var event = { - type: 'newpoint', - position: pos.clone() - }; - scope.dispatchEvent(event); - - } - }; - - this.onMouseMove = function(event){ - - if(state == STATE.PICKING && scope.activeMeasurement){ - var I = getMousePointCloudIntersection(event.normalizedPosition); - - if(I){ - var pos = I.clone(); - var l = scope.activeMeasurement.spheres.length; - var sphere = scope.activeMeasurement.spheres[l-1]; - var label = scope.activeMeasurement.sphereLabels[l-1]; - var edge = scope.activeMeasurement.edges[l-2]; - var edgeLabel = scope.activeMeasurement.edgeLabels[l-2]; - - var msg = pos.x.toFixed(2) + " / " + pos.y.toFixed(2) + " / " + pos.z.toFixed(2); - label.setText(msg); - - sphere.position.copy(I); - label.position.copy(I); - label.position.y += 0.5; - - edge.geometry.vertices[1].copy(I); - edge.geometry.verticesNeedUpdate = true; - edge.geometry.computeBoundingSphere(); - - var edgeLabelPos = edge.geometry.vertices[1].clone().add(edge.geometry.vertices[0]).multiplyScalar(0.5); - var edgeLabelText = edge.geometry.vertices[0].distanceTo(edge.geometry.vertices[1]).toFixed(2); - edgeLabel.position.copy(edgeLabelPos); - edgeLabel.setText(edgeLabelText); - edgeLabel.scale.multiplyScalar(10); - } - - } - }; - - this.onRightClick = function(event){ - if(state == STATE.PICKING){ - var sphere = scope.activeMeasurement.spheres.pop(); - var edge = scope.activeMeasurement.edges.pop(); - var sphereLabel = scope.activeMeasurement.sphereLabels.pop(); - var edgeLabel = scope.activeMeasurement.edgeLabels.pop(); - - scope.sceneRoot.remove(sphere); - scope.sceneRoot.remove(edge); - scope.sceneRoot.remove(sphereLabel); - scope.sceneRoot.remove(edgeLabel); - - scope.measurements.push(scope.activeMeasurement); - scope.activeMeasurement = undefined; - - state = STATE.DEFAULT; - } - } - - this.onMouseDown = function(event){ - if(event.which === 3){ - scope.onRightClick(event); - } - } - - function getMousePointCloudIntersection(mouse){ - var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); - - var raycaster = new THREE.Raycaster(); - raycaster.params = {"PointCloud" : {threshold: 1}}; - raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); - - var pointClouds = []; - scope.scene.traverse(function(object){ - if(object instanceof Potree.PointCloudOctree){ - pointClouds.push(object); - } - }); - - var intersects = raycaster.intersectObjects(pointClouds, true); - - if(intersects.length > 0){ - var I = intersects[0]; - - return I.point; - }else{ - return undefined; - } - } -}; - - -Potree.MeasuringControls.prototype = Object.create( THREE.EventDispatcher.prototype ); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -THREE.FirstPersonControls = function ( object, domElement ) { - this.object = object; - this.domElement = ( domElement !== undefined ) ? domElement : document; - - // Set to false to disable this control - this.enabled = true; - - this.rotateSpeed = 1.0; - this.moveSpeed = 10.0; - - this.keys = { - LEFT: 37, - UP: 38, - RIGHT: 39, - BOTTOM: 40, - A: 'A'.charCodeAt(0), - S: 'S'.charCodeAt(0), - D: 'D'.charCodeAt(0), - W: 'W'.charCodeAt(0) - }; - - var scope = this; - - var rotateStart = new THREE.Vector2(); - var rotateEnd = new THREE.Vector2(); - var rotateDelta = new THREE.Vector2(); - - var panStart = new THREE.Vector2(); - var panEnd = new THREE.Vector2(); - var panDelta = new THREE.Vector2(); - var panOffset = new THREE.Vector3(); - - var offset = new THREE.Vector3(); - - var phiDelta = 0; - var thetaDelta = 0; - var scale = 1; - var pan = new THREE.Vector3(); - - var lastPosition = new THREE.Vector3(); - - var STATE = { NONE : -1, ROTATE : 0, SPEEDCHANGE : 1, PAN : 2 }; - - var state = STATE.NONE; - - // for reset - this.position0 = this.object.position.clone(); - - // events - - var changeEvent = { type: 'change' }; - var startEvent = { type: 'start'}; - var endEvent = { type: 'end'}; - - this.rotateLeft = function ( angle ) { - thetaDelta -= angle; - }; - - this.rotateUp = function ( angle ) { - phiDelta -= angle; - }; - - // pass in distance in world space to move left - this.panLeft = function ( distance ) { - - var te = this.object.matrix.elements; - - // get X column of matrix - panOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] ); - panOffset.multiplyScalar( - distance ); - - pan.add( panOffset ); - - }; - - // pass in distance in world space to move up - this.panUp = function ( distance ) { - - var te = this.object.matrix.elements; - - // get Y column of matrix - panOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] ); - panOffset.multiplyScalar( distance ); - - pan.add( panOffset ); - - }; - - // pass in distance in world space to move forward - this.panForward = function ( distance ) { - - var te = this.object.matrix.elements; - - // get Y column of matrix - panOffset.set( te[ 8 ], te[ 9 ], te[ 10 ] ); - panOffset.multiplyScalar( distance ); - - pan.add( panOffset ); - - }; - - this.pan = function ( deltaX, deltaY ) { - - var element = scope.domElement === document ? scope.domElement.body : scope.domElement; - - if ( scope.object.fov !== undefined ) { - // perspective - var position = scope.object.position; - var offset = position.clone(); - var targetDistance = offset.length(); - - // half of the fov is center to top of screen - targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 ); - - // we actually don't use screenWidth, since perspective camera is fixed to screen height - scope.panLeft( 2 * deltaX * targetDistance / element.clientHeight ); - scope.panUp( 2 * deltaY * targetDistance / element.clientHeight ); - } else if ( scope.object.top !== undefined ) { - - // orthographic - scope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth ); - scope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight ); - } else { - - // camera neither orthographic or perspective - console.warn( 'WARNING: FirstPersonControls.js encountered an unknown camera type - pan disabled.' ); - } - }; - - this.update = function (event) { - var delta = event.time; - var position = scope.object.position; - - if(delta !== undefined){ - if(scope.moveRight){ - scope.panLeft(-delta * scope.moveSpeed); - } - if(scope.moveLeft){ - scope.panLeft(delta * scope.moveSpeed); - } - if(scope.moveForward){ - scope.panForward(-delta * scope.moveSpeed); - } - if(scope.moveBackward){ - scope.panForward(delta * scope.moveSpeed); - } - } - - if(!pan.equals(new THREE.Vector3(0,0,0))){ - var event = { - type: 'move', - translation: pan.clone() - }; - scope.dispatchEvent(event); - } - - position.add(pan); - - scope.object.updateMatrix(); - var rot = new THREE.Matrix4().makeRotationY(thetaDelta); - var res = new THREE.Matrix4().multiplyMatrices(rot, scope.object.matrix); - scope.object.quaternion.setFromRotationMatrix(res); - - scope.object.rotation.x += phiDelta; - - thetaDelta = 0; - phiDelta = 0; - scale = 1; - pan.set( 0, 0, 0 ); - - if ( lastPosition.distanceTo( scope.object.position ) > 0 ) { - scope.dispatchEvent( changeEvent ); - - lastPosition.copy( scope.object.position ); - } - }; - - - this.reset = function () { - state = STATE.NONE; - - this.object.position.copy( this.position0 ); - }; - - this.onMouseDown = function( event ) { - if ( scope.enabled === false ) return; - - if ( event.button === 0 ) { - state = STATE.ROTATE; - - rotateStart.set( event.relativePosition.x, event.relativePosition.y ); - } else if ( event.button === 2 ) { - state = STATE.PAN; - - panStart.set( event.relativePosition.x, event.relativePosition.y ); - } - - scope.dispatchEvent( startEvent ); - } - - this.onMouseMove = function( event ) { - if ( scope.enabled === false ) return; - - var element = scope.domElement === document ? scope.domElement.body : scope.domElement; - - if ( state === STATE.ROTATE ) { - rotateEnd.set( event.relativePosition.x, event.relativePosition.y ); - rotateDelta.subVectors( rotateEnd, rotateStart ); - - // rotating across whole screen goes 360 degrees around - scope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); - - // rotating up and down along whole screen attempts to go 360, but limited to 180 - scope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); - - rotateStart.copy( rotateEnd ); - - } else if ( state === STATE.PAN ) { - panEnd.set( event.relativePosition.x, event.relativePosition.y ); - panDelta.subVectors( panEnd, panStart ); - panDelta.multiplyScalar(0.0005).multiplyScalar(scope.moveSpeed); - - scope.pan( panDelta.x, panDelta.y ); - - panStart.copy( panEnd ); - } - } - - this.onMouseUp = function() { - if ( scope.enabled === false ) return; - - scope.dispatchEvent( endEvent ); - state = STATE.NONE; - - } - - this.onMouseWheel = function(event) { - if ( scope.enabled === false || scope.noZoom === true ) return; - - scope.moveSpeed += scope.moveSpeed * 0.001 * event.delta; - scope.moveSpeed = Math.max(0.1, scope.moveSpeed); - - scope.dispatchEvent( startEvent ); - scope.dispatchEvent( endEvent ); - } - - this.onKeyDown = function( event ) { - if ( scope.enabled === false) return; - - switch ( event.keyCode ) { - case scope.keys.UP: scope.moveForward = true; break; - case scope.keys.BOTTOM: scope.moveBackward = true; break; - case scope.keys.LEFT: scope.moveLeft = true; break; - case scope.keys.RIGHT: scope.moveRight = true; break; - case scope.keys.W: scope.moveForward = true; break; - case scope.keys.S: scope.moveBackward = true; break; - case scope.keys.A: scope.moveLeft = true; break; - case scope.keys.D: scope.moveRight = true; break; - } - } - - this.onKeyUp = function( event ) { - switch ( event.keyCode ) { - case scope.keys.W: scope.moveForward = false; break; - case scope.keys.S: scope.moveBackward = false; break; - case scope.keys.A: scope.moveLeft = false; break; - case scope.keys.D: scope.moveRight = false; break; - case scope.keys.UP: scope.moveForward = false; break; - case scope.keys.BOTTOM: scope.moveBackward = false; break; - case scope.keys.LEFT: scope.moveLeft = false; break; - case scope.keys.RIGHT: scope.moveRight = false; break; - } - } - -}; - -THREE.FirstPersonControls.prototype = Object.create( THREE.EventDispatcher.prototype ); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 556947e4..5b518fee 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,11 +21,7 @@ var paths = { "src/loader/POCLoader.js", "src/loader/PointAttributes.js", "src/loader/LasLazLoader.js", - "src/materials/PointCloudRGBMaterial.js", - "src/materials/PointCloudRGBInterpolationMaterial.js", - "src/materials/PointCloudIntensityMaterial.js", - "src/materials/PointCloudHeightMaterial.js", - "src/materials/PointCloudColorMaterial.js", + "src/materials/PointCloudMaterial.js", "src/FirstPersonControls.js", "src/LRU.js", "src/PointCloudOctree.js", diff --git a/libs/three.js/build/three.js b/libs/three.js/build/three.js index d98a124a..636b15d6 100644 --- a/libs/three.js/build/three.js +++ b/libs/three.js/build/three.js @@ -4,15 +4,32 @@ * @author mrdoob / http://mrdoob.com/ */ -var THREE = { REVISION: '68' }; +var THREE = { REVISION: '69' }; // browserify support + if ( typeof module === 'object' ) { module.exports = THREE; } +// polyfills + +if ( Math.sign === undefined ) { + + Math.sign = function ( x ) { + + return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : 0; + + }; + +} + +// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button + +THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; + // GL STATE CONSTANTS THREE.CullFaceNone = 0; @@ -65,6 +82,8 @@ THREE.CustomBlending = 5; THREE.AddEquation = 100; THREE.SubtractEquation = 101; THREE.ReverseSubtractEquation = 102; +THREE.MinEquation = 103; +THREE.MaxEquation = 104; // custom blending destination factors @@ -146,20 +165,21 @@ THREE.RGBAFormat = 1021; THREE.LuminanceFormat = 1022; THREE.LuminanceAlphaFormat = 1023; -// Compressed texture formats +// DDS / ST3C Compressed texture formats THREE.RGB_S3TC_DXT1_Format = 2001; THREE.RGBA_S3TC_DXT1_Format = 2002; THREE.RGBA_S3TC_DXT3_Format = 2003; THREE.RGBA_S3TC_DXT5_Format = 2004; -/* -// Potential future PVRTC compressed texture formats + +// PVRTC compressed texture formats + THREE.RGB_PVRTC_4BPPV1_Format = 2100; THREE.RGB_PVRTC_2BPPV1_Format = 2101; THREE.RGBA_PVRTC_4BPPV1_Format = 2102; THREE.RGBA_PVRTC_2BPPV1_Format = 2103; -*/ + // File:src/math/Color.js @@ -973,6 +993,9 @@ THREE.Quaternion.prototype = { slerp: function ( qb, t ) { + if ( t === 0 ) return this; + if ( t === 1 ) return this.copy( qb ); + var x = this._x, y = this._y, z = this._z, w = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ @@ -1039,12 +1062,14 @@ THREE.Quaternion.prototype = { }, - fromArray: function ( array ) { + fromArray: function ( array, offset ) { - this._x = array[ 0 ]; - this._y = array[ 1 ]; - this._z = array[ 2 ]; - this._w = array[ 3 ]; + if ( offset === undefined ) offset = 0; + + this._x = array[ offset ]; + this._y = array[ offset + 1 ]; + this._z = array[ offset + 2 ]; + this._w = array[ offset + 3 ]; this.onChangeCallback(); @@ -1052,9 +1077,17 @@ THREE.Quaternion.prototype = { }, - toArray: function () { + toArray: function ( array, offset ) { - return [ this._x, this._y, this._z, this._w ]; + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._w; + + return array; }, @@ -1461,18 +1494,26 @@ THREE.Vector2.prototype = { }, - fromArray: function ( array ) { + fromArray: function ( array, offset ) { - this.x = array[ 0 ]; - this.y = array[ 1 ]; + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; return this; }, - toArray: function () { + toArray: function ( array, offset ) { - return [ this.x, this.y ]; + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + + return array; }, @@ -1793,6 +1834,36 @@ THREE.Vector3.prototype = { }, + project: function () { + + var matrix; + + return function ( camera ) { + + if ( matrix === undefined ) matrix = new THREE.Matrix4(); + + matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) ); + return this.applyProjection( matrix ); + + }; + + }(), + + unproject: function () { + + var matrix; + + return function ( camera ) { + + if ( matrix === undefined ) matrix = new THREE.Matrix4(); + + matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) ); + return this.applyProjection( matrix ); + + }; + + }(), + transformDirection: function ( m ) { // input: THREE.Matrix4 affine matrix @@ -2242,19 +2313,28 @@ THREE.Vector3.prototype = { }, - fromArray: function ( array ) { + fromArray: function ( array, offset ) { - this.x = array[ 0 ]; - this.y = array[ 1 ]; - this.z = array[ 2 ]; + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; return this; }, - toArray: function () { + toArray: function ( array, offset ) { - return [ this.x, this.y, this.z ]; + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + + return array; }, @@ -2891,20 +2971,30 @@ THREE.Vector4.prototype = { }, - fromArray: function ( array ) { + fromArray: function ( array, offset ) { - this.x = array[ 0 ]; - this.y = array[ 1 ]; - this.z = array[ 2 ]; - this.w = array[ 3 ]; + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + this.w = array[ offset + 3 ]; return this; }, - toArray: function () { + toArray: function ( array, offset ) { - return [ this.x, this.y, this.z, this.w ]; + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + array[ offset + 3 ] = this.w; + + return array; }, @@ -3708,17 +3798,37 @@ THREE.Box3.prototype = { object.traverse( function ( node ) { - if ( node.geometry !== undefined && node.geometry.vertices !== undefined ) { + var geometry = node.geometry; - var vertices = node.geometry.vertices; + if ( geometry !== undefined ) { - for ( var i = 0, il = vertices.length; i < il; i ++ ) { + if ( geometry instanceof THREE.Geometry ) { - v1.copy( vertices[ i ] ); + var vertices = geometry.vertices; - v1.applyMatrix4( node.matrixWorld ); + for ( var i = 0, il = vertices.length; i < il; i ++ ) { - scope.expandByPoint( v1 ); + v1.copy( vertices[ i ] ); + + v1.applyMatrix4( node.matrixWorld ); + + scope.expandByPoint( v1 ); + + } + + } else if ( geometry instanceof THREE.BufferGeometry && geometry.attributes[ 'position' ] !== undefined ) { + + var positions = geometry.attributes[ 'position' ].array; + + for ( var i = 0, il = positions.length; i < il; i += 3 ) { + + v1.set( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); + + v1.applyMatrix4( node.matrixWorld ); + + scope.expandByPoint( v1 ); + + } } @@ -3978,15 +4088,21 @@ THREE.Box3.prototype = { * @author bhouston / http://exocortex.com */ -THREE.Matrix3 = function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { +THREE.Matrix3 = function () { - this.elements = new Float32Array( 9 ); + this.elements = new Float32Array( [ - var te = this.elements; + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 - te[ 0 ] = ( n11 !== undefined ) ? n11 : 1; te[ 3 ] = n12 || 0; te[ 6 ] = n13 || 0; - te[ 1 ] = n21 || 0; te[ 4 ] = ( n22 !== undefined ) ? n22 : 1; te[ 7 ] = n23 || 0; - te[ 2 ] = n31 || 0; te[ 5 ] = n32 || 0; te[ 8 ] = ( n33 !== undefined ) ? n33 : 1; + ] ); + + if ( arguments.length > 0 ) { + + console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); + + } }; @@ -4233,15 +4349,7 @@ THREE.Matrix3.prototype = { clone: function () { - var te = this.elements; - - return new THREE.Matrix3( - - te[ 0 ], te[ 3 ], te[ 6 ], - te[ 1 ], te[ 4 ], te[ 7 ], - te[ 2 ], te[ 5 ], te[ 8 ] - - ); + return new THREE.Matrix3().fromArray( this.elements ); } @@ -4262,20 +4370,22 @@ THREE.Matrix3.prototype = { * @author WestLangley / http://github.com/WestLangley */ +THREE.Matrix4 = function () { -THREE.Matrix4 = function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + this.elements = new Float32Array( [ - this.elements = new Float32Array( 16 ); + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - // TODO: if n11 is undefined, then just set to identity, otherwise copy all other values into matrix - // we should not support semi specification of Matrix4, it is just weird. + ] ); - var te = this.elements; + if ( arguments.length > 0 ) { - te[ 0 ] = ( n11 !== undefined ) ? n11 : 1; te[ 4 ] = n12 || 0; te[ 8 ] = n13 || 0; te[ 12 ] = n14 || 0; - te[ 1 ] = n21 || 0; te[ 5 ] = ( n22 !== undefined ) ? n22 : 1; te[ 9 ] = n23 || 0; te[ 13 ] = n24 || 0; - te[ 2 ] = n31 || 0; te[ 6 ] = n32 || 0; te[ 10 ] = ( n33 !== undefined ) ? n33 : 1; te[ 14 ] = n34 || 0; - te[ 3 ] = n41 || 0; te[ 7 ] = n42 || 0; te[ 11 ] = n43 || 0; te[ 15 ] = ( n44 !== undefined ) ? n44 : 1; + console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + + } }; @@ -4321,7 +4431,7 @@ THREE.Matrix4.prototype = { extractPosition: function ( m ) { - console.warn( 'THREEMatrix4: .extractPosition() has been renamed to .copyPosition().' ); + console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); return this.copyPosition( m ); }, @@ -5205,16 +5315,7 @@ THREE.Matrix4.prototype = { clone: function () { - var te = this.elements; - - return new THREE.Matrix4( - - te[ 0 ], te[ 4 ], te[ 8 ], te[ 12 ], - te[ 1 ], te[ 5 ], te[ 9 ], te[ 13 ], - te[ 2 ], te[ 6 ], te[ 10 ], te[ 14 ], - te[ 3 ], te[ 7 ], te[ 11 ], te[ 15 ] - - ); + return new THREE.Matrix4().fromArray( this.elements ); } @@ -6422,12 +6523,6 @@ THREE.Math = { }, - sign: function ( x ) { - - return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : 0; - - }, - degToRad: function () { var degreeToRadiansFactor = Math.PI / 180; @@ -7070,7 +7165,7 @@ THREE.EventDispatcher.prototype = { }; // - + THREE.Raycaster.prototype = { constructor: THREE.Raycaster, @@ -7101,6 +7196,13 @@ THREE.EventDispatcher.prototype = { var intersects = []; + if ( objects instanceof Array === false ) { + + console.log( 'THREE.Raycaster.intersectObjects: objects is not an Array.' ); + return intersects; + + } + for ( var i = 0, l = objects.length; i < l; i ++ ) { intersectObject( objects[ i ], this, intersects, recursive ); @@ -7128,10 +7230,12 @@ THREE.EventDispatcher.prototype = { THREE.Object3D = function () { - this.id = THREE.Object3DIdCount ++; + Object.defineProperty( this, 'id', { value: THREE.Object3DIdCount ++ } ); + this.uuid = THREE.Math.generateUUID(); this.name = ''; + this.type = 'Object3D'; this.parent = undefined; this.children = []; @@ -7145,13 +7249,16 @@ THREE.Object3D = function () { var quaternion = new THREE.Quaternion(); var scale = new THREE.Vector3( 1, 1, 1 ); - rotation.onChange( function () { + var onRotationChange = function () { quaternion.setFromEuler( rotation, false ); - } ); + }; - quaternion.onChange( function () { + var onQuaternionChange = function () { rotation.setFromQuaternion( quaternion, undefined, false ); - } ); + }; + + rotation.onChange( onRotationChange ); + quaternion.onChange( onQuaternionChange ); Object.defineProperties( this, { position: { @@ -7450,26 +7557,10 @@ THREE.Object3D.prototype = { this.children.push( object ); - // add to scene - - var scene = this; - - while ( scene.parent !== undefined ) { - - scene = scene.parent; - - } - - if ( scene !== undefined && scene instanceof THREE.Scene ) { - - scene.__addObject( object ); - - } - } else { - + console.error( "THREE.Object3D.add:", object, "is not an instance of THREE.Object3D." ); - + } return this; @@ -7493,30 +7584,144 @@ THREE.Object3D.prototype = { if ( index !== - 1 ) { object.parent = undefined; + object.dispatchEvent( { type: 'removed' } ); this.children.splice( index, 1 ); - // remove from scene + } - var scene = this; + }, - while ( scene.parent !== undefined ) { + getChildByName: function ( name, recursive ) { - scene = scene.parent; + console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); + return this.getObjectByName( name, recursive ); - } + }, - if ( scene !== undefined && scene instanceof THREE.Scene ) { + getObjectById: function ( id, recursive ) { - scene.__removeObject( object ); + if ( this.id === id ) return this; + + for ( var i = 0, l = this.children.length; i < l; i ++ ) { + + var child = this.children[ i ]; + var object = child.getObjectById( id, recursive ); + + if ( object !== undefined ) { + + return object; } } + return undefined; + }, + getObjectByName: function ( name, recursive ) { + + if ( this.name === name ) return this; + + for ( var i = 0, l = this.children.length; i < l; i ++ ) { + + var child = this.children[ i ]; + var object = child.getObjectByName( name, recursive ); + + if ( object !== undefined ) { + + return object; + + } + + } + + return undefined; + + }, + + getWorldPosition: function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Vector3(); + + this.updateMatrixWorld( true ); + + return result.setFromMatrixPosition( this.matrixWorld ); + + }, + + getWorldQuaternion: function () { + + var position = new THREE.Vector3(); + var scale = new THREE.Vector3(); + + return function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Quaternion(); + + this.updateMatrixWorld( true ); + + this.matrixWorld.decompose( position, result, scale ); + + return result; + + } + + }(), + + getWorldRotation: function () { + + var quaternion = new THREE.Quaternion(); + + return function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Euler(); + + this.getWorldQuaternion( quaternion ); + + return result.setFromQuaternion( quaternion, this.rotation.order, false ); + + } + + }(), + + getWorldScale: function () { + + var position = new THREE.Vector3(); + var quaternion = new THREE.Quaternion(); + + return function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Vector3(); + + this.updateMatrixWorld( true ); + + this.matrixWorld.decompose( position, quaternion, result ); + + return result; + + } + + }(), + + getWorldDirection: function () { + + var quaternion = new THREE.Quaternion(); + + return function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Vector3(); + + this.getWorldQuaternion( quaternion ); + + return result.set( 0, 0, 1 ).applyQuaternion( quaternion ); + + } + + }(), + raycast: function () {}, traverse: function ( callback ) { @@ -7545,73 +7750,6 @@ THREE.Object3D.prototype = { }, - getObjectById: function ( id, recursive ) { - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - var child = this.children[ i ]; - - if ( child.id === id ) { - - return child; - - } - - if ( recursive === true ) { - - child = child.getObjectById( id, recursive ); - - if ( child !== undefined ) { - - return child; - - } - - } - - } - - return undefined; - - }, - - getObjectByName: function ( name, recursive ) { - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - var child = this.children[ i ]; - - if ( child.name === name ) { - - return child; - - } - - if ( recursive === true ) { - - child = child.getObjectByName( name, recursive ); - - if ( child !== undefined ) { - - return child; - - } - - } - - } - - return undefined; - - }, - - getChildByName: function ( name, recursive ) { - - console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); - return this.getObjectByName( name, recursive ); - - }, - updateMatrix: function () { this.matrix.compose( this.position, this.quaternion, this.scale ); @@ -7652,6 +7790,169 @@ THREE.Object3D.prototype = { }, + toJSON: function () { + + var output = { + metadata: { + version: 4.3, + type: 'Object', + generator: 'ObjectExporter' + } + }; + + // + + var geometries = {}; + + var parseGeometry = function ( geometry ) { + + if ( output.geometries === undefined ) { + + output.geometries = []; + + } + + if ( geometries[ geometry.uuid ] === undefined ) { + + var json = geometry.toJSON(); + + delete json.metadata; + + geometries[ geometry.uuid ] = json; + + output.geometries.push( json ); + + } + + return geometry.uuid; + + }; + + // + + var materials = {}; + + var parseMaterial = function ( material ) { + + if ( output.materials === undefined ) { + + output.materials = []; + + } + + if ( materials[ material.uuid ] === undefined ) { + + var json = material.toJSON(); + + delete json.metadata; + + materials[ material.uuid ] = json; + + output.materials.push( json ); + + } + + return material.uuid; + + }; + + // + + var parseObject = function ( object ) { + + var data = {}; + + data.uuid = object.uuid; + data.type = object.type; + + if ( object.name !== '' ) data.name = object.name; + if ( JSON.stringify( object.userData ) !== '{}' ) data.userData = object.userData; + if ( object.visible !== true ) data.visible = object.visible; + + if ( object instanceof THREE.PerspectiveCamera ) { + + data.fov = object.fov; + data.aspect = object.aspect; + data.near = object.near; + data.far = object.far; + + } else if ( object instanceof THREE.OrthographicCamera ) { + + data.left = object.left; + data.right = object.right; + data.top = object.top; + data.bottom = object.bottom; + data.near = object.near; + data.far = object.far; + + } else if ( object instanceof THREE.AmbientLight ) { + + data.color = object.color.getHex(); + + } else if ( object instanceof THREE.DirectionalLight ) { + + data.color = object.color.getHex(); + data.intensity = object.intensity; + + } else if ( object instanceof THREE.PointLight ) { + + data.color = object.color.getHex(); + data.intensity = object.intensity; + data.distance = object.distance; + + } else if ( object instanceof THREE.SpotLight ) { + + data.color = object.color.getHex(); + data.intensity = object.intensity; + data.distance = object.distance; + data.angle = object.angle; + data.exponent = object.exponent; + + } else if ( object instanceof THREE.HemisphereLight ) { + + data.color = object.color.getHex(); + data.groundColor = object.groundColor.getHex(); + + } else if ( object instanceof THREE.Mesh ) { + + data.geometry = parseGeometry( object.geometry ); + data.material = parseMaterial( object.material ); + + } else if ( object instanceof THREE.Line ) { + + data.geometry = parseGeometry( object.geometry ); + data.material = parseMaterial( object.material ); + + } else if ( object instanceof THREE.Sprite ) { + + data.material = parseMaterial( object.material ); + + } + + data.matrix = object.matrix.toArray(); + + if ( object.children.length > 0 ) { + + data.children = []; + + for ( var i = 0; i < object.children.length; i ++ ) { + + data.children.push( parseObject( object.children[ i ] ) ); + + } + + } + + return data; + + } + + output.object = parseObject( this ); + + return output; + + }, + clone: function ( object, recursive ) { if ( object === undefined ) object = new THREE.Object3D(); @@ -7709,860 +8010,32 @@ THREE.Object3DIdCount = 0; /** * @author mrdoob / http://mrdoob.com/ - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author julianwa / https://github.com/julianwa */ THREE.Projector = function () { - var _object, _objectCount, _objectPool = [], _objectPoolLength = 0, - _vertex, _vertexCount, _vertexPool = [], _vertexPoolLength = 0, - _face, _faceCount, _facePool = [], _facePoolLength = 0, - _line, _lineCount, _linePool = [], _linePoolLength = 0, - _sprite, _spriteCount, _spritePool = [], _spritePoolLength = 0, - - _renderData = { objects: [], lights: [], elements: [] }, - - _vA = new THREE.Vector3(), - _vB = new THREE.Vector3(), - _vC = new THREE.Vector3(), - - _vector3 = new THREE.Vector3(), - _vector4 = new THREE.Vector4(), - - _clipBox = new THREE.Box3( new THREE.Vector3( - 1, - 1, - 1 ), new THREE.Vector3( 1, 1, 1 ) ), - _boundingBox = new THREE.Box3(), - _points3 = new Array( 3 ), - _points4 = new Array( 4 ), - - _viewMatrix = new THREE.Matrix4(), - _viewProjectionMatrix = new THREE.Matrix4(), - - _modelMatrix, - _modelViewProjectionMatrix = new THREE.Matrix4(), - - _normalMatrix = new THREE.Matrix3(), - - _frustum = new THREE.Frustum(), - - _clippedVertex1PositionScreen = new THREE.Vector4(), - _clippedVertex2PositionScreen = new THREE.Vector4(); + console.warn( 'THREE.Projector has been moved to /examples/renderers/Projector.js.' ); this.projectVector = function ( vector, camera ) { - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - _viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); - - return vector.applyProjection( _viewProjectionMatrix ); + console.warn( 'THREE.Projector: .projectVector() is now vector.project().' ); + vector.project( camera ); }; - this.unprojectVector = function () { + this.unprojectVector = function ( vector, camera ) { - var projectionMatrixInverse = new THREE.Matrix4(); + console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' ); + vector.unproject( camera ); - return function ( vector, camera ) { - - projectionMatrixInverse.getInverse( camera.projectionMatrix ); - _viewProjectionMatrix.multiplyMatrices( camera.matrixWorld, projectionMatrixInverse ); - - return vector.applyProjection( _viewProjectionMatrix ); - - }; - - }(); + }; this.pickingRay = function ( vector, camera ) { - // set two vectors with opposing z values - vector.z = - 1.0; - var end = new THREE.Vector3( vector.x, vector.y, 1.0 ); - - this.unprojectVector( vector, camera ); - this.unprojectVector( end, camera ); - - // find direction from vector to end - end.sub( vector ).normalize(); - - return new THREE.Raycaster( vector, end ); + console.error( 'THREE.Projector: .pickingRay() has been removed.' ); }; - var RenderList = function () { - - var normals = []; - var uvs = []; - - var object = null; - var material = null; - - var normalMatrix = new THREE.Matrix3(); - - var setObject = function ( value ) { - - object = value; - material = object.material; - - normalMatrix.getNormalMatrix( object.matrixWorld ); - - normals.length = 0; - uvs.length = 0; - - }; - - var projectVertex = function ( vertex ) { - - var position = vertex.position; - var positionWorld = vertex.positionWorld; - var positionScreen = vertex.positionScreen; - - positionWorld.copy( position ).applyMatrix4( _modelMatrix ); - positionScreen.copy( positionWorld ).applyMatrix4( _viewProjectionMatrix ); - - var invW = 1 / positionScreen.w; - - positionScreen.x *= invW; - positionScreen.y *= invW; - positionScreen.z *= invW; - - vertex.visible = positionScreen.x >= - 1 && positionScreen.x <= 1 && - positionScreen.y >= - 1 && positionScreen.y <= 1 && - positionScreen.z >= - 1 && positionScreen.z <= 1; - - }; - - var pushVertex = function ( x, y, z ) { - - _vertex = getNextVertexInPool(); - _vertex.position.set( x, y, z ); - - projectVertex( _vertex ); - - }; - - var pushNormal = function ( x, y, z ) { - - normals.push( x, y, z ); - - }; - - var pushUv = function ( x, y ) { - - uvs.push( x, y ); - - }; - - var checkTriangleVisibility = function ( v1, v2, v3 ) { - - if ( v1.visible === true || v2.visible === true || v3.visible === true ) return true; - - _points3[ 0 ] = v1.positionScreen; - _points3[ 1 ] = v2.positionScreen; - _points3[ 2 ] = v3.positionScreen; - - return _clipBox.isIntersectionBox( _boundingBox.setFromPoints( _points3 ) ); - - }; - - var checkBackfaceCulling = function ( v1, v2, v3 ) { - - return ( ( v3.positionScreen.x - v1.positionScreen.x ) * - ( v2.positionScreen.y - v1.positionScreen.y ) - - ( v3.positionScreen.y - v1.positionScreen.y ) * - ( v2.positionScreen.x - v1.positionScreen.x ) ) < 0; - - }; - - var pushLine = function ( a, b ) { - - var v1 = _vertexPool[ a ]; - var v2 = _vertexPool[ b ]; - - _line = getNextLineInPool(); - - _line.id = object.id; - _line.v1.copy( v1 ); - _line.v2.copy( v2 ); - _line.z = ( v1.positionScreen.z + v2.positionScreen.z ) / 2; - - _line.material = object.material; - - _renderData.elements.push( _line ); - - }; - - var pushTriangle = function ( a, b, c ) { - - var v1 = _vertexPool[ a ]; - var v2 = _vertexPool[ b ]; - var v3 = _vertexPool[ c ]; - - if ( checkTriangleVisibility( v1, v2, v3 ) === false ) return; - - if ( material.side === THREE.DoubleSide || checkBackfaceCulling( v1, v2, v3 ) === true ) { - - _face = getNextFaceInPool(); - - _face.id = object.id; - _face.v1.copy( v1 ); - _face.v2.copy( v2 ); - _face.v3.copy( v3 ); - _face.z = ( v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z ) / 3; - - for ( var i = 0; i < 3; i ++ ) { - - var offset = arguments[ i ] * 3; - var normal = _face.vertexNormalsModel[ i ]; - - normal.set( normals[ offset ], normals[ offset + 1 ], normals[ offset + 2 ] ); - normal.applyMatrix3( normalMatrix ).normalize(); - - var offset2 = arguments[ i ] * 2; - - var uv = _face.uvs[ i ]; - uv.set( uvs[ offset2 ], uvs[ offset2 + 1 ] ); - - } - - _face.vertexNormalsLength = 3; - - _face.material = object.material; - - _renderData.elements.push( _face ); - - } - - }; - - return { - setObject: setObject, - projectVertex: projectVertex, - checkTriangleVisibility: checkTriangleVisibility, - checkBackfaceCulling: checkBackfaceCulling, - pushVertex: pushVertex, - pushNormal: pushNormal, - pushUv: pushUv, - pushLine: pushLine, - pushTriangle: pushTriangle - } - - }; - - var renderList = new RenderList(); - - this.projectScene = function ( scene, camera, sortObjects, sortElements ) { - - _faceCount = 0; - _lineCount = 0; - _spriteCount = 0; - - _renderData.elements.length = 0; - - if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); - if ( camera.parent === undefined ) camera.updateMatrixWorld(); - - _viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) ); - _viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix ); - - _frustum.setFromMatrix( _viewProjectionMatrix ); - - // - - _objectCount = 0; - - _renderData.objects.length = 0; - _renderData.lights.length = 0; - - scene.traverseVisible( function ( object ) { - - if ( object instanceof THREE.Light ) { - - _renderData.lights.push( object ); - - } else if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.Sprite ) { - - if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) { - - _object = getNextObjectInPool(); - _object.id = object.id; - _object.object = object; - - if ( object.renderDepth !== null ) { - - _object.z = object.renderDepth; - - } else { - - _vector3.setFromMatrixPosition( object.matrixWorld ); - _vector3.applyProjection( _viewProjectionMatrix ); - _object.z = _vector3.z; - - } - - _renderData.objects.push( _object ); - - } - - } - - } ); - - if ( sortObjects === true ) { - - _renderData.objects.sort( painterSort ); - - } - - // - - for ( var o = 0, ol = _renderData.objects.length; o < ol; o ++ ) { - - var object = _renderData.objects[ o ].object; - var geometry = object.geometry; - - renderList.setObject( object ); - - _modelMatrix = object.matrixWorld; - - _vertexCount = 0; - - if ( object instanceof THREE.Mesh ) { - - if ( geometry instanceof THREE.BufferGeometry ) { - - var attributes = geometry.attributes; - var offsets = geometry.offsets; - - if ( attributes.position === undefined ) continue; - - var positions = attributes.position.array; - - for ( var i = 0, l = positions.length; i < l; i += 3 ) { - - renderList.pushVertex( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); - - } - - if ( attributes.normal !== undefined ) { - - var normals = attributes.normal.array; - - for ( var i = 0, l = normals.length; i < l; i += 3 ) { - - renderList.pushNormal( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] ); - - } - - } - - if ( attributes.uv !== undefined ) { - - var uvs = attributes.uv.array; - - for ( var i = 0, l = uvs.length; i < l; i += 2 ) { - - renderList.pushUv( uvs[ i ], uvs[ i + 1 ] ); - - } - - } - - if ( attributes.index !== undefined ) { - - var indices = attributes.index.array; - - if ( offsets.length > 0 ) { - - for ( var o = 0; o < offsets.length; o ++ ) { - - var offset = offsets[ o ]; - var index = offset.index; - - for ( var i = offset.start, l = offset.start + offset.count; i < l; i += 3 ) { - - renderList.pushTriangle( indices[ i ] + index, indices[ i + 1 ] + index, indices[ i + 2 ] + index ); - - } - - } - - } else { - - for ( var i = 0, l = indices.length; i < l; i += 3 ) { - - renderList.pushTriangle( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] ); - - } - - } - - } else { - - for ( var i = 0, l = positions.length / 3; i < l; i += 3 ) { - - renderList.pushTriangle( i, i + 1, i + 2 ); - - } - - } - - } else if ( geometry instanceof THREE.Geometry ) { - - var vertices = geometry.vertices; - var faces = geometry.faces; - var faceVertexUvs = geometry.faceVertexUvs[ 0 ]; - - _normalMatrix.getNormalMatrix( _modelMatrix ); - - var isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial; - var objectMaterials = isFaceMaterial === true ? object.material : null; - - for ( var v = 0, vl = vertices.length; v < vl; v ++ ) { - - var vertex = vertices[ v ]; - renderList.pushVertex( vertex.x, vertex.y, vertex.z ); - - } - - for ( var f = 0, fl = faces.length; f < fl; f ++ ) { - - var face = faces[ f ]; - - var material = isFaceMaterial === true - ? objectMaterials.materials[ face.materialIndex ] - : object.material; - - if ( material === undefined ) continue; - - var side = material.side; - - var v1 = _vertexPool[ face.a ]; - var v2 = _vertexPool[ face.b ]; - var v3 = _vertexPool[ face.c ]; - - if ( material.morphTargets === true ) { - - var morphTargets = geometry.morphTargets; - var morphInfluences = object.morphTargetInfluences; - - var v1p = v1.position; - var v2p = v2.position; - var v3p = v3.position; - - _vA.set( 0, 0, 0 ); - _vB.set( 0, 0, 0 ); - _vC.set( 0, 0, 0 ); - - for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) { - - var influence = morphInfluences[ t ]; - - if ( influence === 0 ) continue; - - var targets = morphTargets[ t ].vertices; - - _vA.x += ( targets[ face.a ].x - v1p.x ) * influence; - _vA.y += ( targets[ face.a ].y - v1p.y ) * influence; - _vA.z += ( targets[ face.a ].z - v1p.z ) * influence; - - _vB.x += ( targets[ face.b ].x - v2p.x ) * influence; - _vB.y += ( targets[ face.b ].y - v2p.y ) * influence; - _vB.z += ( targets[ face.b ].z - v2p.z ) * influence; - - _vC.x += ( targets[ face.c ].x - v3p.x ) * influence; - _vC.y += ( targets[ face.c ].y - v3p.y ) * influence; - _vC.z += ( targets[ face.c ].z - v3p.z ) * influence; - - } - - v1.position.add( _vA ); - v2.position.add( _vB ); - v3.position.add( _vC ); - - renderList.projectVertex( v1 ); - renderList.projectVertex( v2 ); - renderList.projectVertex( v3 ); - - } - - if ( renderList.checkTriangleVisibility( v1, v2, v3 ) === false ) continue; - - var visible = renderList.checkBackfaceCulling( v1, v2, v3 ); - - if ( side !== THREE.DoubleSide ) { - if ( side === THREE.FrontSide && visible === false ) continue; - if ( side === THREE.BackSide && visible === true ) continue; - } - - _face = getNextFaceInPool(); - - _face.id = object.id; - _face.v1.copy( v1 ); - _face.v2.copy( v2 ); - _face.v3.copy( v3 ); - - _face.normalModel.copy( face.normal ); - - if ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) { - - _face.normalModel.negate(); - - } - - _face.normalModel.applyMatrix3( _normalMatrix ).normalize(); - - var faceVertexNormals = face.vertexNormals; - - for ( var n = 0, nl = Math.min( faceVertexNormals.length, 3 ); n < nl; n ++ ) { - - var normalModel = _face.vertexNormalsModel[ n ]; - normalModel.copy( faceVertexNormals[ n ] ); - - if ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) { - - normalModel.negate(); - - } - - normalModel.applyMatrix3( _normalMatrix ).normalize(); - - } - - _face.vertexNormalsLength = faceVertexNormals.length; - - var vertexUvs = faceVertexUvs[ f ]; - - if ( vertexUvs !== undefined ) { - - for ( var u = 0; u < 3; u ++ ) { - - _face.uvs[ u ].copy( vertexUvs[ u ] ); - - } - - } - - _face.color = face.color; - _face.material = material; - - _face.z = ( v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z ) / 3; - - _renderData.elements.push( _face ); - - } - - } - - } else if ( object instanceof THREE.Line ) { - - if ( geometry instanceof THREE.BufferGeometry ) { - - var attributes = geometry.attributes; - - if ( attributes.position !== undefined ) { - - var positions = attributes.position.array; - - for ( var i = 0, l = positions.length; i < l; i += 3 ) { - - renderList.pushVertex( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); - - } - - if ( attributes.index !== undefined ) { - - var indices = attributes.index.array; - - for ( var i = 0, l = indices.length; i < l; i += 2 ) { - - renderList.pushLine( indices[ i ], indices[ i + 1 ] ); - - } - - } else { - - var step = object.type === THREE.LinePieces ? 2 : 1; - - for ( var i = 0, l = ( positions.length / 3 ) - 1; i < l; i += step ) { - - renderList.pushLine( i, i + 1 ); - - } - - } - - } - - } else if ( geometry instanceof THREE.Geometry ) { - - _modelViewProjectionMatrix.multiplyMatrices( _viewProjectionMatrix, _modelMatrix ); - - var vertices = object.geometry.vertices; - - if ( vertices.length === 0 ) continue; - - v1 = getNextVertexInPool(); - v1.positionScreen.copy( vertices[ 0 ] ).applyMatrix4( _modelViewProjectionMatrix ); - - // Handle LineStrip and LinePieces - var step = object.type === THREE.LinePieces ? 2 : 1; - - for ( var v = 1, vl = vertices.length; v < vl; v ++ ) { - - v1 = getNextVertexInPool(); - v1.positionScreen.copy( vertices[ v ] ).applyMatrix4( _modelViewProjectionMatrix ); - - if ( ( v + 1 ) % step > 0 ) continue; - - v2 = _vertexPool[ _vertexCount - 2 ]; - - _clippedVertex1PositionScreen.copy( v1.positionScreen ); - _clippedVertex2PositionScreen.copy( v2.positionScreen ); - - if ( clipLine( _clippedVertex1PositionScreen, _clippedVertex2PositionScreen ) === true ) { - - // Perform the perspective divide - _clippedVertex1PositionScreen.multiplyScalar( 1 / _clippedVertex1PositionScreen.w ); - _clippedVertex2PositionScreen.multiplyScalar( 1 / _clippedVertex2PositionScreen.w ); - - _line = getNextLineInPool(); - - _line.id = object.id; - _line.v1.positionScreen.copy( _clippedVertex1PositionScreen ); - _line.v2.positionScreen.copy( _clippedVertex2PositionScreen ); - - _line.z = Math.max( _clippedVertex1PositionScreen.z, _clippedVertex2PositionScreen.z ); - - _line.material = object.material; - - if ( object.material.vertexColors === THREE.VertexColors ) { - - _line.vertexColors[ 0 ].copy( object.geometry.colors[ v ] ); - _line.vertexColors[ 1 ].copy( object.geometry.colors[ v - 1 ] ); - - } - - _renderData.elements.push( _line ); - - } - - } - - } - - } else if ( object instanceof THREE.Sprite ) { - - _vector4.set( _modelMatrix.elements[ 12 ], _modelMatrix.elements[ 13 ], _modelMatrix.elements[ 14 ], 1 ); - _vector4.applyMatrix4( _viewProjectionMatrix ); - - var invW = 1 / _vector4.w; - - _vector4.z *= invW; - - if ( _vector4.z >= - 1 && _vector4.z <= 1 ) { - - _sprite = getNextSpriteInPool(); - _sprite.id = object.id; - _sprite.x = _vector4.x * invW; - _sprite.y = _vector4.y * invW; - _sprite.z = _vector4.z; - _sprite.object = object; - - _sprite.rotation = object.rotation; - - _sprite.scale.x = object.scale.x * Math.abs( _sprite.x - ( _vector4.x + camera.projectionMatrix.elements[ 0 ] ) / ( _vector4.w + camera.projectionMatrix.elements[ 12 ] ) ); - _sprite.scale.y = object.scale.y * Math.abs( _sprite.y - ( _vector4.y + camera.projectionMatrix.elements[ 5 ] ) / ( _vector4.w + camera.projectionMatrix.elements[ 13 ] ) ); - - _sprite.material = object.material; - - _renderData.elements.push( _sprite ); - - } - - } - - } - - if ( sortElements === true ) _renderData.elements.sort( painterSort ); - - return _renderData; - - }; - - // Pools - - function getNextObjectInPool() { - - if ( _objectCount === _objectPoolLength ) { - - var object = new THREE.RenderableObject(); - _objectPool.push( object ); - _objectPoolLength ++; - _objectCount ++; - return object; - - } - - return _objectPool[ _objectCount ++ ]; - - } - - function getNextVertexInPool() { - - if ( _vertexCount === _vertexPoolLength ) { - - var vertex = new THREE.RenderableVertex(); - _vertexPool.push( vertex ); - _vertexPoolLength ++; - _vertexCount ++; - return vertex; - - } - - return _vertexPool[ _vertexCount ++ ]; - - } - - function getNextFaceInPool() { - - if ( _faceCount === _facePoolLength ) { - - var face = new THREE.RenderableFace(); - _facePool.push( face ); - _facePoolLength ++; - _faceCount ++; - return face; - - } - - return _facePool[ _faceCount ++ ]; - - - } - - function getNextLineInPool() { - - if ( _lineCount === _linePoolLength ) { - - var line = new THREE.RenderableLine(); - _linePool.push( line ); - _linePoolLength ++; - _lineCount ++ - return line; - - } - - return _linePool[ _lineCount ++ ]; - - } - - function getNextSpriteInPool() { - - if ( _spriteCount === _spritePoolLength ) { - - var sprite = new THREE.RenderableSprite(); - _spritePool.push( sprite ); - _spritePoolLength ++; - _spriteCount ++ - return sprite; - - } - - return _spritePool[ _spriteCount ++ ]; - - } - - // - - function painterSort( a, b ) { - - if ( a.z !== b.z ) { - - return b.z - a.z; - - } else if ( a.id !== b.id ) { - - return a.id - b.id; - - } else { - - return 0; - - } - - } - - function clipLine( s1, s2 ) { - - var alpha1 = 0, alpha2 = 1, - - // Calculate the boundary coordinate of each vertex for the near and far clip planes, - // Z = -1 and Z = +1, respectively. - bc1near = s1.z + s1.w, - bc2near = s2.z + s2.w, - bc1far = - s1.z + s1.w, - bc2far = - s2.z + s2.w; - - if ( bc1near >= 0 && bc2near >= 0 && bc1far >= 0 && bc2far >= 0 ) { - - // Both vertices lie entirely within all clip planes. - return true; - - } else if ( ( bc1near < 0 && bc2near < 0 ) || ( bc1far < 0 && bc2far < 0 ) ) { - - // Both vertices lie entirely outside one of the clip planes. - return false; - - } else { - - // The line segment spans at least one clip plane. - - if ( bc1near < 0 ) { - - // v1 lies outside the near plane, v2 inside - alpha1 = Math.max( alpha1, bc1near / ( bc1near - bc2near ) ); - - } else if ( bc2near < 0 ) { - - // v2 lies outside the near plane, v1 inside - alpha2 = Math.min( alpha2, bc1near / ( bc1near - bc2near ) ); - - } - - if ( bc1far < 0 ) { - - // v1 lies outside the far plane, v2 inside - alpha1 = Math.max( alpha1, bc1far / ( bc1far - bc2far ) ); - - } else if ( bc2far < 0 ) { - - // v2 lies outside the far plane, v2 inside - alpha2 = Math.min( alpha2, bc1far / ( bc1far - bc2far ) ); - - } - - if ( alpha2 < alpha1 ) { - - // The line segment spans two boundaries, but is outside both of them. - // (This can't happen when we're only clipping against just near/far but good - // to leave the check here for future usage if other clip planes are added.) - return false; - - } else { - - // Update the s1 and s2 vertices to match the clipped line segment. - s1.lerp( s2, alpha1 ); - s2.lerp( s1, 1 - alpha2 ); - - return true; - - } - - } - - } - }; // File:src/core/Face3.js @@ -8651,6 +8124,8 @@ THREE.BufferAttribute = function ( array, itemSize ) { this.array = array; this.itemSize = itemSize; + this.needsUpdate = false; + }; THREE.BufferAttribute.prototype = { @@ -8663,6 +8138,19 @@ THREE.BufferAttribute.prototype = { }, + copyAt: function ( index1, attribute, index2 ) { + + index1 *= this.itemSize; + index2 *= attribute.itemSize; + + for ( var i = 0, l = this.itemSize; i < l; i ++ ) { + + this.array[ index1 + i ] = attribute.array[ index2 + i ]; + + } + + }, + set: function ( value ) { this.array.set( value ); @@ -8729,6 +8217,12 @@ THREE.BufferAttribute.prototype = { return this; + }, + + clone: function () { + + return new THREE.BufferAttribute( new this.array.constructor( this.array ), this.itemSize ); + } }; @@ -8803,16 +8297,21 @@ THREE.Float64Attribute = function ( data, itemSize ) { /** * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ */ THREE.BufferGeometry = function () { - this.id = THREE.GeometryIdCount ++; + Object.defineProperty( this, 'id', { value: THREE.GeometryIdCount ++ } ); + this.uuid = THREE.Math.generateUUID(); this.name = ''; + this.type = 'BufferGeometry'; this.attributes = {}; + this.attributesKeys = []; + this.drawcalls = []; this.offsets = this.drawcalls; // backwards compatibility @@ -8838,6 +8337,7 @@ THREE.BufferGeometry.prototype = { } this.attributes[ name ] = attribute; + this.attributesKeys = Object.keys( this.attributes ); }, @@ -8883,6 +8383,12 @@ THREE.BufferGeometry.prototype = { }, + center: function () { + + // TODO + + }, + fromGeometry: function ( geometry, settings ) { settings = settings || { 'vertexColors': THREE.NoColors }; @@ -8910,7 +8416,7 @@ THREE.BufferGeometry.prototype = { if ( hasFaceVertexUv === true ) { var uvs = new Float32Array( faces.length * 3 * 2 ); - this.addAttribute( 'uvs', new THREE.BufferAttribute( uvs, 2 ) ); + this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); } @@ -9033,80 +8539,48 @@ THREE.BufferGeometry.prototype = { computeBoundingBox: function () { - if ( this.boundingBox === null ) { + var vector = new THREE.Vector3(); - this.boundingBox = new THREE.Box3(); + return function () { - } + if ( this.boundingBox === null ) { - var positions = this.attributes[ 'position' ].array; + this.boundingBox = new THREE.Box3(); - if ( positions ) { - - var bb = this.boundingBox; - - if ( positions.length >= 3 ) { - bb.min.x = bb.max.x = positions[ 0 ]; - bb.min.y = bb.max.y = positions[ 1 ]; - bb.min.z = bb.max.z = positions[ 2 ]; } - for ( var i = 3, il = positions.length; i < il; i += 3 ) { + var positions = this.attributes.position.array; - var x = positions[ i ]; - var y = positions[ i + 1 ]; - var z = positions[ i + 2 ]; + if ( positions ) { - // bounding box + var bb = this.boundingBox; + bb.makeEmpty(); - if ( x < bb.min.x ) { + for ( var i = 0, il = positions.length; i < il; i += 3 ) { - bb.min.x = x; - - } else if ( x > bb.max.x ) { - - bb.max.x = x; - - } - - if ( y < bb.min.y ) { - - bb.min.y = y; - - } else if ( y > bb.max.y ) { - - bb.max.y = y; - - } - - if ( z < bb.min.z ) { - - bb.min.z = z; - - } else if ( z > bb.max.z ) { - - bb.max.z = z; + vector.set( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ); + bb.expandByPoint( vector ); } } - } + if ( positions === undefined || positions.length === 0 ) { - if ( positions === undefined || positions.length === 0 ) { + this.boundingBox.min.set( 0, 0, 0 ); + this.boundingBox.max.set( 0, 0, 0 ); - this.boundingBox.min.set( 0, 0, 0 ); - this.boundingBox.max.set( 0, 0, 0 ); + } + + if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { + + console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.' ); + + } } - if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.' ); - - } - - }, + }(), computeBoundingSphere: function () { @@ -9121,7 +8595,7 @@ THREE.BufferGeometry.prototype = { } - var positions = this.attributes[ 'position' ].array; + var positions = this.attributes.position.array; if ( positions ) { @@ -9172,38 +8646,33 @@ THREE.BufferGeometry.prototype = { computeVertexNormals: function () { - if ( this.attributes[ 'position' ] ) { + var attributes = this.attributes; - var i, il; - var j, jl; + if ( attributes.position ) { - var nVertexElements = this.attributes[ 'position' ].array.length; + var positions = attributes.position.array; - if ( this.attributes[ 'normal' ] === undefined ) { + if ( attributes.normal === undefined ) { - this.attributes[ 'normal' ] = { - - itemSize: 3, - array: new Float32Array( nVertexElements ) - - }; + this.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( positions.length ), 3 ) ); } else { // reset existing normals to zero - for ( i = 0, il = this.attributes[ 'normal' ].array.length; i < il; i ++ ) { + var normals = attributes.normal.array; - this.attributes[ 'normal' ].array[ i ] = 0; + for ( var i = 0, il = normals.length; i < il; i ++ ) { + + normals[ i ] = 0; } } - var positions = this.attributes[ 'position' ].array; - var normals = this.attributes[ 'normal' ].array; + var normals = attributes.normal.array; - var vA, vB, vC, x, y, z, + var vA, vB, vC, pA = new THREE.Vector3(), pB = new THREE.Vector3(), @@ -9214,79 +8683,57 @@ THREE.BufferGeometry.prototype = { // indexed elements - if ( this.attributes[ 'index' ] ) { + if ( attributes.index ) { - var indices = this.attributes[ 'index' ].array; + var indices = attributes.index.array; var offsets = ( this.offsets.length > 0 ? this.offsets : [ { start: 0, count: indices.length, index: 0 } ] ); - for ( j = 0, jl = offsets.length; j < jl; ++ j ) { + for ( var j = 0, jl = offsets.length; j < jl; ++ j ) { var start = offsets[ j ].start; var count = offsets[ j ].count; var index = offsets[ j ].index; - for ( i = start, il = start + count; i < il; i += 3 ) { + for ( var i = start, il = start + count; i < il; i += 3 ) { - vA = index + indices[ i ]; - vB = index + indices[ i + 1 ]; - vC = index + indices[ i + 2 ]; + vA = ( index + indices[ i ] ) * 3; + vB = ( index + indices[ i + 1 ] ) * 3; + vC = ( index + indices[ i + 2 ] ) * 3; - x = positions[ vA * 3 ]; - y = positions[ vA * 3 + 1 ]; - z = positions[ vA * 3 + 2 ]; - pA.set( x, y, z ); - - x = positions[ vB * 3 ]; - y = positions[ vB * 3 + 1 ]; - z = positions[ vB * 3 + 2 ]; - pB.set( x, y, z ); - - x = positions[ vC * 3 ]; - y = positions[ vC * 3 + 1 ]; - z = positions[ vC * 3 + 2 ]; - pC.set( x, y, z ); + pA.fromArray( positions, vA ); + pB.fromArray( positions, vB ); + pC.fromArray( positions, vC ); cb.subVectors( pC, pB ); ab.subVectors( pA, pB ); cb.cross( ab ); - normals[ vA * 3 ] += cb.x; - normals[ vA * 3 + 1 ] += cb.y; - normals[ vA * 3 + 2 ] += cb.z; + normals[ vA ] += cb.x; + normals[ vA + 1 ] += cb.y; + normals[ vA + 2 ] += cb.z; - normals[ vB * 3 ] += cb.x; - normals[ vB * 3 + 1 ] += cb.y; - normals[ vB * 3 + 2 ] += cb.z; + normals[ vB ] += cb.x; + normals[ vB + 1 ] += cb.y; + normals[ vB + 2 ] += cb.z; - normals[ vC * 3 ] += cb.x; - normals[ vC * 3 + 1 ] += cb.y; - normals[ vC * 3 + 2 ] += cb.z; + normals[ vC ] += cb.x; + normals[ vC + 1 ] += cb.y; + normals[ vC + 2 ] += cb.z; } } - // non-indexed elements (unconnected triangle soup) - } else { - for ( i = 0, il = positions.length; i < il; i += 9 ) { + // non-indexed elements (unconnected triangle soup) - x = positions[ i ]; - y = positions[ i + 1 ]; - z = positions[ i + 2 ]; - pA.set( x, y, z ); + for ( var i = 0, il = positions.length; i < il; i += 9 ) { - x = positions[ i + 3 ]; - y = positions[ i + 4 ]; - z = positions[ i + 5 ]; - pB.set( x, y, z ); - - x = positions[ i + 6 ]; - y = positions[ i + 7 ]; - z = positions[ i + 8 ]; - pC.set( x, y, z ); + pA.fromArray( positions, i ); + pB.fromArray( positions, i + 3 ); + pC.fromArray( positions, i + 6 ); cb.subVectors( pC, pB ); ab.subVectors( pA, pB ); @@ -9310,7 +8757,7 @@ THREE.BufferGeometry.prototype = { this.normalizeNormals(); - this.normalsNeedUpdate = true; + attributes.normal.needsUpdate = true; } @@ -9321,37 +8768,30 @@ THREE.BufferGeometry.prototype = { // based on http://www.terathon.com/code/tangent.html // (per vertex tangents) - if ( this.attributes[ 'index' ] === undefined || - this.attributes[ 'position' ] === undefined || - this.attributes[ 'normal' ] === undefined || - this.attributes[ 'uv' ] === undefined ) { + if ( this.attributes.index === undefined || + this.attributes.position === undefined || + this.attributes.normal === undefined || + this.attributes.uv === undefined ) { console.warn( 'Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()' ); return; } - var indices = this.attributes[ 'index' ].array; - var positions = this.attributes[ 'position' ].array; - var normals = this.attributes[ 'normal' ].array; - var uvs = this.attributes[ 'uv' ].array; + var indices = this.attributes.index.array; + var positions = this.attributes.position.array; + var normals = this.attributes.normal.array; + var uvs = this.attributes.uv.array; var nVertices = positions.length / 3; - if ( this.attributes[ 'tangent' ] === undefined ) { + if ( this.attributes.tangent === undefined ) { - var nTangentElements = 4 * nVertices; - - this.attributes[ 'tangent' ] = { - - itemSize: 4, - array: new Float32Array( nTangentElements ) - - }; + this.addAttribute( 'tangent', new THREE.BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) ); } - var tangents = this.attributes[ 'tangent' ].array; + var tangents = this.attributes.tangent.array; var tan1 = [], tan2 = []; @@ -9362,13 +8802,13 @@ THREE.BufferGeometry.prototype = { } - var xA, yA, zA, - xB, yB, zB, - xC, yC, zC, + var vA = new THREE.Vector3(), + vB = new THREE.Vector3(), + vC = new THREE.Vector3(), - uA, vA, - uB, vB, - uC, vC, + uvA = new THREE.Vector2(), + uvB = new THREE.Vector2(), + uvC = new THREE.Vector2(), x1, x2, y1, y2, z1, z2, s1, s2, t1, t2, r; @@ -9377,41 +8817,28 @@ THREE.BufferGeometry.prototype = { function handleTriangle( a, b, c ) { - xA = positions[ a * 3 ]; - yA = positions[ a * 3 + 1 ]; - zA = positions[ a * 3 + 2 ]; + vA.fromArray( positions, a * 3 ); + vB.fromArray( positions, b * 3 ); + vC.fromArray( positions, c * 3 ); - xB = positions[ b * 3 ]; - yB = positions[ b * 3 + 1 ]; - zB = positions[ b * 3 + 2 ]; + uvA.fromArray( uvs, a * 2 ); + uvB.fromArray( uvs, b * 2 ); + uvC.fromArray( uvs, c * 2 ); - xC = positions[ c * 3 ]; - yC = positions[ c * 3 + 1 ]; - zC = positions[ c * 3 + 2 ]; + x1 = vB.x - vA.x; + x2 = vC.x - vA.x; - uA = uvs[ a * 2 ]; - vA = uvs[ a * 2 + 1 ]; + y1 = vB.y - vA.y; + y2 = vC.y - vA.y; - uB = uvs[ b * 2 ]; - vB = uvs[ b * 2 + 1 ]; + z1 = vB.z - vA.z; + z2 = vC.z - vA.z; - uC = uvs[ c * 2 ]; - vC = uvs[ c * 2 + 1 ]; + s1 = uvB.x - uvA.x; + s2 = uvC.x - uvA.x; - x1 = xB - xA; - x2 = xC - xA; - - y1 = yB - yA; - y2 = yC - yA; - - z1 = zB - zA; - z2 = zC - zA; - - s1 = uB - uA; - s2 = uC - uA; - - t1 = vB - vA; - t2 = vC - vA; + t1 = uvB.y - uvA.y; + t2 = uvC.y - uvA.y; r = 1.0 / ( s1 * t2 - s2 * t1 ); @@ -9441,13 +8868,19 @@ THREE.BufferGeometry.prototype = { var j, jl; var iA, iB, iC; - var offsets = this.offsets; + if ( this.drawcalls.length === 0 ) { - for ( j = 0, jl = offsets.length; j < jl; ++ j ) { + this.addDrawCall( 0, indices.length, 0 ); - var start = offsets[ j ].start; - var count = offsets[ j ].count; - var index = offsets[ j ].index; + } + + var drawcalls = this.drawcalls; + + for ( j = 0, jl = drawcalls.length; j < jl; ++ j ) { + + var start = drawcalls[ j ].start; + var count = drawcalls[ j ].count; + var index = drawcalls[ j ].index; for ( i = start, il = start + count; i < il; i += 3 ) { @@ -9467,10 +8900,7 @@ THREE.BufferGeometry.prototype = { function handleVertex( v ) { - n.x = normals[ v * 3 ]; - n.y = normals[ v * 3 + 1 ]; - n.z = normals[ v * 3 + 2 ]; - + n.fromArray( normals, v * 3 ); n2.copy( n ); t = tan1[ v ]; @@ -9493,11 +8923,11 @@ THREE.BufferGeometry.prototype = { } - for ( j = 0, jl = offsets.length; j < jl; ++ j ) { + for ( j = 0, jl = drawcalls.length; j < jl; ++ j ) { - var start = offsets[ j ].start; - var count = offsets[ j ].count; - var index = offsets[ j ].index; + var start = drawcalls[ j ].start; + var count = drawcalls[ j ].count; + var index = drawcalls[ j ].index; for ( i = start, il = start + count; i < il; i += 3 ) { @@ -9530,8 +8960,8 @@ THREE.BufferGeometry.prototype = { var s = Date.now(); - var indices = this.attributes[ 'index' ].array; - var vertices = this.attributes[ 'position' ].array; + var indices = this.attributes.index.array; + var vertices = this.attributes.position.array; var verticesCount = ( vertices.length / 3 ); var facesCount = ( indices.length / 3 ); @@ -9634,7 +9064,7 @@ THREE.BufferGeometry.prototype = { normalizeNormals: function () { - var normals = this.attributes[ 'normal' ].array; + var normals = this.attributes.normal.array; var x, y, z, n; @@ -9665,18 +9095,11 @@ THREE.BufferGeometry.prototype = { /* Create a copy of all attributes for reordering. */ var sortedAttributes = {}; - var types = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ]; for ( var attr in this.attributes ) { if ( attr == 'index' ) continue; var sourceArray = this.attributes[ attr ].array; - for ( var i = 0, il = types.length; i < il; i ++ ) { - var type = types[ i ]; - if ( sourceArray instanceof type ) { - sortedAttributes[ attr ] = new type( this.attributes[ attr ].itemSize * vertexCount ); - break; - } - } + sortedAttributes[ attr ] = new sourceArray.constructor( this.attributes[ attr ].itemSize * vertexCount ); } /* Move attribute positions based on the new index map */ @@ -9703,38 +9126,72 @@ THREE.BufferGeometry.prototype = { } }, + toJSON: function () { + + var output = { + metadata: { + version: 4.0, + type: 'BufferGeometry', + generator: 'BufferGeometryExporter' + }, + uuid: this.uuid, + type: this.type, + data: { + attributes: {} + } + }; + + var attributes = this.attributes; + var offsets = this.offsets; + var boundingSphere = this.boundingSphere; + + for ( var key in attributes ) { + + var attribute = attributes[ key ]; + + var array = [], typeArray = attribute.array; + + for ( var i = 0, l = typeArray.length; i < l; i ++ ) { + + array[ i ] = typeArray[ i ]; + + } + + output.data.attributes[ key ] = { + itemSize: attribute.itemSize, + type: attribute.array.constructor.name, + array: array + } + + } + + if ( offsets.length > 0 ) { + + output.data.offsets = JSON.parse( JSON.stringify( offsets ) ); + + } + + if ( boundingSphere !== null ) { + + output.data.boundingSphere = { + center: boundingSphere.center.toArray(), + radius: boundingSphere.radius + } + + } + + return output; + + }, + clone: function () { var geometry = new THREE.BufferGeometry(); - var types = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ]; - for ( var attr in this.attributes ) { var sourceAttr = this.attributes[ attr ]; - var sourceArray = sourceAttr.array; - - var attribute = { - - itemSize: sourceAttr.itemSize, - array: null - - }; - - for ( var i = 0, il = types.length; i < il; i ++ ) { - - var type = types[ i ]; - - if ( sourceArray instanceof type ) { - - attribute.array = new type( sourceArray ); - break; - - } - - } - - geometry.attributes[ attr ] = attribute; + geometry.addAttribute( attr, sourceAttr.clone() ); } @@ -9779,10 +9236,12 @@ THREE.EventDispatcher.prototype.apply( THREE.BufferGeometry.prototype ); THREE.Geometry = function () { - this.id = THREE.GeometryIdCount ++; + Object.defineProperty( this, 'id', { value: THREE.GeometryIdCount ++ } ); + this.uuid = THREE.Math.generateUUID(); this.name = ''; + this.type = 'Geometry'; this.vertices = []; this.colors = []; // one-to-one vertex colors, used in Points and Line @@ -9817,7 +9276,6 @@ THREE.Geometry = function () { this.colorsNeedUpdate = false; this.lineDistancesNeedUpdate = false; - this.buffersNeedUpdate = false; this.groupsNeedUpdate = false; }; @@ -9864,6 +9322,91 @@ THREE.Geometry.prototype = { }, + fromBufferGeometry: function ( geometry ) { + + var scope = this; + + var attributes = geometry.attributes; + + var vertices = attributes.position.array; + var indices = attributes.index !== undefined ? attributes.index.array : undefined; + var normals = attributes.normal !== undefined ? attributes.normal.array : undefined; + var colors = attributes.color !== undefined ? attributes.color.array : undefined; + var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined; + + var tempNormals = []; + var tempUVs = []; + + for ( var i = 0, j = 0; i < vertices.length; i += 3, j += 2 ) { + + scope.vertices.push( new THREE.Vector3( vertices[ i ], vertices[ i + 1 ], vertices[ i + 2 ] ) ); + + if ( normals !== undefined ) { + + tempNormals.push( new THREE.Vector3( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] ) ); + + } + + if ( colors !== undefined ) { + + scope.colors.push( new THREE.Color( colors[ i ], colors[ i + 1 ], colors[ i + 2 ] ) ); + + } + + if ( uvs !== undefined ) { + + tempUVs.push( new THREE.Vector2( uvs[ j ], uvs[ j + 1 ] ) ); + + } + + } + + var addFace = function ( a, b, c ) { + + var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : []; + var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : []; + + scope.faces.push( new THREE.Face3( a, b, c, vertexNormals, vertexColors ) ); + scope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ], tempUVs[ b ], tempUVs[ c ] ] ); + + }; + + if ( indices !== undefined ) { + + for ( var i = 0; i < indices.length; i += 3 ) { + + addFace( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] ); + + } + + } else { + + for ( var i = 0; i < vertices.length / 3; i += 3 ) { + + addFace( i, i + 1, i + 2 ); + + } + + } + + this.computeFaceNormals(); + + if ( geometry.boundingBox !== null ) { + + this.boundingBox = geometry.boundingBox.clone(); + + } + + if ( geometry.boundingSphere !== null ) { + + this.boundingSphere = geometry.boundingSphere.clone(); + + } + + return this; + + }, + center: function () { this.computeBoundingBox(); @@ -10251,7 +9794,6 @@ THREE.Geometry.prototype = { var normalMatrix, vertexOffset = this.vertices.length, - uvPosition = this.faceVertexUvs[ 0 ].length, vertices1 = this.vertices, vertices2 = geometry.vertices, faces1 = this.faces, @@ -10440,66 +9982,206 @@ THREE.Geometry.prototype = { }, - // Geometry splitting + toJSON: function () { - makeGroups: ( function () { + var output = { + metadata: { + version: 4.0, + type: 'BufferGeometry', + generator: 'BufferGeometryExporter' + }, + uuid: this.uuid, + type: this.type + }; - var geometryGroupCounter = 0; + if ( this.name !== "" ) output.name = this.name; - return function ( usesFaceMaterial, maxVerticesInGroup ) { + if ( this.parameters !== undefined ) { - var f, fl, face, materialIndex, - groupHash, hash_map = {},geometryGroup; + var parameters = this.parameters; - var numMorphTargets = this.morphTargets.length; - var numMorphNormals = this.morphNormals.length; + for ( var key in parameters ) { - this.geometryGroups = {}; - this.geometryGroupsList = []; - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - materialIndex = usesFaceMaterial ? face.materialIndex : 0; - - if ( ! ( materialIndex in hash_map ) ) { - - hash_map[ materialIndex ] = { 'hash': materialIndex, 'counter': 0 }; - - } - - groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter; - - if ( ! ( groupHash in this.geometryGroups ) ) { - - geometryGroup = { 'id': geometryGroupCounter++, 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals }; - this.geometryGroups[ groupHash ] = geometryGroup; - this.geometryGroupsList.push(geometryGroup); - } - - if ( this.geometryGroups[ groupHash ].vertices + 3 > maxVerticesInGroup ) { - - hash_map[ materialIndex ].counter += 1; - groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter; - - if ( ! ( groupHash in this.geometryGroups ) ) { - - geometryGroup = { 'id': geometryGroupCounter++, 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals }; - this.geometryGroups[ groupHash ] = geometryGroup; - this.geometryGroupsList.push(geometryGroup); - - } - - } - - this.geometryGroups[ groupHash ].faces3.push( f ); - this.geometryGroups[ groupHash ].vertices += 3; + if ( parameters[ key ] !== undefined ) output[ key ] = parameters[ key ]; } - }; + return output; - } )(), + } + + var vertices = []; + + for ( var i = 0; i < this.vertices.length; i ++ ) { + + var vertex = this.vertices[ i ]; + vertices.push( vertex.x, vertex.y, vertex.z ); + + } + + var faces = []; + var normals = []; + var normalsHash = {}; + var colors = []; + var colorsHash = {}; + var uvs = []; + var uvsHash = {}; + + for ( var i = 0; i < this.faces.length; i ++ ) { + + var face = this.faces[ i ]; + + var hasMaterial = false; // face.materialIndex !== undefined; + var hasFaceUv = false; // deprecated + var hasFaceVertexUv = this.faceVertexUvs[ 0 ][ i ] !== undefined; + var hasFaceNormal = face.normal.length() > 0; + var hasFaceVertexNormal = face.vertexNormals.length > 0; + var hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1; + var hasFaceVertexColor = face.vertexColors.length > 0; + + var faceType = 0; + + faceType = setBit( faceType, 0, 0 ); + faceType = setBit( faceType, 1, hasMaterial ); + faceType = setBit( faceType, 2, hasFaceUv ); + faceType = setBit( faceType, 3, hasFaceVertexUv ); + faceType = setBit( faceType, 4, hasFaceNormal ); + faceType = setBit( faceType, 5, hasFaceVertexNormal ); + faceType = setBit( faceType, 6, hasFaceColor ); + faceType = setBit( faceType, 7, hasFaceVertexColor ); + + faces.push( faceType ); + faces.push( face.a, face.b, face.c ); + + + /* + if ( hasMaterial ) { + + faces.push( face.materialIndex ); + + } + */ + + if ( hasFaceVertexUv ) { + + var faceVertexUvs = this.faceVertexUvs[ 0 ][ i ]; + + faces.push( + getUvIndex( faceVertexUvs[ 0 ] ), + getUvIndex( faceVertexUvs[ 1 ] ), + getUvIndex( faceVertexUvs[ 2 ] ) + ); + + } + + if ( hasFaceNormal ) { + + faces.push( getNormalIndex( face.normal ) ); + + } + + if ( hasFaceVertexNormal ) { + + var vertexNormals = face.vertexNormals; + + faces.push( + getNormalIndex( vertexNormals[ 0 ] ), + getNormalIndex( vertexNormals[ 1 ] ), + getNormalIndex( vertexNormals[ 2 ] ) + ); + + } + + if ( hasFaceColor ) { + + faces.push( getColorIndex( face.color ) ); + + } + + if ( hasFaceVertexColor ) { + + var vertexColors = face.vertexColors; + + faces.push( + getColorIndex( vertexColors[ 0 ] ), + getColorIndex( vertexColors[ 1 ] ), + getColorIndex( vertexColors[ 2 ] ) + ); + + } + + } + + function setBit( value, position, enabled ) { + + return enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position) ); + + } + + function getNormalIndex( normal ) { + + var hash = normal.x.toString() + normal.y.toString() + normal.z.toString(); + + if ( normalsHash[ hash ] !== undefined ) { + + return normalsHash[ hash ]; + + } + + normalsHash[ hash ] = normals.length / 3; + normals.push( normal.x, normal.y, normal.z ); + + return normalsHash[ hash ]; + + } + + function getColorIndex( color ) { + + var hash = color.r.toString() + color.g.toString() + color.b.toString(); + + if ( colorsHash[ hash ] !== undefined ) { + + return colorsHash[ hash ]; + + } + + colorsHash[ hash ] = colors.length; + colors.push( color.getHex() ); + + return colorsHash[ hash ]; + + } + + function getUvIndex( uv ) { + + var hash = uv.x.toString() + uv.y.toString(); + + if ( uvsHash[ hash ] !== undefined ) { + + return uvsHash[ hash ]; + + } + + uvsHash[ hash ] = uvs.length / 2; + uvs.push( uv.x, uv.y ); + + return uvsHash[ hash ]; + + } + + output.data = {}; + + output.data.vertices = vertices; + output.data.normals = normals; + if ( colors.length > 0 ) output.data.colors = colors; + if ( uvs.length > 0 ) output.data.uvs = [ uvs ]; // temporal backward compatibility + output.data.faces = faces; + + // + + return output; + + }, clone: function () { @@ -10565,6 +10247,8 @@ THREE.Camera = function () { THREE.Object3D.call( this ); + this.type = 'Camera'; + this.matrixWorldInverse = new THREE.Matrix4(); this.projectionMatrix = new THREE.Matrix4(); @@ -10572,6 +10256,22 @@ THREE.Camera = function () { THREE.Camera.prototype = Object.create( THREE.Object3D.prototype ); +THREE.Camera.prototype.getWorldDirection = function () { + + var quaternion = new THREE.Quaternion(); + + return function ( optionalTarget ) { + + var result = optionalTarget || new THREE.Vector3(); + + this.getWorldQuaternion( quaternion ); + + return result.set( 0, 0, - 1 ).applyQuaternion( quaternion ); + + } + +}(); + THREE.Camera.prototype.lookAt = function () { // This routine does not support cameras with rotated and/or translated parent(s) @@ -10613,6 +10313,8 @@ THREE.CubeCamera = function ( near, far, cubeResolution ) { THREE.Object3D.call( this ); + this.type = 'CubeCamera'; + var fov = 90, aspect = 1; var cameraPX = new THREE.PerspectiveCamera( fov, aspect, near, far ); @@ -10690,6 +10392,10 @@ THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) { THREE.Camera.call( this ); + this.type = 'OrthographicCamera'; + + this.zoom = 1; + this.left = left; this.right = right; this.top = top; @@ -10706,7 +10412,12 @@ THREE.OrthographicCamera.prototype = Object.create( THREE.Camera.prototype ); THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () { - this.projectionMatrix.makeOrthographic( this.left, this.right, this.top, this.bottom, this.near, this.far ); + var dx = ( this.right - this.left ) / ( 2 * this.zoom ); + var dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); + var cx = ( this.right + this.left ) / 2; + var cy = ( this.top + this.bottom ) / 2; + + this.projectionMatrix.makeOrthographic( cx - dx, cx + dx, cy + dy, cy - dy, this.near, this.far ); }; @@ -10716,6 +10427,8 @@ THREE.OrthographicCamera.prototype.clone = function () { THREE.Camera.prototype.clone.call( this, camera ); + camera.zoom = this.zoom; + camera.left = this.left; camera.right = this.right; camera.top = this.top; @@ -10724,6 +10437,8 @@ THREE.OrthographicCamera.prototype.clone = function () { camera.near = this.near; camera.far = this.far; + camera.projectionMatrix.copy( this.projectionMatrix ); + return camera; }; @@ -10739,6 +10454,10 @@ THREE.PerspectiveCamera = function ( fov, aspect, near, far ) { THREE.Camera.call( this ); + this.type = 'PerspectiveCamera'; + + this.zoom = 1; + this.fov = fov !== undefined ? fov : 50; this.aspect = aspect !== undefined ? aspect : 1; this.near = near !== undefined ? near : 0.1; @@ -10819,10 +10538,12 @@ THREE.PerspectiveCamera.prototype.setViewOffset = function ( fullWidth, fullHeig THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () { + var fov = THREE.Math.radToDeg( 2 * Math.atan( Math.tan( THREE.Math.degToRad( this.fov ) * 0.5 ) / this.zoom ) ); + if ( this.fullWidth ) { var aspect = this.fullWidth / this.fullHeight; - var top = Math.tan( THREE.Math.degToRad( this.fov * 0.5 ) ) * this.near; + var top = Math.tan( THREE.Math.degToRad( fov * 0.5 ) ) * this.near; var bottom = - top; var left = aspect * bottom; var right = aspect * top; @@ -10840,7 +10561,7 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () { } else { - this.projectionMatrix.makePerspective( this.fov, this.aspect, this.near, this.far ); + this.projectionMatrix.makePerspective( fov, this.aspect, this.near, this.far ); } @@ -10852,12 +10573,17 @@ THREE.PerspectiveCamera.prototype.clone = function () { THREE.Camera.prototype.clone.call( this, camera ); + camera.zoom = this.zoom; + camera.fov = this.fov; camera.aspect = this.aspect; camera.near = this.near; camera.far = this.far; + camera.projectionMatrix.copy( this.projectionMatrix ); + return camera; + }; // File:src/lights/Light.js @@ -10871,6 +10597,8 @@ THREE.Light = function ( color ) { THREE.Object3D.call( this ); + this.type = 'Light'; + this.color = new THREE.Color( color ); }; @@ -10899,6 +10627,8 @@ THREE.AmbientLight = function ( color ) { THREE.Light.call( this, color ); + this.type = 'AmbientLight'; + }; THREE.AmbientLight.prototype = Object.create( THREE.Light.prototype ); @@ -10924,6 +10654,8 @@ THREE.AreaLight = function ( color, intensity ) { THREE.Light.call( this, color ); + this.type = 'AreaLight'; + this.normal = new THREE.Vector3( 0, - 1, 0 ); this.right = new THREE.Vector3( 1, 0, 0 ); @@ -10952,6 +10684,8 @@ THREE.DirectionalLight = function ( color, intensity ) { THREE.Light.call( this, color ); + this.type = 'DirectionalLight'; + this.position.set( 0, 1, 0 ); this.target = new THREE.Object3D(); @@ -11064,6 +10798,8 @@ THREE.HemisphereLight = function ( skyColor, groundColor, intensity ) { THREE.Light.call( this, skyColor ); + this.type = 'HemisphereLight'; + this.position.set( 0, 100, 0 ); this.groundColor = new THREE.Color( groundColor ); @@ -11096,6 +10832,8 @@ THREE.PointLight = function ( color, intensity, distance ) { THREE.Light.call( this, color ); + this.type = 'PointLight'; + this.intensity = ( intensity !== undefined ) ? intensity : 1; this.distance = ( distance !== undefined ) ? distance : 0; @@ -11126,6 +10864,8 @@ THREE.SpotLight = function ( color, intensity, distance, angle, exponent ) { THREE.Light.call( this, color ); + this.type = 'SpotLight'; + this.position.set( 0, 1, 0 ); this.target = new THREE.Object3D(); @@ -12527,11 +12267,9 @@ THREE.BufferGeometryLoader.prototype = { for ( var key in attributes ) { var attribute = attributes[ key ]; + var typedArray = new self[ attribute.type ]( attribute.array ); - geometry.attributes[ key ] = { - itemSize: attribute.itemSize, - array: new self[ attribute.type ]( attribute.array ) - } + geometry.addAttribute( key, new THREE.BufferAttribute( typedArray, attribute.itemSize ) ); } @@ -12547,10 +12285,15 @@ THREE.BufferGeometryLoader.prototype = { if ( boundingSphere !== undefined ) { - geometry.boundingSphere = new THREE.Sphere( - new THREE.Vector3().fromArray( boundingSphere.center !== undefined ? boundingSphere.center : [ 0, 0, 0 ] ), - boundingSphere.radius - ); + var center = new THREE.Vector3(); + + if ( boundingSphere.center !== undefined ) { + + center.fromArray( boundingSphere.center ); + + } + + geometry.boundingSphere = new THREE.Sphere( center, boundingSphere.radius ); } @@ -12609,6 +12352,7 @@ THREE.MaterialLoader.prototype = { if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors; + if ( json.shading !== undefined ) material.shading = json.shading; if ( json.blending !== undefined ) material.blending = json.blending; if ( json.side !== undefined ) material.side = json.side; if ( json.opacity !== undefined ) material.opacity = json.opacity; @@ -12909,13 +12653,13 @@ THREE.ObjectLoader.prototype = { if ( geometry === undefined ) { - console.error( 'THREE.ObjectLoader: Undefined geometry ' + data.geometry ); + console.warn( 'THREE.ObjectLoader: Undefined geometry', data.geometry ); } if ( material === undefined ) { - console.error( 'THREE.ObjectLoader: Undefined material ' + data.material ); + console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); } @@ -12923,13 +12667,34 @@ THREE.ObjectLoader.prototype = { break; + case 'Line': + + var geometry = geometries[ data.geometry ]; + var material = materials[ data.material ]; + + if ( geometry === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined geometry', data.geometry ); + + } + + if ( material === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); + + } + + object = new THREE.Line( geometry, material ); + + break; + case 'Sprite': var material = materials[ data.material ]; if ( material === undefined ) { - console.error( 'THREE.ObjectLoader: Undefined material ' + data.material ); + console.warn( 'THREE.ObjectLoader: Undefined material', data.material ); } @@ -12937,6 +12702,12 @@ THREE.ObjectLoader.prototype = { break; + case 'Group': + + object = new THREE.Group(); + + break; + default: object = new THREE.Object3D(); @@ -13025,6 +12796,135 @@ THREE.TextureLoader.prototype = { }; +// File:src/loaders/CompressedTextureLoader.js + +/** + * @author mrdoob / http://mrdoob.com/ + * + * Abstract Base class to block based textures loader (dds, pvr, ...) + */ + +THREE.CompressedTextureLoader = function () { + + // override in sub classes + this._parser = null; + +}; + + +THREE.CompressedTextureLoader.prototype = { + + constructor: THREE.CompressedTextureLoader, + + load: function ( url, onLoad, onError ) { + + var scope = this; + + var images = []; + + var texture = new THREE.CompressedTexture(); + texture.image = images; + + var loader = new THREE.XHRLoader(); + loader.setResponseType( 'arraybuffer' ); + + if ( url instanceof Array ) { + + var loaded = 0; + + var loadTexture = function ( i ) { + + loader.load( url[ i ], function ( buffer ) { + + var texDatas = scope._parser( buffer, true ); + + images[ i ] = { + width: texDatas.width, + height: texDatas.height, + format: texDatas.format, + mipmaps: texDatas.mipmaps + }; + + loaded += 1; + + if ( loaded === 6 ) { + + if (texDatas.mipmapCount == 1) + texture.minFilter = THREE.LinearFilter; + + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } + + } ); + + }; + + for ( var i = 0, il = url.length; i < il; ++ i ) { + + loadTexture( i ); + + } + + } else { + + // compressed cubemap texture stored in a single DDS file + + loader.load( url, function ( buffer ) { + + var texDatas = scope._parser( buffer, true ); + + if ( texDatas.isCubemap ) { + + var faces = texDatas.mipmaps.length / texDatas.mipmapCount; + + for ( var f = 0; f < faces; f ++ ) { + + images[ f ] = { mipmaps : [] }; + + for ( var i = 0; i < texDatas.mipmapCount; i ++ ) { + + images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); + images[ f ].format = texDatas.format; + images[ f ].width = texDatas.width; + images[ f ].height = texDatas.height; + + } + + } + + } else { + + texture.image.width = texDatas.width; + texture.image.height = texDatas.height; + texture.mipmaps = texDatas.mipmaps; + + } + + if ( texDatas.mipmapCount === 1 ) { + + texture.minFilter = THREE.LinearFilter; + + } + + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } ); + + } + + return texture; + + } + +}; + // File:src/materials/Material.js /** @@ -13034,10 +12934,12 @@ THREE.TextureLoader.prototype = { THREE.Material = function () { - this.id = THREE.MaterialIdCount ++; + Object.defineProperty( this, 'id', { value: THREE.MaterialIdCount ++ } ); + this.uuid = THREE.Math.generateUUID(); this.name = ''; + this.type = 'Material'; this.side = THREE.FrontSide; @@ -13115,6 +13017,78 @@ THREE.Material.prototype = { }, + toJSON: function () { + + var output = { + metadata: { + version: 4.2, + type: 'material', + generator: 'MaterialExporter' + }, + uuid: this.uuid, + type: this.type + }; + + if ( this.name !== "" ) output.name = this.name; + + if ( this instanceof THREE.MeshBasicMaterial ) { + + output.color = this.color.getHex(); + if ( this.vertexColors !== THREE.NoColors ) output.vertexColors = this.vertexColors; + if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending; + if ( this.side !== THREE.FrontSide ) output.side = this.side; + + } else if ( this instanceof THREE.MeshLambertMaterial ) { + + output.color = this.color.getHex(); + output.ambient = this.ambient.getHex(); + output.emissive = this.emissive.getHex(); + if ( this.vertexColors !== THREE.NoColors ) output.vertexColors = this.vertexColors; + if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending; + if ( this.side !== THREE.FrontSide ) output.side = this.side; + + } else if ( this instanceof THREE.MeshPhongMaterial ) { + + output.color = this.color.getHex(); + output.ambient = this.ambient.getHex(); + output.emissive = this.emissive.getHex(); + output.specular = this.specular.getHex(); + output.shininess = this.shininess; + if ( this.vertexColors !== THREE.NoColors ) output.vertexColors = this.vertexColors; + if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending; + if ( this.side !== THREE.FrontSide ) output.side = this.side; + + } else if ( this instanceof THREE.MeshNormalMaterial ) { + + if ( this.shading !== THREE.FlatShading ) output.shading = this.shading; + if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending; + if ( this.side !== THREE.FrontSide ) output.side = this.side; + + } else if ( this instanceof THREE.MeshDepthMaterial ) { + + if ( this.blending !== THREE.NormalBlending ) output.blending = this.blending; + if ( this.side !== THREE.FrontSide ) output.side = this.side; + + } else if ( this instanceof THREE.ShaderMaterial ) { + + output.uniforms = this.uniforms; + output.vertexShader = this.vertexShader; + output.fragmentShader = this.fragmentShader; + + } else if ( this instanceof THREE.SpriteMaterial ) { + + output.color = this.color.getHex(); + + } + + if ( this.opacity < 1 ) output.opacity = this.opacity; + if ( this.transparent !== false ) output.transparent = this.transparent; + if ( this.wireframe !== false ) output.wireframe = this.wireframe; + + return output; + + }, + clone: function ( material ) { if ( material === undefined ) material = new THREE.Material(); @@ -13189,6 +13163,8 @@ THREE.LineBasicMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'LineBasicMaterial'; + this.color = new THREE.Color( 0xffffff ); this.linewidth = 1; @@ -13254,6 +13230,8 @@ THREE.LineDashedMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'LineDashedMaterial'; + this.color = new THREE.Color( 0xffffff ); this.linewidth = 1; @@ -13337,6 +13315,8 @@ THREE.MeshBasicMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'MeshBasicMaterial'; + this.color = new THREE.Color( 0xffffff ); // emissive this.map = null; @@ -13458,6 +13438,8 @@ THREE.MeshLambertMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'MeshLambertMaterial'; + this.color = new THREE.Color( 0xffffff ); // diffuse this.ambient = new THREE.Color( 0xffffff ); this.emissive = new THREE.Color( 0x000000 ); @@ -13599,6 +13581,8 @@ THREE.MeshPhongMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'MeshPhongMaterial'; + this.color = new THREE.Color( 0xffffff ); // diffuse this.ambient = new THREE.Color( 0xffffff ); this.emissive = new THREE.Color( 0x000000 ); @@ -13727,6 +13711,8 @@ THREE.MeshDepthMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'MeshDepthMaterial'; + this.morphTargets = false; this.wireframe = false; this.wireframeLinewidth = 1; @@ -13772,6 +13758,8 @@ THREE.MeshNormalMaterial = function ( parameters ) { THREE.Material.call( this, parameters ); + this.type = 'MeshNormalMaterial'; + this.shading = THREE.FlatShading; this.wireframe = false; @@ -13808,22 +13796,55 @@ THREE.MeshNormalMaterial.prototype.clone = function () { THREE.MeshFaceMaterial = function ( materials ) { + this.uuid = THREE.Math.generateUUID(); + + this.type = 'MeshFaceMaterial'; + this.materials = materials instanceof Array ? materials : []; }; -THREE.MeshFaceMaterial.prototype.clone = function () { +THREE.MeshFaceMaterial.prototype = { - var material = new THREE.MeshFaceMaterial(); + constructor: THREE.MeshFaceMaterial, - for ( var i = 0; i < this.materials.length; i ++ ) { + toJSON: function () { - material.materials.push( this.materials[ i ].clone() ); + var output = { + metadata: { + version: 4.2, + type: 'material', + generator: 'MaterialExporter' + }, + uuid: this.uuid, + type: this.type, + materials: [] + }; + + for ( var i = 0, l = this.materials.length; i < l; i ++ ) { + + output.materials.push( this.materials[ i ].toJSON() ); + + } + + return output; + + }, + + clone: function () { + + var material = new THREE.MeshFaceMaterial(); + + for ( var i = 0; i < this.materials.length; i ++ ) { + + material.materials.push( this.materials[ i ].clone() ); + + } + + return material; } - return material; - }; // File:src/materials/PointCloudMaterial.js @@ -13853,6 +13874,8 @@ THREE.PointCloudMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'PointCloudMaterial'; + this.color = new THREE.Color( 0xffffff ); this.map = null; @@ -13943,6 +13966,8 @@ THREE.ShaderMaterial = function ( parameters ) { THREE.Material.call( this ); + this.type = 'ShaderMaterial'; + this.defines = {}; this.uniforms = {}; this.attributes = null; @@ -14028,6 +14053,8 @@ THREE.RawShaderMaterial = function ( parameters ) { THREE.ShaderMaterial.call( this, parameters ); + this.type = 'RawShaderMaterial'; + }; THREE.RawShaderMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype ); @@ -14067,7 +14094,7 @@ THREE.SpriteMaterial = function ( parameters ) { THREE.Material.call( this ); - // defaults + this.type = 'SpriteMaterial'; this.color = new THREE.Color( 0xffffff ); this.map = null; @@ -14101,49 +14128,6 @@ THREE.SpriteMaterial.prototype.clone = function () { }; -// File:src/materials/SpriteCanvasMaterial.js - -/** - * @author mrdoob / http://mrdoob.com/ - * - * parameters = { - * color: , - * program: , - * opacity: , - * blending: THREE.NormalBlending - * } - */ - -THREE.SpriteCanvasMaterial = function ( parameters ) { - - THREE.Material.call( this ); - - this.color = new THREE.Color( 0xffffff ); - this.program = function ( context, color ) {}; - - this.setValues( parameters ); - -}; - -THREE.SpriteCanvasMaterial.prototype = Object.create( THREE.Material.prototype ); - -THREE.SpriteCanvasMaterial.prototype.clone = function () { - - var material = new THREE.SpriteCanvasMaterial(); - - THREE.Material.prototype.clone.call( this, material ); - - material.color.copy( this.color ); - material.program = this.program; - - return material; - -}; - -// backwards compatibility - -THREE.ParticleCanvasMaterial = THREE.SpriteCanvasMaterial; - // File:src/textures/Texture.js /** @@ -14154,7 +14138,8 @@ THREE.ParticleCanvasMaterial = THREE.SpriteCanvasMaterial; THREE.Texture = function ( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { - this.id = THREE.TextureIdCount ++; + Object.defineProperty( this, 'id', { value: THREE.TextureIdCount ++ } ); + this.uuid = THREE.Math.generateUUID(); this.name = ''; @@ -14300,7 +14285,15 @@ THREE.CompressedTexture = function ( mipmaps, width, height, format, type, mappi this.image = { width: width, height: height }; this.mipmaps = mipmaps; - this.generateMipmaps = false; // WebGL currently can't generate mipmaps for compressed textures, they must be embedded in DDS file + // no flipping for cube textures + // (also flipping doesn't work for compressed textures ) + + this.flipY = false; + + // can't generate mipmaps for compressed textures + // mips must be embedded in DDS files + + this.generateMipmaps = false; }; @@ -14342,6 +14335,54 @@ THREE.DataTexture.prototype.clone = function () { }; +// File:src/textures/VideoTexture.js + +/** + * @author mrdoob / http://mrdoob.com/ + */ + +THREE.VideoTexture = function ( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + + THREE.Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.generateMipmaps = false; + + var scope = this; + + var update = function () { + + requestAnimationFrame( update ); + + if ( video.readyState === video.HAVE_ENOUGH_DATA ) { + + scope.needsUpdate = true; + + } + + }; + + update(); + +}; + +THREE.VideoTexture.prototype = Object.create( THREE.Texture.prototype ); + +// File:src/objects/Group.js + +/** + * @author mrdoob / http://mrdoob.com/ + */ + +THREE.Group = function () { + + THREE.Object3D.call( this ); + + this.type = 'Group'; + +}; + +THREE.Group.prototype = Object.create( THREE.Object3D.prototype ); + // File:src/objects/PointCloud.js /** @@ -14352,6 +14393,8 @@ THREE.PointCloud = function ( geometry, material ) { THREE.Object3D.call( this ); + this.type = 'PointCloud'; + this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.PointCloudMaterial( { color: Math.random() * 0xffffff } ); @@ -14446,11 +14489,7 @@ THREE.PointCloud.prototype.raycast = ( function () { var a = index + indices[ i ]; - position.set( - positions[ a * 3 ], - positions[ a * 3 + 1 ], - positions[ a * 3 + 2 ] - ); + position.fromArray( positions, a * 3 ); testPoint( position, a ); @@ -14519,14 +14558,16 @@ THREE.ParticleSystem = function ( geometry, material ) { * @author mrdoob / http://mrdoob.com/ */ -THREE.Line = function ( geometry, material, type ) { +THREE.Line = function ( geometry, material, mode ) { THREE.Object3D.call( this ); + this.type = 'Line'; + this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } ); - this.type = ( type !== undefined ) ? type : THREE.LineStrip; + this.mode = ( mode !== undefined ) ? mode : THREE.LineStrip; }; @@ -14572,7 +14613,7 @@ THREE.Line.prototype.raycast = ( function () { var nbVertices = vertices.length; var interSegment = new THREE.Vector3(); var interRay = new THREE.Vector3(); - var step = this.type === THREE.LineStrip ? 1 : 2; + var step = this.mode === THREE.LineStrip ? 1 : 2; for ( var i = 0; i < nbVertices - 1; i = i + step ) { @@ -14606,7 +14647,7 @@ THREE.Line.prototype.raycast = ( function () { THREE.Line.prototype.clone = function ( object ) { - if ( object === undefined ) object = new THREE.Line( this.geometry, this.material, this.type ); + if ( object === undefined ) object = new THREE.Line( this.geometry, this.material, this.mode ); THREE.Object3D.prototype.clone.call( this, object ); @@ -14627,6 +14668,8 @@ THREE.Mesh = function ( geometry, material ) { THREE.Object3D.call( this ); + this.type = 'Mesh'; + this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ); @@ -14748,22 +14791,9 @@ THREE.Mesh.prototype.raycast = ( function () { b = index + indices[ i + 1 ]; c = index + indices[ i + 2 ]; - vA.set( - positions[ a * 3 ], - positions[ a * 3 + 1 ], - positions[ a * 3 + 2 ] - ); - vB.set( - positions[ b * 3 ], - positions[ b * 3 + 1 ], - positions[ b * 3 + 2 ] - ); - vC.set( - positions[ c * 3 ], - positions[ c * 3 + 1 ], - positions[ c * 3 + 2 ] - ); - + vA.fromArray( positions, a * 3 ); + vB.fromArray( positions, b * 3 ); + vC.fromArray( positions, c * 3 ); if ( material.side === THREE.BackSide ) { @@ -14787,8 +14817,7 @@ THREE.Mesh.prototype.raycast = ( function () { distance: distance, point: intersectionPoint, - indices: [ a, b, c ], - face: null, + face: new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) ), faceIndex: null, object: this @@ -14808,22 +14837,9 @@ THREE.Mesh.prototype.raycast = ( function () { b = i + 1; c = i + 2; - vA.set( - positions[ j ], - positions[ j + 1 ], - positions[ j + 2 ] - ); - vB.set( - positions[ j + 3 ], - positions[ j + 4 ], - positions[ j + 5 ] - ); - vC.set( - positions[ j + 6 ], - positions[ j + 7 ], - positions[ j + 8 ] - ); - + vA.fromArray( positions, j ); + vB.fromArray( positions, j + 3 ); + vC.fromArray( positions, j + 6 ); if ( material.side === THREE.BackSide ) { @@ -14847,8 +14863,7 @@ THREE.Mesh.prototype.raycast = ( function () { distance: distance, point: intersectionPoint, - indices: [ a, b, c ], - face: null, + face: new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) ), faceIndex: null, object: this @@ -14981,26 +14996,10 @@ THREE.Bone = function ( belongsToSkin ) { this.skin = belongsToSkin; - this.accumulatedRotWeight = 0; - this.accumulatedPosWeight = 0; - this.accumulatedSclWeight = 0; - }; THREE.Bone.prototype = Object.create( THREE.Object3D.prototype ); -THREE.Bone.prototype.updateMatrixWorld = function ( force ) { - - THREE.Object3D.prototype.updateMatrixWorld.call( this, force ); - - // Reset weights to be re-accumulated in the next frame - - this.accumulatedRotWeight = 0; - this.accumulatedPosWeight = 0; - this.accumulatedSclWeight = 0; - -}; - // File:src/objects/Skeleton.js @@ -15142,8 +15141,7 @@ THREE.Skeleton.prototype.pose = function () { bone.matrix.getInverse( bone.parent.matrixWorld ); bone.matrix.multiply( bone.matrixWorld ); - } - else { + } else { bone.matrix.copy( bone.matrixWorld ); @@ -15157,30 +15155,34 @@ THREE.Skeleton.prototype.pose = function () { }; -THREE.Skeleton.prototype.update = function () { +THREE.Skeleton.prototype.update = ( function () { var offsetMatrix = new THREE.Matrix4(); + + return function () { - // flatten bone matrices to array + // flatten bone matrices to array - for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { - // compute the offset between the current and the original transform + // compute the offset between the current and the original transform - var matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix; + var matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix; - offsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] ); - offsetMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 ); + offsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] ); + offsetMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 ); - } + } - if ( this.useVertexTexture ) { + if ( this.useVertexTexture ) { - this.boneTexture.needsUpdate = true; + this.boneTexture.needsUpdate = true; - } + } + + }; -}; +} )(); // File:src/objects/SkinnedMesh.js @@ -15195,6 +15197,8 @@ THREE.SkinnedMesh = function ( geometry, material, useVertexTexture ) { THREE.Mesh.call( this, geometry, material ); + this.type = 'SkinnedMesh'; + this.bindMode = "attached"; this.bindMatrix = new THREE.Matrix4(); this.bindMatrixInverse = new THREE.Matrix4(); @@ -15363,6 +15367,8 @@ THREE.MorphAnimMesh = function ( geometry, material ) { THREE.Mesh.call( this, geometry, material ); + this.type = 'MorphAnimMesh'; + // API this.duration = 1000; // milliseconds @@ -15707,15 +15713,21 @@ THREE.LOD.prototype.clone = function ( object ) { THREE.Sprite = ( function () { - var vertices = new Float32Array( [ - 0.5, - 0.5, 0, 0.5, - 0.5, 0, 0.5, 0.5, 0 ] ); + var indices = new Uint16Array( [ 0, 1, 2, 0, 2, 3 ] ); + var vertices = new Float32Array( [ - 0.5, - 0.5, 0, 0.5, - 0.5, 0, 0.5, 0.5, 0, - 0.5, 0.5, 0 ] ); + var uvs = new Float32Array( [ 0, 0, 1, 0, 1, 1, 0, 1 ] ); var geometry = new THREE.BufferGeometry(); + geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) ); geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); return function ( material ) { THREE.Object3D.call( this ); + this.type = 'Sprite'; + this.geometry = geometry; this.material = ( material !== undefined ) ? material : new THREE.SpriteMaterial(); @@ -15754,14 +15766,6 @@ THREE.Sprite.prototype.raycast = ( function () { }() ); -THREE.Sprite.prototype.updateMatrix = function () { - - this.matrix.compose( this.position, this.quaternion, this.scale ); - - this.matrixWorldNeedsUpdate = true; - -}; - THREE.Sprite.prototype.clone = function ( object ) { if ( object === undefined ) object = new THREE.Sprite( this.material ); @@ -15776,6 +15780,88 @@ THREE.Sprite.prototype.clone = function ( object ) { THREE.Particle = THREE.Sprite; +// File:src/objects/LensFlare.js + +/** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + */ + +THREE.LensFlare = function ( texture, size, distance, blending, color ) { + + THREE.Object3D.call( this ); + + this.lensFlares = []; + + this.positionScreen = new THREE.Vector3(); + this.customUpdateCallback = undefined; + + if( texture !== undefined ) { + + this.add( texture, size, distance, blending, color ); + + } + +}; + +THREE.LensFlare.prototype = Object.create( THREE.Object3D.prototype ); + + +/* + * Add: adds another flare + */ + +THREE.LensFlare.prototype.add = function ( texture, size, distance, blending, color, opacity ) { + + if ( size === undefined ) size = - 1; + if ( distance === undefined ) distance = 0; + if ( opacity === undefined ) opacity = 1; + if ( color === undefined ) color = new THREE.Color( 0xffffff ); + if ( blending === undefined ) blending = THREE.NormalBlending; + + distance = Math.min( distance, Math.max( 0, distance ) ); + + this.lensFlares.push( { + texture: texture, // THREE.Texture + size: size, // size in pixels (-1 = use texture.width) + distance: distance, // distance (0-1) from light source (0=at light source) + x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is ontop z = 1 is back + scale: 1, // scale + rotation: 1, // rotation + opacity: opacity, // opacity + color: color, // color + blending: blending // blending + } ); + +}; + +/* + * Update lens flares update positions on all flares based on the screen position + * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way. + */ + +THREE.LensFlare.prototype.updateLensFlares = function () { + + var f, fl = this.lensFlares.length; + var flare; + var vecX = - this.positionScreen.x * 2; + var vecY = - this.positionScreen.y * 2; + + for( f = 0; f < fl; f ++ ) { + + flare = this.lensFlares[ f ]; + + flare.x = this.positionScreen.x + vecX * flare.distance; + flare.y = this.positionScreen.y + vecY * flare.distance; + + flare.wantedRotation = flare.x * Math.PI * 0.25; + flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25; + + } + +}; + + // File:src/scenes/Scene.js /** @@ -15786,113 +15872,17 @@ THREE.Scene = function () { THREE.Object3D.call( this ); + this.type = 'Scene'; + this.fog = null; this.overrideMaterial = null; this.autoUpdate = true; // checked by the renderer - this.matrixAutoUpdate = false; - - this.__lights = []; - - this.__objectsAdded = []; - this.__objectsRemoved = []; }; THREE.Scene.prototype = Object.create( THREE.Object3D.prototype ); -THREE.Scene.prototype.__addObject = function ( object ) { - - if ( object instanceof THREE.Light ) { - - if ( this.__lights.indexOf( object ) === - 1 ) { - - this.__lights.push( object ); - - } - - if ( object.target && object.target.parent === undefined ) { - - this.add( object.target ); - - } - - } else if ( ! ( object instanceof THREE.Camera || object instanceof THREE.Bone ) ) { - - this.__objectsAdded.push( object ); - - // check if previously removed - - var i = this.__objectsRemoved.indexOf( object ); - - if ( i !== - 1 ) { - - this.__objectsRemoved.splice( i, 1 ); - - } - - } - - this.dispatchEvent( { type: 'objectAdded', object: object } ); - object.dispatchEvent( { type: 'addedToScene', scene: this } ); - - for ( var c = 0; c < object.children.length; c ++ ) { - - this.__addObject( object.children[ c ] ); - - } - -}; - -THREE.Scene.prototype.__removeObject = function ( object ) { - - if ( object instanceof THREE.Light ) { - - var i = this.__lights.indexOf( object ); - - if ( i !== - 1 ) { - - this.__lights.splice( i, 1 ); - - } - - if ( object.shadowCascadeArray ) { - - for ( var x = 0; x < object.shadowCascadeArray.length; x ++ ) { - - this.__removeObject( object.shadowCascadeArray[ x ] ); - - } - - } - - } else if ( ! ( object instanceof THREE.Camera ) ) { - - this.__objectsRemoved.push( object ); - - // check if previously added - - var i = this.__objectsAdded.indexOf( object ); - - if ( i !== - 1 ) { - - this.__objectsAdded.splice( i, 1 ); - - } - - } - - this.dispatchEvent( { type: 'objectRemoved', object: object } ); - object.dispatchEvent( { type: 'removedFromScene', scene: this } ); - - for ( var c = 0; c < object.children.length; c ++ ) { - - this.__removeObject( object.children[ c ] ); - - } - -}; - THREE.Scene.prototype.clone = function ( object ) { if ( object === undefined ) object = new THREE.Scene(); @@ -15955,1081 +15945,6 @@ THREE.FogExp2.prototype.clone = function () { }; -// File:src/renderers/CanvasRenderer.js - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -THREE.CanvasRenderer = function ( parameters ) { - - console.log( 'THREE.CanvasRenderer', THREE.REVISION ); - - var smoothstep = THREE.Math.smoothstep; - - parameters = parameters || {}; - - var _this = this, - _renderData, _elements, _lights, - _projector = new THREE.Projector(), - - _canvas = parameters.canvas !== undefined - ? parameters.canvas - : document.createElement( 'canvas' ), - - _canvasWidth = _canvas.width, - _canvasHeight = _canvas.height, - _canvasWidthHalf = Math.floor( _canvasWidth / 2 ), - _canvasHeightHalf = Math.floor( _canvasHeight / 2 ), - - _viewportX = 0, - _viewportY = 0, - _viewportWidth = _canvasWidth, - _viewportHeight = _canvasHeight, - - _context = _canvas.getContext( '2d', { - alpha: parameters.alpha === true - } ), - - _clearColor = new THREE.Color( 0x000000 ), - _clearAlpha = 0, - - _contextGlobalAlpha = 1, - _contextGlobalCompositeOperation = 0, - _contextStrokeStyle = null, - _contextFillStyle = null, - _contextLineWidth = null, - _contextLineCap = null, - _contextLineJoin = null, - _contextLineDash = [], - - _camera, - - _v1, _v2, _v3, _v4, - _v5 = new THREE.RenderableVertex(), - _v6 = new THREE.RenderableVertex(), - - _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, - _v4x, _v4y, _v5x, _v5y, _v6x, _v6y, - - _color = new THREE.Color(), - _color1 = new THREE.Color(), - _color2 = new THREE.Color(), - _color3 = new THREE.Color(), - _color4 = new THREE.Color(), - - _diffuseColor = new THREE.Color(), - _emissiveColor = new THREE.Color(), - - _lightColor = new THREE.Color(), - - _patterns = {}, - - _image, _uvs, - _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, - - _clipBox = new THREE.Box2(), - _clearBox = new THREE.Box2(), - _elemBox = new THREE.Box2(), - - _ambientLight = new THREE.Color(), - _directionalLights = new THREE.Color(), - _pointLights = new THREE.Color(), - - _vector3 = new THREE.Vector3(), // Needed for PointLight - _centroid = new THREE.Vector3(), - _normal = new THREE.Vector3(), - _normalViewMatrix = new THREE.Matrix3(); - - // dash+gap fallbacks for Firefox and everything else - - if ( _context.setLineDash === undefined ) { - - _context.setLineDash = function () {} - - } - - this.domElement = _canvas; - - this.devicePixelRatio = parameters.devicePixelRatio !== undefined - ? parameters.devicePixelRatio - : self.devicePixelRatio !== undefined - ? self.devicePixelRatio - : 1; - - this.autoClear = true; - this.sortObjects = true; - this.sortElements = true; - - this.info = { - - render: { - - vertices: 0, - faces: 0 - - } - - } - - // WebGLRenderer compatibility - - this.supportsVertexTextures = function () {}; - this.setFaceCulling = function () {}; - - this.setSize = function ( width, height, updateStyle ) { - - _canvasWidth = width * this.devicePixelRatio; - _canvasHeight = height * this.devicePixelRatio; - - _canvas.width = _canvasWidth; - _canvas.height = _canvasHeight; - - _canvasWidthHalf = Math.floor( _canvasWidth / 2 ); - _canvasHeightHalf = Math.floor( _canvasHeight / 2 ); - - if ( updateStyle !== false ) { - - _canvas.style.width = width + 'px'; - _canvas.style.height = height + 'px'; - - } - - _clipBox.min.set( -_canvasWidthHalf, -_canvasHeightHalf ), - _clipBox.max.set( _canvasWidthHalf, _canvasHeightHalf ); - - _clearBox.min.set( - _canvasWidthHalf, - _canvasHeightHalf ); - _clearBox.max.set( _canvasWidthHalf, _canvasHeightHalf ); - - _contextGlobalAlpha = 1; - _contextGlobalCompositeOperation = 0; - _contextStrokeStyle = null; - _contextFillStyle = null; - _contextLineWidth = null; - _contextLineCap = null; - _contextLineJoin = null; - - this.setViewport( 0, 0, width, height ); - - }; - - this.setViewport = function ( x, y, width, height ) { - - _viewportX = x * this.devicePixelRatio; - _viewportY = y * this.devicePixelRatio; - - _viewportWidth = width * this.devicePixelRatio; - _viewportHeight = height * this.devicePixelRatio; - - }; - - this.setScissor = function () {}; - this.enableScissorTest = function () {}; - - this.setClearColor = function ( color, alpha ) { - - _clearColor.set( color ); - _clearAlpha = alpha !== undefined ? alpha : 1; - - _clearBox.min.set( - _canvasWidthHalf, - _canvasHeightHalf ); - _clearBox.max.set( _canvasWidthHalf, _canvasHeightHalf ); - - }; - - this.setClearColorHex = function ( hex, alpha ) { - - console.warn( 'THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.' ); - this.setClearColor( hex, alpha ); - - }; - - this.getClearColor = function () { - - return _clearColor; - - }; - - this.getClearAlpha = function () { - - return _clearAlpha; - - }; - - this.getMaxAnisotropy = function () { - - return 0; - - }; - - this.clear = function () { - - if ( _clearBox.empty() === false ) { - - _clearBox.intersect( _clipBox ); - _clearBox.expandByScalar( 2 ); - - _clearBox.min.x = _clearBox.min.x + _canvasWidthHalf; - _clearBox.min.y = - _clearBox.min.y + _canvasHeightHalf; - _clearBox.max.x = _clearBox.max.x + _canvasWidthHalf; - _clearBox.max.y = - _clearBox.max.y + _canvasHeightHalf; - - if ( _clearAlpha < 1 ) { - - _context.clearRect( - _clearBox.min.x | 0, - _clearBox.min.y | 0, - ( _clearBox.max.x - _clearBox.min.x ) | 0, - ( _clearBox.max.y - _clearBox.min.y ) | 0 - ); - - } - - if ( _clearAlpha > 0 ) { - - setBlending( THREE.NormalBlending ); - setOpacity( 1 ); - - setFillStyle( 'rgba(' + Math.floor( _clearColor.r * 255 ) + ',' + Math.floor( _clearColor.g * 255 ) + ',' + Math.floor( _clearColor.b * 255 ) + ',' + _clearAlpha + ')' ); - - _context.fillRect( - _clearBox.min.x | 0, - _clearBox.min.y | 0, - ( _clearBox.max.x - _clearBox.min.x ) | 0, - ( _clearBox.max.y - _clearBox.min.y ) | 0 - ); - - } - - _clearBox.makeEmpty(); - - } - - }; - - // compatibility - - this.clearColor = function () {}; - this.clearDepth = function () {}; - this.clearStencil = function () {}; - - this.render = function ( scene, camera ) { - - if ( camera instanceof THREE.Camera === false ) { - - console.error( 'THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.' ); - return; - - } - - if ( this.autoClear === true ) this.clear(); - - _this.info.render.vertices = 0; - _this.info.render.faces = 0; - - _context.setTransform( _viewportWidth / _canvasWidth, 0, 0, - _viewportHeight / _canvasHeight, _viewportX, _canvasHeight - _viewportY ); - _context.translate( _canvasWidthHalf, _canvasHeightHalf ); - - _renderData = _projector.projectScene( scene, camera, this.sortObjects, this.sortElements ); - _elements = _renderData.elements; - _lights = _renderData.lights; - _camera = camera; - - _normalViewMatrix.getNormalMatrix( camera.matrixWorldInverse ); - - /* DEBUG - setFillStyle( 'rgba( 0, 255, 255, 0.5 )' ); - _context.fillRect( _clipBox.min.x, _clipBox.min.y, _clipBox.max.x - _clipBox.min.x, _clipBox.max.y - _clipBox.min.y ); - */ - - calculateLights(); - - for ( var e = 0, el = _elements.length; e < el; e ++ ) { - - var element = _elements[ e ]; - - var material = element.material; - - if ( material === undefined || material.opacity === 0 ) continue; - - _elemBox.makeEmpty(); - - if ( element instanceof THREE.RenderableSprite ) { - - _v1 = element; - _v1.x *= _canvasWidthHalf; _v1.y *= _canvasHeightHalf; - - renderSprite( _v1, element, material ); - - } else if ( element instanceof THREE.RenderableLine ) { - - _v1 = element.v1; _v2 = element.v2; - - _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; - _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; - - _elemBox.setFromPoints( [ - _v1.positionScreen, - _v2.positionScreen - ] ); - - if ( _clipBox.isIntersectionBox( _elemBox ) === true ) { - - renderLine( _v1, _v2, element, material ); - - } - - } else if ( element instanceof THREE.RenderableFace ) { - - _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; - - if ( _v1.positionScreen.z < - 1 || _v1.positionScreen.z > 1 ) continue; - if ( _v2.positionScreen.z < - 1 || _v2.positionScreen.z > 1 ) continue; - if ( _v3.positionScreen.z < - 1 || _v3.positionScreen.z > 1 ) continue; - - _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; - _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; - _v3.positionScreen.x *= _canvasWidthHalf; _v3.positionScreen.y *= _canvasHeightHalf; - - if ( material.overdraw > 0 ) { - - expand( _v1.positionScreen, _v2.positionScreen, material.overdraw ); - expand( _v2.positionScreen, _v3.positionScreen, material.overdraw ); - expand( _v3.positionScreen, _v1.positionScreen, material.overdraw ); - - } - - _elemBox.setFromPoints( [ - _v1.positionScreen, - _v2.positionScreen, - _v3.positionScreen - ] ); - - if ( _clipBox.isIntersectionBox( _elemBox ) === true ) { - - renderFace3( _v1, _v2, _v3, 0, 1, 2, element, material ); - - } - - } - - /* DEBUG - setLineWidth( 1 ); - setStrokeStyle( 'rgba( 0, 255, 0, 0.5 )' ); - _context.strokeRect( _elemBox.min.x, _elemBox.min.y, _elemBox.max.x - _elemBox.min.x, _elemBox.max.y - _elemBox.min.y ); - */ - - _clearBox.union( _elemBox ); - - } - - /* DEBUG - setLineWidth( 1 ); - setStrokeStyle( 'rgba( 255, 0, 0, 0.5 )' ); - _context.strokeRect( _clearBox.min.x, _clearBox.min.y, _clearBox.max.x - _clearBox.min.x, _clearBox.max.y - _clearBox.min.y ); - */ - - _context.setTransform( 1, 0, 0, 1, 0, 0 ); - - }; - - // - - function calculateLights() { - - _ambientLight.setRGB( 0, 0, 0 ); - _directionalLights.setRGB( 0, 0, 0 ); - _pointLights.setRGB( 0, 0, 0 ); - - for ( var l = 0, ll = _lights.length; l < ll; l ++ ) { - - var light = _lights[ l ]; - var lightColor = light.color; - - if ( light instanceof THREE.AmbientLight ) { - - _ambientLight.add( lightColor ); - - } else if ( light instanceof THREE.DirectionalLight ) { - - // for sprites - - _directionalLights.add( lightColor ); - - } else if ( light instanceof THREE.PointLight ) { - - // for sprites - - _pointLights.add( lightColor ); - - } - - } - - } - - function calculateLight( position, normal, color ) { - - for ( var l = 0, ll = _lights.length; l < ll; l ++ ) { - - var light = _lights[ l ]; - - _lightColor.copy( light.color ); - - if ( light instanceof THREE.DirectionalLight ) { - - var lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld ).normalize(); - - var amount = normal.dot( lightPosition ); - - if ( amount <= 0 ) continue; - - amount *= light.intensity; - - color.add( _lightColor.multiplyScalar( amount ) ); - - } else if ( light instanceof THREE.PointLight ) { - - var lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld ); - - var amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() ); - - if ( amount <= 0 ) continue; - - amount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 ); - - if ( amount == 0 ) continue; - - amount *= light.intensity; - - color.add( _lightColor.multiplyScalar( amount ) ); - - } - - } - - } - - function renderSprite( v1, element, material ) { - - setOpacity( material.opacity ); - setBlending( material.blending ); - - var scaleX = element.scale.x * _canvasWidthHalf; - var scaleY = element.scale.y * _canvasHeightHalf; - - var dist = 0.5 * Math.sqrt( scaleX * scaleX + scaleY * scaleY ); // allow for rotated sprite - _elemBox.min.set( v1.x - dist, v1.y - dist ); - _elemBox.max.set( v1.x + dist, v1.y + dist ); - - if ( material instanceof THREE.SpriteMaterial ) { - - var texture = material.map; - - if ( texture !== null && texture.image !== undefined ) { - - if ( texture.hasEventListener( 'update', onTextureUpdate ) === false ) { - - if ( texture.image.width > 0 ) { - - textureToPattern( texture ); - - } - - texture.addEventListener( 'update', onTextureUpdate ); - - } - - var pattern = _patterns[ texture.id ]; - - if ( pattern !== undefined ) { - - setFillStyle( pattern ); - - } else { - - setFillStyle( 'rgba( 0, 0, 0, 1 )' ); - - } - - // - - var bitmap = texture.image; - - var ox = bitmap.width * texture.offset.x; - var oy = bitmap.height * texture.offset.y; - - var sx = bitmap.width * texture.repeat.x; - var sy = bitmap.height * texture.repeat.y; - - var cx = scaleX / sx; - var cy = scaleY / sy; - - _context.save(); - _context.translate( v1.x, v1.y ); - if ( material.rotation !== 0 ) _context.rotate( material.rotation ); - _context.translate( - scaleX / 2, - scaleY / 2 ); - _context.scale( cx, cy ); - _context.translate( - ox, - oy ); - _context.fillRect( ox, oy, sx, sy ); - _context.restore(); - - } else { - - // no texture - - setFillStyle( material.color.getStyle() ); - - _context.save(); - _context.translate( v1.x, v1.y ); - if ( material.rotation !== 0 ) _context.rotate( material.rotation ); - _context.scale( scaleX, - scaleY ); - _context.fillRect( - 0.5, - 0.5, 1, 1 ); - _context.restore(); - - } - - } else if ( material instanceof THREE.SpriteCanvasMaterial ) { - - setStrokeStyle( material.color.getStyle() ); - setFillStyle( material.color.getStyle() ); - - _context.save(); - _context.translate( v1.x, v1.y ); - if ( material.rotation !== 0 ) _context.rotate( material.rotation ); - _context.scale( scaleX, scaleY ); - - material.program( _context ); - - _context.restore(); - - } - - /* DEBUG - setStrokeStyle( 'rgb(255,255,0)' ); - _context.beginPath(); - _context.moveTo( v1.x - 10, v1.y ); - _context.lineTo( v1.x + 10, v1.y ); - _context.moveTo( v1.x, v1.y - 10 ); - _context.lineTo( v1.x, v1.y + 10 ); - _context.stroke(); - */ - - } - - function renderLine( v1, v2, element, material ) { - - setOpacity( material.opacity ); - setBlending( material.blending ); - - _context.beginPath(); - _context.moveTo( v1.positionScreen.x, v1.positionScreen.y ); - _context.lineTo( v2.positionScreen.x, v2.positionScreen.y ); - - if ( material instanceof THREE.LineBasicMaterial ) { - - setLineWidth( material.linewidth ); - setLineCap( material.linecap ); - setLineJoin( material.linejoin ); - - if ( material.vertexColors !== THREE.VertexColors ) { - - setStrokeStyle( material.color.getStyle() ); - - } else { - - var colorStyle1 = element.vertexColors[ 0 ].getStyle(); - var colorStyle2 = element.vertexColors[ 1 ].getStyle(); - - if ( colorStyle1 === colorStyle2 ) { - - setStrokeStyle( colorStyle1 ); - - } else { - - try { - - var grad = _context.createLinearGradient( - v1.positionScreen.x, - v1.positionScreen.y, - v2.positionScreen.x, - v2.positionScreen.y - ); - grad.addColorStop( 0, colorStyle1 ); - grad.addColorStop( 1, colorStyle2 ); - - } catch ( exception ) { - - grad = colorStyle1; - - } - - setStrokeStyle( grad ); - - } - - } - - _context.stroke(); - _elemBox.expandByScalar( material.linewidth * 2 ); - - } else if ( material instanceof THREE.LineDashedMaterial ) { - - setLineWidth( material.linewidth ); - setLineCap( material.linecap ); - setLineJoin( material.linejoin ); - setStrokeStyle( material.color.getStyle() ); - setLineDash( [ material.dashSize, material.gapSize ] ); - - _context.stroke(); - - _elemBox.expandByScalar( material.linewidth * 2 ); - - setLineDash( [] ); - - } - - } - - function renderFace3( v1, v2, v3, uv1, uv2, uv3, element, material ) { - - _this.info.render.vertices += 3; - _this.info.render.faces ++; - - setOpacity( material.opacity ); - setBlending( material.blending ); - - _v1x = v1.positionScreen.x; _v1y = v1.positionScreen.y; - _v2x = v2.positionScreen.x; _v2y = v2.positionScreen.y; - _v3x = v3.positionScreen.x; _v3y = v3.positionScreen.y; - - drawTriangle( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y ); - - if ( ( material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial ) && material.map === null ) { - - _diffuseColor.copy( material.color ); - _emissiveColor.copy( material.emissive ); - - if ( material.vertexColors === THREE.FaceColors ) { - - _diffuseColor.multiply( element.color ); - - } - - _color.copy( _ambientLight ); - - _centroid.copy( v1.positionWorld ).add( v2.positionWorld ).add( v3.positionWorld ).divideScalar( 3 ); - - calculateLight( _centroid, element.normalModel, _color ); - - _color.multiply( _diffuseColor ).add( _emissiveColor ); - - material.wireframe === true - ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) - : fillPath( _color ); - - } else if ( material instanceof THREE.MeshBasicMaterial || - material instanceof THREE.MeshLambertMaterial || - material instanceof THREE.MeshPhongMaterial ) { - - if ( material.map !== null ) { - - if ( material.map.mapping instanceof THREE.UVMapping ) { - - _uvs = element.uvs; - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uvs[ uv1 ].x, _uvs[ uv1 ].y, _uvs[ uv2 ].x, _uvs[ uv2 ].y, _uvs[ uv3 ].x, _uvs[ uv3 ].y, material.map ); - - } - - } else if ( material.envMap !== null ) { - - if ( material.envMap.mapping instanceof THREE.SphericalReflectionMapping ) { - - _normal.copy( element.vertexNormalsModel[ uv1 ] ).applyMatrix3( _normalViewMatrix ); - _uv1x = 0.5 * _normal.x + 0.5; - _uv1y = 0.5 * _normal.y + 0.5; - - _normal.copy( element.vertexNormalsModel[ uv2 ] ).applyMatrix3( _normalViewMatrix ); - _uv2x = 0.5 * _normal.x + 0.5; - _uv2y = 0.5 * _normal.y + 0.5; - - _normal.copy( element.vertexNormalsModel[ uv3 ] ).applyMatrix3( _normalViewMatrix ); - _uv3x = 0.5 * _normal.x + 0.5; - _uv3y = 0.5 * _normal.y + 0.5; - - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap ); - - } else if ( material.envMap.mapping instanceof THREE.SphericalRefractionMapping ) { - - _normal.copy( element.vertexNormalsModel[ uv1 ] ).applyMatrix3( _normalViewMatrix ); - _uv1x = - 0.5 * _normal.x + 0.5; - _uv1y = - 0.5 * _normal.y + 0.5; - - _normal.copy( element.vertexNormalsModel[ uv2 ] ).applyMatrix3( _normalViewMatrix ); - _uv2x = - 0.5 * _normal.x + 0.5; - _uv2y = - 0.5 * _normal.y + 0.5; - - _normal.copy( element.vertexNormalsModel[ uv3 ] ).applyMatrix3( _normalViewMatrix ); - _uv3x = - 0.5 * _normal.x + 0.5; - _uv3y = - 0.5 * _normal.y + 0.5; - - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap ); - - } - - - } else { - - _color.copy( material.color ); - - if ( material.vertexColors === THREE.FaceColors ) { - - _color.multiply( element.color ); - - } - - material.wireframe === true - ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) - : fillPath( _color ); - - } - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - _color.r = _color.g = _color.b = 1 - smoothstep( v1.positionScreen.z * v1.positionScreen.w, _camera.near, _camera.far ); - - material.wireframe === true - ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) - : fillPath( _color ); - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - _normal.copy( element.normalModel ).applyMatrix3( _normalViewMatrix ); - - _color.setRGB( _normal.x, _normal.y, _normal.z ).multiplyScalar( 0.5 ).addScalar( 0.5 ); - - material.wireframe === true - ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) - : fillPath( _color ); - - } else { - - _color.setRGB( 1, 1, 1 ); - - material.wireframe === true - ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) - : fillPath( _color ); - - } - - } - - // - - function drawTriangle( x0, y0, x1, y1, x2, y2 ) { - - _context.beginPath(); - _context.moveTo( x0, y0 ); - _context.lineTo( x1, y1 ); - _context.lineTo( x2, y2 ); - _context.closePath(); - - } - - function strokePath( color, linewidth, linecap, linejoin ) { - - setLineWidth( linewidth ); - setLineCap( linecap ); - setLineJoin( linejoin ); - setStrokeStyle( color.getStyle() ); - - _context.stroke(); - - _elemBox.expandByScalar( linewidth * 2 ); - - } - - function fillPath( color ) { - - setFillStyle( color.getStyle() ); - _context.fill(); - - } - - function onTextureUpdate ( event ) { - - textureToPattern( event.target ); - - } - - function textureToPattern( texture ) { - - if ( texture instanceof THREE.CompressedTexture ) return; - - var repeatX = texture.wrapS === THREE.RepeatWrapping; - var repeatY = texture.wrapT === THREE.RepeatWrapping; - - var image = texture.image; - - var canvas = document.createElement( 'canvas' ); - canvas.width = image.width; - canvas.height = image.height; - - var context = canvas.getContext( '2d' ); - context.setTransform( 1, 0, 0, - 1, 0, image.height ); - context.drawImage( image, 0, 0 ); - - _patterns[ texture.id ] = _context.createPattern( - canvas, repeatX === true && repeatY === true - ? 'repeat' - : repeatX === true && repeatY === false - ? 'repeat-x' - : repeatX === false && repeatY === true - ? 'repeat-y' - : 'no-repeat' - ); - - } - - function patternPath( x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, texture ) { - - if ( texture instanceof THREE.DataTexture ) return; - - if ( texture.hasEventListener( 'update', onTextureUpdate ) === false ) { - - if ( texture.image !== undefined && texture.image.width > 0 ) { - - textureToPattern( texture ); - - } - - texture.addEventListener( 'update', onTextureUpdate ); - - } - - var pattern = _patterns[ texture.id ]; - - if ( pattern !== undefined ) { - - setFillStyle( pattern ); - - } else { - - setFillStyle( 'rgba(0,0,0,1)' ); - _context.fill(); - - return; - - } - - // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - - var a, b, c, d, e, f, det, idet, - offsetX = texture.offset.x / texture.repeat.x, - offsetY = texture.offset.y / texture.repeat.y, - width = texture.image.width * texture.repeat.x, - height = texture.image.height * texture.repeat.y; - - u0 = ( u0 + offsetX ) * width; - v0 = ( v0 + offsetY ) * height; - - u1 = ( u1 + offsetX ) * width; - v1 = ( v1 + offsetY ) * height; - - u2 = ( u2 + offsetX ) * width; - v2 = ( v2 + offsetY ) * height; - - x1 -= x0; y1 -= y0; - x2 -= x0; y2 -= y0; - - u1 -= u0; v1 -= v0; - u2 -= u0; v2 -= v0; - - det = u1 * v2 - u2 * v1; - - if ( det === 0 ) return; - - idet = 1 / det; - - a = ( v2 * x1 - v1 * x2 ) * idet; - b = ( v2 * y1 - v1 * y2 ) * idet; - c = ( u1 * x2 - u2 * x1 ) * idet; - d = ( u1 * y2 - u2 * y1 ) * idet; - - e = x0 - a * u0 - c * v0; - f = y0 - b * u0 - d * v0; - - _context.save(); - _context.transform( a, b, c, d, e, f ); - _context.fill(); - _context.restore(); - - } - - function clipImage( x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, image ) { - - // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - - var a, b, c, d, e, f, det, idet, - width = image.width - 1, - height = image.height - 1; - - u0 *= width; v0 *= height; - u1 *= width; v1 *= height; - u2 *= width; v2 *= height; - - x1 -= x0; y1 -= y0; - x2 -= x0; y2 -= y0; - - u1 -= u0; v1 -= v0; - u2 -= u0; v2 -= v0; - - det = u1 * v2 - u2 * v1; - - idet = 1 / det; - - a = ( v2 * x1 - v1 * x2 ) * idet; - b = ( v2 * y1 - v1 * y2 ) * idet; - c = ( u1 * x2 - u2 * x1 ) * idet; - d = ( u1 * y2 - u2 * y1 ) * idet; - - e = x0 - a * u0 - c * v0; - f = y0 - b * u0 - d * v0; - - _context.save(); - _context.transform( a, b, c, d, e, f ); - _context.clip(); - _context.drawImage( image, 0, 0 ); - _context.restore(); - - } - - // Hide anti-alias gaps - - function expand( v1, v2, pixels ) { - - var x = v2.x - v1.x, y = v2.y - v1.y, - det = x * x + y * y, idet; - - if ( det === 0 ) return; - - idet = pixels / Math.sqrt( det ); - - x *= idet; y *= idet; - - v2.x += x; v2.y += y; - v1.x -= x; v1.y -= y; - - } - - // Context cached methods. - - function setOpacity( value ) { - - if ( _contextGlobalAlpha !== value ) { - - _context.globalAlpha = value; - _contextGlobalAlpha = value; - - } - - } - - function setBlending( value ) { - - if ( _contextGlobalCompositeOperation !== value ) { - - if ( value === THREE.NormalBlending ) { - - _context.globalCompositeOperation = 'source-over'; - - } else if ( value === THREE.AdditiveBlending ) { - - _context.globalCompositeOperation = 'lighter'; - - } else if ( value === THREE.SubtractiveBlending ) { - - _context.globalCompositeOperation = 'darker'; - - } - - _contextGlobalCompositeOperation = value; - - } - - } - - function setLineWidth( value ) { - - if ( _contextLineWidth !== value ) { - - _context.lineWidth = value; - _contextLineWidth = value; - - } - - } - - function setLineCap( value ) { - - // "butt", "round", "square" - - if ( _contextLineCap !== value ) { - - _context.lineCap = value; - _contextLineCap = value; - - } - - } - - function setLineJoin( value ) { - - // "round", "bevel", "miter" - - if ( _contextLineJoin !== value ) { - - _context.lineJoin = value; - _contextLineJoin = value; - - } - - } - - function setStrokeStyle( value ) { - - if ( _contextStrokeStyle !== value ) { - - _context.strokeStyle = value; - _contextStrokeStyle = value; - - } - - } - - function setFillStyle( value ) { - - if ( _contextFillStyle !== value ) { - - _context.fillStyle = value; - _contextFillStyle = value; - - } - - } - - function setLineDash( value ) { - - if ( _contextLineDash.length !== value.length ) { - - _context.setLineDash( value ); - _contextLineDash = value; - - } - - } - -}; - // File:src/renderers/shaders/ShaderChunk.js THREE.ShaderChunk = {}; @@ -17080,7 +15995,7 @@ THREE.ShaderChunk[ 'morphnormal_vertex'] = "#ifdef USE_MORPHNORMALS\n\n vec3 mor // File:src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl -THREE.ShaderChunk[ 'envmap_pars_fragment'] = "#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n uniform samplerCube envMap;\n uniform float flipEnvMap;\n uniform int combine;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n uniform bool useRefract;\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif"; +THREE.ShaderChunk[ 'envmap_pars_fragment'] = "#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n uniform samplerCube envMap;\n uniform float flipEnvMap;\n uniform int combine;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform bool useRefract;\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif"; // File:src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl @@ -17132,7 +16047,7 @@ THREE.ShaderChunk[ 'skinning_vertex'] = "#ifdef USE_SKINNING\n\n #ifdef USE_MORP // File:src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl -THREE.ShaderChunk[ 'envmap_pars_vertex'] = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n uniform bool useRefract;\n\n#endif\n"; +THREE.ShaderChunk[ 'envmap_pars_vertex'] = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n uniform bool useRefract;\n\n#endif\n"; // File:src/renderers/shaders/ShaderChunk/linear_to_gamma_fragment.glsl @@ -17152,7 +16067,7 @@ THREE.ShaderChunk[ 'map_pars_vertex'] = "#if defined( USE_MAP ) || defined( USE_ // File:src/renderers/shaders/ShaderChunk/envmap_fragment.glsl -THREE.ShaderChunk[ 'envmap_fragment'] = "#ifdef USE_ENVMAP\n\n vec3 reflectVec;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n // Transforming Normal Vectors with the Inverse Transformation\n\n vec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n if ( useRefract ) {\n\n reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n } else { \n\n reflectVec = reflect( cameraToVertex, worldNormal );\n\n }\n\n #else\n\n reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #else\n\n vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #endif\n\n #ifdef GAMMA_INPUT\n\n cubeColor.xyz *= cubeColor.xyz;\n\n #endif\n\n if ( combine == 1 ) {\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\n } else if ( combine == 2 ) {\n\n gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\n } else {\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\n }\n\n#endif"; +THREE.ShaderChunk[ 'envmap_fragment'] = "#ifdef USE_ENVMAP\n\n vec3 reflectVec;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n // Transforming Normal Vectors with the Inverse Transformation\n\n vec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n if ( useRefract ) {\n\n reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n } else { \n\n reflectVec = reflect( cameraToVertex, worldNormal );\n\n }\n\n #else\n\n reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #else\n\n vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #endif\n\n #ifdef GAMMA_INPUT\n\n cubeColor.xyz *= cubeColor.xyz;\n\n #endif\n\n if ( combine == 1 ) {\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\n } else if ( combine == 2 ) {\n\n gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\n } else {\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\n }\n\n#endif"; // File:src/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl @@ -17212,7 +16127,7 @@ THREE.ShaderChunk[ 'morphtarget_vertex'] = "#ifdef USE_MORPHTARGETS\n\n vec3 mor // File:src/renderers/shaders/ShaderChunk/envmap_vertex.glsl -THREE.ShaderChunk[ 'envmap_vertex'] = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n vec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n worldNormal = normalize( worldNormal );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n if ( useRefract ) {\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n } else {\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n }\n\n#endif"; +THREE.ShaderChunk[ 'envmap_vertex'] = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n worldNormal = normalize( worldNormal );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n if ( useRefract ) {\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n } else {\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n }\n\n#endif"; // File:src/renderers/shaders/ShaderChunk/shadowmap_fragment.glsl @@ -17252,13 +16167,13 @@ THREE.UniformsUtils = { merge: function ( uniforms ) { - var u, p, tmp, merged = {}; + var merged = {}; - for ( u = 0; u < uniforms.length; u ++ ) { + for ( var u = 0; u < uniforms.length; u ++ ) { - tmp = this.clone( uniforms[ u ] ); + var tmp = this.clone( uniforms[ u ] ); - for ( p in tmp ) { + for ( var p in tmp ) { merged[ p ] = tmp[ p ]; @@ -17272,15 +16187,15 @@ THREE.UniformsUtils = { clone: function ( uniforms_src ) { - var u, p, parameter, parameter_src, uniforms_dst = {}; + var uniforms_dst = {}; - for ( u in uniforms_src ) { + for ( var u in uniforms_src ) { uniforms_dst[ u ] = {}; - for ( p in uniforms_src[ u ] ) { + for ( var p in uniforms_src[ u ] ) { - parameter_src = uniforms_src[ u ][ p ]; + var parameter_src = uniforms_src[ u ][ p ]; if ( parameter_src instanceof THREE.Color || parameter_src instanceof THREE.Vector2 || @@ -17714,6 +16629,8 @@ THREE.ShaderLib = { fragmentShader: [ + "#define PHONG", + "uniform vec3 diffuse;", "uniform float opacity;", @@ -18778,10 +17695,18 @@ THREE.WebGLRenderer = function ( parameters ) { _clearColor = new THREE.Color( 0x000000 ), _clearAlpha = 0; - + + var lights = []; + + var _webglObjects = {}; + var _webglObjectsImmediate = []; + var opaqueObjects = []; var transparentObjects = []; + var sprites = []; + var lensFlares = []; + // public properties this.domElement = _canvas; @@ -18811,7 +17736,6 @@ THREE.WebGLRenderer = function ( parameters ) { // shadow map this.shadowMapEnabled = false; - this.shadowMapAutoUpdate = true; this.shadowMapType = THREE.PCFShadowMap; this.shadowMapCullFace = THREE.CullFaceFront; this.shadowMapDebug = false; @@ -18826,11 +17750,6 @@ THREE.WebGLRenderer = function ( parameters ) { this.autoScaleCubemaps = true; - // custom render plugins - - this.renderPluginsPre = []; - this.renderPluginsPost = []; - // info this.info = { @@ -18865,7 +17784,7 @@ THREE.WebGLRenderer = function ( parameters ) { _currentProgram = null, _currentFramebuffer = null, _currentMaterialId = - 1, - _currentGeometryGroupHash = null, + _currentGeometryGroupHash = - 1, _currentCamera = null, _usedTextureUnits = 0, @@ -18931,16 +17850,89 @@ THREE.WebGLRenderer = function ( parameters ) { var _gl; - var _glExtensionTextureFloat; - var _glExtensionTextureFloatLinear; - var _glExtensionStandardDerivatives; - var _glExtensionTextureFilterAnisotropic; - var _glExtensionCompressedTextureS3TC; - var _glExtensionElementIndexUint; - var _glExtensionFragDepth; + try { + var attributes = { + alpha: _alpha, + depth: _depth, + stencil: _stencil, + antialias: _antialias, + premultipliedAlpha: _premultipliedAlpha, + preserveDrawingBuffer: _preserveDrawingBuffer + }; - initGL(); + _gl = _context || _canvas.getContext( 'webgl', attributes ) || _canvas.getContext( 'experimental-webgl', attributes ); + + if ( _gl === null ) { + + if ( _canvas.getContext( 'webgl') !== null ) { + + throw 'Error creating WebGL context with your selected attributes.'; + + } else { + + throw 'Error creating WebGL context.'; + + } + + } + + } catch ( error ) { + + console.error( error ); + + } + + if ( _gl.getShaderPrecisionFormat === undefined ) { + + _gl.getShaderPrecisionFormat = function () { + + return { + 'rangeMin': 1, + 'rangeMax': 1, + 'precision': 1 + }; + + } + + } + + var extensions = new THREE.WebGLExtensions( _gl ); + + extensions.get( 'OES_texture_float' ); + extensions.get( 'OES_texture_float_linear' ); + extensions.get( 'OES_standard_derivatives' ); + + if ( _logarithmicDepthBuffer ) { + + extensions.get( 'EXT_frag_depth' ); + + } + + // + + function setDefaultGLState() { + + _gl.clearColor( 0, 0, 0, 1 ); + _gl.clearDepth( 1 ); + _gl.clearStencil( 0 ); + + _gl.enable( _gl.DEPTH_TEST ); + _gl.depthFunc( _gl.LEQUAL ); + + _gl.frontFace( _gl.CCW ); + _gl.cullFace( _gl.BACK ); + _gl.enable( _gl.CULL_FACE ); + + _gl.enable( _gl.BLEND ); + _gl.blendEquation( _gl.FUNC_ADD ); + _gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA ); + + _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight ); + + _gl.clearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + + } setDefaultGLState(); @@ -18953,12 +17945,8 @@ THREE.WebGLRenderer = function ( parameters ) { var _maxTextureSize = _gl.getParameter( _gl.MAX_TEXTURE_SIZE ); var _maxCubemapSize = _gl.getParameter( _gl.MAX_CUBE_MAP_TEXTURE_SIZE ); - var _maxAnisotropy = _glExtensionTextureFilterAnisotropic ? _gl.getParameter( _glExtensionTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT ) : 0; - - var _supportsVertexTextures = ( _maxVertexTextures > 0 ); - var _supportsBoneTextures = _supportsVertexTextures && _glExtensionTextureFloat; - - var _compressedTextureFormats = _glExtensionCompressedTextureS3TC ? _gl.getParameter( _gl.COMPRESSED_TEXTURE_FORMATS ) : []; + var _supportsVertexTextures = _maxVertexTextures > 0; + var _supportsBoneTextures = _supportsVertexTextures && extensions.get( 'OES_texture_float' ); // @@ -18970,6 +17958,38 @@ THREE.WebGLRenderer = function ( parameters ) { var _fragmentShaderPrecisionMediumpFloat = _gl.getShaderPrecisionFormat( _gl.FRAGMENT_SHADER, _gl.MEDIUM_FLOAT ); var _fragmentShaderPrecisionLowpFloat = _gl.getShaderPrecisionFormat( _gl.FRAGMENT_SHADER, _gl.LOW_FLOAT ); + var getCompressedTextureFormats = ( function () { + + var array; + + return function () { + + if ( array !== undefined ) { + + return array; + + } + + array = []; + + if ( extensions.get( 'WEBGL_compressed_texture_pvrtc' ) || extensions.get( 'WEBGL_compressed_texture_s3tc' ) ) { + + var formats = _gl.getParameter( _gl.COMPRESSED_TEXTURE_FORMATS ); + + for ( var i = 0; i < formats.length; i ++ ){ + + array.push( formats[ i ] ); + + } + + } + + return array; + + }; + + } )(); + // clamp precision to maximum available var highpAvailable = _vertexShaderPrecisionHighpFloat.precision > 0 && _fragmentShaderPrecisionHighpFloat.precision > 0; @@ -18998,6 +18018,13 @@ THREE.WebGLRenderer = function ( parameters ) { } + // Plugins + + var shadowMapPlugin = new THREE.ShadowMapPlugin( this, lights, _webglObjects, _webglObjectsImmediate ); + + var spritePlugin = new THREE.SpritePlugin( this, sprites ); + var lensFlarePlugin = new THREE.LensFlarePlugin( this, lensFlares ); + // API this.getContext = function () { @@ -19014,28 +18041,56 @@ THREE.WebGLRenderer = function ( parameters ) { this.supportsFloatTextures = function () { - return _glExtensionTextureFloat; + return extensions.get( 'OES_texture_float' ); }; this.supportsStandardDerivatives = function () { - return _glExtensionStandardDerivatives; + return extensions.get( 'OES_standard_derivatives' ); }; this.supportsCompressedTextureS3TC = function () { - return _glExtensionCompressedTextureS3TC; + return extensions.get( 'WEBGL_compressed_texture_s3tc' ); }; - this.getMaxAnisotropy = function () { + this.supportsCompressedTexturePVRTC = function () { - return _maxAnisotropy; + return extensions.get( 'WEBGL_compressed_texture_pvrtc' ); }; + this.supportsBlendMinMax = function () { + + return extensions.get( 'EXT_blend_minmax' ); + + }; + + this.getMaxAnisotropy = ( function () { + + var value; + + return function () { + + if ( value !== undefined ) { + + return value; + + } + + var extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + value = extension !== null ? _gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ) : 0; + + return value; + + } + + } )(); + this.getPrecision = function () { return _precision; @@ -19154,44 +18209,25 @@ THREE.WebGLRenderer = function ( parameters ) { }; - // Plugins + // Reset - this.addPostPlugin = function ( plugin ) { - - plugin.init( this ); - this.renderPluginsPost.push( plugin ); - - }; - - this.addPrePlugin = function ( plugin ) { - - plugin.init( this ); - this.renderPluginsPre.push( plugin ); - - }; - - // Rendering - - this.updateShadowMap = function ( scene, camera ) { + this.resetGLState = function () { _currentProgram = null; + _currentCamera = null; + _oldBlending = - 1; _oldDepthTest = - 1; _oldDepthWrite = - 1; - _currentGeometryGroupHash = - 1; - _currentMaterialId = - 1; - _lightsNeedUpdate = true; _oldDoubleSided = - 1; _oldFlipSided = - 1; + _currentGeometryGroupHash = - 1; + _currentMaterialId = - 1; - initObjects( scene ); - - this.shadowMapPlugin.update( scene, camera ); + _lightsNeedUpdate = true; }; - // Internal functions - // Buffer allocation function createParticleBuffers ( geometry ) { @@ -19260,6 +18296,20 @@ THREE.WebGLRenderer = function ( parameters ) { // Events + var onObjectRemoved = function ( event ) { + + var object = event.target; + + object.traverse( function ( child ) { + + child.removeEventListener( 'remove', onObjectRemoved ); + + removeObject( child ); + + } ); + + }; + var onGeometryDispose = function ( event ) { var geometry = event.target; @@ -19308,31 +18358,50 @@ THREE.WebGLRenderer = function ( parameters ) { // Buffer deallocation var deleteBuffers = function ( geometry ) { + + var buffers = [ + '__webglVertexBuffer', + '__webglNormalBuffer', + '__webglTangentBuffer', + '__webglColorBuffer', + '__webglUVBuffer', + '__webglUV2Buffer', + + '__webglSkinIndicesBuffer', + '__webglSkinWeightsBuffer', + + '__webglFaceBuffer', + '__webglLineBuffer', + + '__webglLineDistanceBuffer' + ]; - if ( geometry.__webglVertexBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglVertexBuffer ); - if ( geometry.__webglNormalBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglNormalBuffer ); - if ( geometry.__webglTangentBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglTangentBuffer ); - if ( geometry.__webglColorBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglColorBuffer ); - if ( geometry.__webglUVBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglUVBuffer ); - if ( geometry.__webglUV2Buffer !== undefined ) _gl.deleteBuffer( geometry.__webglUV2Buffer ); + for ( var i = 0, l = buffers.length; i < l; i ++ ) { - if ( geometry.__webglSkinIndicesBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglSkinIndicesBuffer ); - if ( geometry.__webglSkinWeightsBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglSkinWeightsBuffer ); + var name = buffers[ i ]; - if ( geometry.__webglFaceBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglFaceBuffer ); - if ( geometry.__webglLineBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglLineBuffer ); + if ( geometry[ name ] !== undefined ) { + + _gl.deleteBuffer( geometry[ name ] ); + + delete geometry[ name ]; + + } + + } - if ( geometry.__webglLineDistanceBuffer !== undefined ) _gl.deleteBuffer( geometry.__webglLineDistanceBuffer ); // custom attributes if ( geometry.__webglCustomAttributesList !== undefined ) { - for ( var id in geometry.__webglCustomAttributesList ) { + for ( var name in geometry.__webglCustomAttributesList ) { - _gl.deleteBuffer( geometry.__webglCustomAttributesList[ id ].buffer ); + _gl.deleteBuffer( geometry.__webglCustomAttributesList[ name ].buffer ); } + delete geometry.__webglCustomAttributesList; + } _this.info.memory.geometries --; @@ -19341,17 +18410,19 @@ THREE.WebGLRenderer = function ( parameters ) { var deallocateGeometry = function ( geometry ) { - geometry.__webglInit = undefined; + delete geometry.__webglInit; if ( geometry instanceof THREE.BufferGeometry ) { - var attributes = geometry.attributes; + for ( var name in geometry.attributes ) { + + var attribute = geometry.attributes[ name ]; - for ( var key in attributes ) { + if ( attribute.buffer !== undefined ) { - if ( attributes[ key ].buffer !== undefined ) { + _gl.deleteBuffer( attribute.buffer ); - _gl.deleteBuffer( attributes[ key ].buffer ); + delete attribute.buffer; } @@ -19361,11 +18432,13 @@ THREE.WebGLRenderer = function ( parameters ) { } else { - if ( geometry.geometryGroups !== undefined ) { + var geometryGroupsList = geometryGroups[ geometry.id ]; - for ( var i = 0,l = geometry.geometryGroupsList.length; i 1 ) { - geometryGroup.__normalArray = new Float32Array( nvertices * 3 ); + geometryGroup.__uv2Array = new Float32Array( nvertices * 2 ); } @@ -19619,28 +18709,6 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( vertexColorType ) { - - geometryGroup.__colorArray = new Float32Array( nvertices * 3 ); - - } - - if ( uvType ) { - - if ( geometry.faceVertexUvs.length > 0 ) { - - geometryGroup.__uvArray = new Float32Array( nvertices * 2 ); - - } - - if ( geometry.faceVertexUvs.length > 1 ) { - - geometryGroup.__uv2Array = new Float32Array( nvertices * 2 ); - - } - - } - if ( object.geometry.skinWeights.length && object.geometry.skinIndices.length ) { geometryGroup.__skinIndexArray = new Float32Array( nvertices * 4 ); @@ -19648,7 +18716,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - var UintArray = _glExtensionElementIndexUint !== null && ntris > 21845 ? Uint32Array : Uint16Array; // 65535 / 3 + var UintArray = extensions.get( 'OES_element_index_uint' ) !== null && ntris > 21845 ? Uint32Array : Uint16Array; // 65535 / 3 geometryGroup.__typeArray = UintArray; geometryGroup.__faceArray = new UintArray( ntris * 3 ); @@ -19694,12 +18762,12 @@ THREE.WebGLRenderer = function ( parameters ) { } - for ( var a in material.attributes ) { + for ( var name in material.attributes ) { // Do a shallow copy of the attribute object so different geometryGroup chunks use different // attribute buffers which are correctly indexed in the setMeshBuffers function - var originalAttribute = material.attributes[ a ]; + var originalAttribute = material.attributes[ name ]; var attribute = {}; @@ -19725,7 +18793,7 @@ THREE.WebGLRenderer = function ( parameters ) { attribute.array = new Float32Array( nvertices * size ); attribute.buffer = _gl.createBuffer(); - attribute.buffer.belongsToAttribute = a; + attribute.buffer.belongsToAttribute = name; originalAttribute.needsUpdate = true; attribute.__original = originalAttribute; @@ -19756,78 +18824,6 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function bufferGuessNormalType ( material ) { - - // only MeshBasicMaterial and MeshDepthMaterial don't need normals - - if ( ( material instanceof THREE.MeshBasicMaterial && ! material.envMap ) || material instanceof THREE.MeshDepthMaterial ) { - - return false; - - } - - if ( materialNeedsSmoothNormals( material ) ) { - - return THREE.SmoothShading; - - } else { - - return THREE.FlatShading; - - } - - }; - - function bufferGuessVertexColorType( material ) { - - if ( material.vertexColors ) { - - return material.vertexColors; - - } - - return false; - - }; - - function bufferGuessUVType( material ) { - - // material must use some texture to require uvs - - if ( material.map || - material.lightMap || - material.bumpMap || - material.normalMap || - material.specularMap || - material.alphaMap || - material instanceof THREE.ShaderMaterial ) { - - return true; - - } - - return false; - - }; - - // - - function initDirectBuffers( geometry ) { - - for ( var name in geometry.attributes ) { - - var bufferType = ( name === 'index' ) ? _gl.ELEMENT_ARRAY_BUFFER : _gl.ARRAY_BUFFER; - - var attribute = geometry.attributes[ name ]; - attribute.buffer = _gl.createBuffer(); - - _gl.bindBuffer( bufferType, attribute.buffer ); - _gl.bufferData( bufferType, attribute.array, _gl.STATIC_DRAW ); - - } - - } - // Buffer setting function setParticleBuffers ( geometry, hint, object ) { @@ -20331,11 +19327,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - var normalType = bufferGuessNormalType( material ), - vertexColorType = bufferGuessVertexColorType( material ), - uvType = bufferGuessUVType( material ), - - needsSmoothNormals = ( normalType === THREE.SmoothShading ); + var needsSmoothNormals = materialNeedsSmoothNormals( material ); var f, fl, fi, face, vertexNormals, faceNormal, normal, @@ -20596,7 +19588,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( dirtyColors && vertexColorType ) { + if ( dirtyColors ) { for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { @@ -20605,7 +19597,7 @@ THREE.WebGLRenderer = function ( parameters ) { vertexColors = face.vertexColors; faceColor = face.color; - if ( vertexColors.length === 3 && vertexColorType === THREE.VertexColors ) { + if ( vertexColors.length === 3 && material.vertexColors === THREE.VertexColors ) { c1 = vertexColors[ 0 ]; c2 = vertexColors[ 1 ]; @@ -20680,7 +19672,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( dirtyNormals && normalType ) { + if ( dirtyNormals ) { for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { @@ -20724,7 +19716,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( dirtyUvs && obj_uvs && uvType ) { + if ( dirtyUvs && obj_uvs ) { for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { @@ -20756,7 +19748,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( dirtyUvs && obj_uvs2 && uvType ) { + if ( dirtyUvs && obj_uvs2 ) { for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { @@ -21126,31 +20118,31 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function setDirectBuffers( geometry, hint ) { + function setDirectBuffers( geometry ) { var attributes = geometry.attributes; + var attributesKeys = geometry.attributesKeys; - var attributeName, attributeItem; + for ( var i = 0, l = attributesKeys.length; i < l; i ++ ) { - for ( attributeName in attributes ) { + var key = attributesKeys[ i ]; + var attribute = attributes[ key ]; - attributeItem = attributes[ attributeName ]; + if ( attribute.buffer === undefined ) { - if ( attributeItem.needsUpdate ) { + attribute.buffer = _gl.createBuffer(); + attribute.needsUpdate = true; - if ( attributeName === 'index' ) { + } - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, attributeItem.buffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, attributeItem.array, hint ); + if ( attribute.needsUpdate === true ) { - } else { + var bufferType = ( key === 'index' ) ? _gl.ELEMENT_ARRAY_BUFFER : _gl.ARRAY_BUFFER; - _gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, attributeItem.array, hint ); + _gl.bindBuffer( bufferType, attribute.buffer ); + _gl.bufferData( bufferType, attribute.array, _gl.STATIC_DRAW ); - } - - attributeItem.needsUpdate = false; + attribute.needsUpdate = false; } @@ -21257,32 +20249,41 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function setupVertexAttributes( material, programAttributes, geometryAttributes, startIndex ) { + function setupVertexAttributes( material, program, geometry, startIndex ) { - for ( var attributeName in programAttributes ) { + var geometryAttributes = geometry.attributes; - var attributePointer = programAttributes[ attributeName ]; - var attributeItem = geometryAttributes[ attributeName ]; + var programAttributes = program.attributes; + var programAttributesKeys = program.attributesKeys; - if ( attributePointer >= 0 ) { + for ( var i = 0, l = programAttributesKeys.length; i < l; i ++ ) { - if ( attributeItem ) { + var key = programAttributesKeys[ i ]; + var programAttribute = programAttributes[ key ]; - var attributeSize = attributeItem.itemSize; + if ( programAttribute >= 0 ) { - _gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer ); - enableAttribute( attributePointer ); - _gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32 + var geometryAttribute = geometryAttributes[ key ]; - } else if ( material.defaultAttributeValues ) { + if ( geometryAttribute !== undefined ) { - if ( material.defaultAttributeValues[ attributeName ].length === 2 ) { + var size = geometryAttribute.itemSize; - _gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] ); + _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryAttribute.buffer ); - } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) { + enableAttribute( programAttribute ); - _gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] ); + _gl.vertexAttribPointer( programAttribute, size, _gl.FLOAT, false, 0, startIndex * size * 4 ); // 4 bytes per Float32 + + } else if ( material.defaultAttributeValues !== undefined ) { + + if ( material.defaultAttributeValues[ key ].length === 2 ) { + + _gl.vertexAttrib2fv( programAttribute, material.defaultAttributeValues[ key ] ); + + } else if ( material.defaultAttributeValues[ key ].length === 3 ) { + + _gl.vertexAttrib3fv( programAttribute, material.defaultAttributeValues[ key ] ); } @@ -21300,14 +20301,8 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.visible === false ) return; - var linewidth, a, attribute; - var attributeItem, attributeName, attributePointer, attributeSize; - var program = setProgram( camera, lights, fog, material, object ); - var programAttributes = program.attributes; - var geometryAttributes = geometry.attributes; - var updateBuffers = false, wireframeBit = material.wireframe ? 1 : 0, geometryHash = ( geometry.id * 0xffffff ) + ( program.id * 2 ) + wireframeBit; @@ -21329,7 +20324,9 @@ THREE.WebGLRenderer = function ( parameters ) { if ( object instanceof THREE.Mesh ) { - var index = geometryAttributes[ 'index' ]; + var mode = material.wireframe === true ? _gl.LINES : _gl.TRIANGLES; + + var index = geometry.attributes.index; if ( index ) { @@ -21337,7 +20334,7 @@ THREE.WebGLRenderer = function ( parameters ) { var type, size; - if ( index.array instanceof Uint32Array ) { + if ( index.array instanceof Uint32Array && extensions.get( 'OES_element_index_uint' ) ) { type = _gl.UNSIGNED_INT; size = 4; @@ -21355,12 +20352,12 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, 0 ); + setupVertexAttributes( material, program, geometry, 0 ); _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer ); } - _gl.drawElements( _gl.TRIANGLES, index.array.length, type, 0 ); + _gl.drawElements( mode, index.array.length, type, 0 ); _this.info.render.calls ++; _this.info.render.vertices += index.array.length; // not really true, here vertices can be shared @@ -21380,14 +20377,14 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, startIndex ); + setupVertexAttributes( material, program, geometry, startIndex ); _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer ); } // render indexed triangles - _gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, type, offsets[ i ].start * size ); + _gl.drawElements( mode, offsets[ i ].count, type, offsets[ i ].start * size ); _this.info.render.calls ++; _this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared @@ -21403,7 +20400,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, 0 ); + setupVertexAttributes( material, program, geometry, 0 ); } @@ -21411,7 +20408,7 @@ THREE.WebGLRenderer = function ( parameters ) { // render non-indexed triangles - _gl.drawArrays( _gl.TRIANGLES, 0, position.array.length / 3 ); + _gl.drawArrays( mode, 0, position.array.length / 3 ); _this.info.render.calls ++; _this.info.render.vertices += position.array.length / 3; @@ -21425,11 +20422,11 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, 0 ); + setupVertexAttributes( material, program, geometry, 0 ); } - var position = geometryAttributes[ 'position' ]; + var position = geometry.attributes.position; // render particles @@ -21440,11 +20437,11 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.Line ) { - var mode = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; + var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; setLineWidth( material.linewidth ); - var index = geometryAttributes[ 'index' ]; + var index = geometry.attributes.index; if ( index ) { @@ -21470,7 +20467,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, 0 ); + setupVertexAttributes( material, program, geometry, 0 ); _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer ); } @@ -21494,7 +20491,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, startIndex ); + setupVertexAttributes( material, program, geometry, startIndex ); _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer ); } @@ -21516,11 +20513,11 @@ THREE.WebGLRenderer = function ( parameters ) { if ( updateBuffers ) { - setupVertexAttributes( material, programAttributes, geometryAttributes, 0 ); + setupVertexAttributes( material, program, geometry, 0 ); } - var position = geometryAttributes[ 'position' ]; + var position = geometry.attributes.position; _gl.drawArrays( mode, 0, position.array.length / 3 ); @@ -21537,8 +20534,6 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.visible === false ) return; - var linewidth, a, attribute, i, il; - var program = setProgram( camera, lights, fog, material, object ); var attributes = program.attributes; @@ -21591,9 +20586,9 @@ THREE.WebGLRenderer = function ( parameters ) { if ( geometryGroup.__webglCustomAttributesList ) { - for ( i = 0, il = geometryGroup.__webglCustomAttributesList.length; i < il; i ++ ) { + for ( var i = 0, il = geometryGroup.__webglCustomAttributesList.length; i < il; i ++ ) { - attribute = geometryGroup.__webglCustomAttributesList[ i ]; + var attribute = geometryGroup.__webglCustomAttributesList[ i ]; if ( attributes[ attribute.buffer.belongsToAttribute ] >= 0 ) { @@ -21618,7 +20613,7 @@ THREE.WebGLRenderer = function ( parameters ) { enableAttribute( attributes.color ); _gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 ); - } else if ( material.defaultAttributeValues ) { + } else if ( material.defaultAttributeValues !== undefined ) { _gl.vertexAttrib3fv( attributes.color, material.defaultAttributeValues.color ); @@ -21657,7 +20652,7 @@ THREE.WebGLRenderer = function ( parameters ) { enableAttribute( attributes.uv ); _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 ); - } else if ( material.defaultAttributeValues ) { + } else if ( material.defaultAttributeValues !== undefined ) { _gl.vertexAttrib2fv( attributes.uv, material.defaultAttributeValues.uv ); @@ -21674,7 +20669,7 @@ THREE.WebGLRenderer = function ( parameters ) { enableAttribute( attributes.uv2 ); _gl.vertexAttribPointer( attributes.uv2, 2, _gl.FLOAT, false, 0, 0 ); - } else if ( material.defaultAttributeValues ) { + } else if ( material.defaultAttributeValues !== undefined ) { _gl.vertexAttrib2fv( attributes.uv2, material.defaultAttributeValues.uv2 ); @@ -21741,7 +20736,7 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.Line ) { - var mode = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; + var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; setLineWidth( material.linewidth ); @@ -21943,13 +20938,17 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } // Sorting function painterSortStable ( a, b ) { - if ( a.z !== b.z ) { + if ( a.material.id !== b.material.id ) { + + return b.material.id - a.material.id; + + } else if ( a.z !== b.z ) { return b.z - a.z; @@ -21959,7 +20958,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function reversePainterSortStable ( a, b ) { @@ -21973,14 +20972,13 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function numericalSort ( a, b ) { return b[ 0 ] - a[ 0 ]; - }; - + } // Rendering @@ -21993,16 +20991,11 @@ THREE.WebGLRenderer = function ( parameters ) { } - var i, il, - - webglObject, object, - renderList, - - lights = scene.__lights, - fog = scene.fog; + var fog = scene.fog; // reset caching for this frame + _currentGeometryGroupHash = - 1; _currentMaterialId = - 1; _currentCamera = null; _lightsNeedUpdate = true; @@ -22016,7 +21009,8 @@ THREE.WebGLRenderer = function ( parameters ) { if ( camera.parent === undefined ) camera.updateMatrixWorld(); // update Skeleton objects - function updateSkeletons( object ) { + + scene.traverse( function ( object ) { if ( object instanceof THREE.SkinnedMesh ) { @@ -22024,27 +21018,21 @@ THREE.WebGLRenderer = function ( parameters ) { } - for ( var i = 0, l = object.children.length; i < l; i ++ ) { - - updateSkeletons( object.children[ i ] ); - - } - - } - - updateSkeletons( scene ); + } ); camera.matrixWorldInverse.getInverse( camera.matrixWorld ); _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); _frustum.setFromMatrix( _projScreenMatrix ); - initObjects( scene ); - + lights.length = 0; opaqueObjects.length = 0; transparentObjects.length = 0; - - projectObject( scene, scene, camera ); + + sprites.length = 0; + lensFlares.length = 0; + + projectObject( scene, scene ); if ( _this.sortObjects === true ) { @@ -22054,8 +21042,8 @@ THREE.WebGLRenderer = function ( parameters ) { } // custom render plugins (pre pass) - - renderPlugins( this.renderPluginsPre, scene, camera ); + + shadowMapPlugin.render( scene, camera ); // @@ -22072,19 +21060,12 @@ THREE.WebGLRenderer = function ( parameters ) { } - // set matrices for regular objects (frustum culled) - - - - // set matrices for immediate objects - renderList = scene.__webglObjectsImmediate; + for ( var i = 0, il = _webglObjectsImmediate.length; i < il; i ++ ) { - for ( i = 0, il = renderList.length; i < il; i ++ ) { - - webglObject = renderList[ i ]; - object = webglObject.object; + var webglObject = _webglObjectsImmediate[ i ]; + var object = webglObject.object; if ( object.visible ) { @@ -22107,7 +21088,7 @@ THREE.WebGLRenderer = function ( parameters ) { renderObjects( opaqueObjects, camera, lights, fog, true, material ); renderObjects( transparentObjects, camera, lights, fog, true, material ); - renderObjectsImmediate( scene.__webglObjectsImmediate, '', camera, lights, fog, false, material ); + renderObjectsImmediate( _webglObjectsImmediate, '', camera, lights, fog, false, material ); } else { @@ -22118,19 +21099,19 @@ THREE.WebGLRenderer = function ( parameters ) { this.setBlending( THREE.NoBlending ); renderObjects( opaqueObjects, camera, lights, fog, false, material ); - renderObjectsImmediate( scene.__webglObjectsImmediate, 'opaque', camera, lights, fog, false, material ); + renderObjectsImmediate( _webglObjectsImmediate, 'opaque', camera, lights, fog, false, material ); // transparent pass (back-to-front order) renderObjects( transparentObjects, camera, lights, fog, true, material ); - renderObjectsImmediate( scene.__webglObjectsImmediate, 'transparent', camera, lights, fog, true, material ); + renderObjectsImmediate( _webglObjectsImmediate, 'transparent', camera, lights, fog, true, material ); } // custom render plugins (post pass) - renderPlugins( this.renderPluginsPost, scene, camera ); - + spritePlugin.render( scene, camera ); + lensFlarePlugin.render( scene, camera, _currentWidth, _currentHeight ); // Generate mipmap if we're using any kind of mipmap filtering @@ -22148,37 +21129,63 @@ THREE.WebGLRenderer = function ( parameters ) { // _gl.finish(); }; - - function projectObject(scene, object,camera){ - + + function projectObject( scene, object ) { + if ( object.visible === false ) return; - - var webglObjects = scene.__webglObjects[ object.id ]; - - if ( webglObjects && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) { - - updateObject( scene, object ); - - for ( var i = 0, l = webglObjects.length; i < l; i ++ ) { - - var webglObject = webglObjects[i]; - - unrollBufferMaterial( webglObject ); - webglObject.render = true; + if ( object instanceof THREE.Scene || object instanceof THREE.Group ) { - if ( _this.sortObjects === true ) { + // skip - if ( object.renderDepth !== null ) { + } else { - webglObject.z = object.renderDepth; + initObject( object, scene ); - } else { + if ( object instanceof THREE.Light ) { - _vector3.setFromMatrixPosition( object.matrixWorld ); - _vector3.applyProjection( _projScreenMatrix ); + lights.push( object ); - webglObject.z = _vector3.z; + } else if ( object instanceof THREE.Sprite ) { + + sprites.push( object ); + + } else if ( object instanceof THREE.LensFlare ) { + + lensFlares.push( object ); + + } else { + + var webglObjects = _webglObjects[ object.id ]; + + if ( webglObjects && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) { + + updateObject( object, scene ); + + for ( var i = 0, l = webglObjects.length; i < l; i ++ ) { + + var webglObject = webglObjects[i]; + + unrollBufferMaterial( webglObject ); + + webglObject.render = true; + + if ( _this.sortObjects === true ) { + + if ( object.renderDepth !== null ) { + + webglObject.z = object.renderDepth; + + } else { + + _vector3.setFromMatrixPosition( object.matrixWorld ); + _vector3.applyProjection( _projScreenMatrix ); + + webglObject.z = _vector3.z; + + } + + } } @@ -22187,68 +21194,26 @@ THREE.WebGLRenderer = function ( parameters ) { } } - + for ( var i = 0, l = object.children.length; i < l; i ++ ) { - projectObject( scene, object.children[ i ], camera ); + projectObject( scene, object.children[ i ] ); } - + } - function renderPlugins( plugins, scene, camera ) { - - if ( plugins.length === 0 ) return; - - for ( var i = 0, il = plugins.length; i < il; i ++ ) { - - // reset state for plugin (to start from clean slate) - - _currentProgram = null; - _currentCamera = null; - - _oldBlending = - 1; - _oldDepthTest = - 1; - _oldDepthWrite = - 1; - _oldDoubleSided = - 1; - _oldFlipSided = - 1; - _currentGeometryGroupHash = - 1; - _currentMaterialId = - 1; - - _lightsNeedUpdate = true; - - plugins[ i ].render( scene, camera, _currentWidth, _currentHeight ); - - // reset state after plugin (anything could have changed) - - _currentProgram = null; - _currentCamera = null; - - _oldBlending = - 1; - _oldDepthTest = - 1; - _oldDepthWrite = - 1; - _oldDoubleSided = - 1; - _oldFlipSided = - 1; - _currentGeometryGroupHash = - 1; - _currentMaterialId = - 1; - - _lightsNeedUpdate = true; - - } - - }; - function renderObjects( renderList, camera, lights, fog, useBlending, overrideMaterial ) { - var webglObject, object, buffer, material; + var material; for ( var i = renderList.length - 1; i !== - 1; i -- ) { - webglObject = renderList[ i ]; + var webglObject = renderList[ i ]; + + var object = webglObject.object; + var buffer = webglObject.buffer; - object = webglObject.object; - buffer = webglObject.buffer; - setupMatrices( object, camera ); if ( overrideMaterial ) { @@ -22283,16 +21248,16 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function renderObjectsImmediate ( renderList, materialType, camera, lights, fog, useBlending, overrideMaterial ) { - var webglObject, object, material, program; + var material; for ( var i = 0, il = renderList.length; i < il; i ++ ) { - webglObject = renderList[ i ]; - object = webglObject.object; + var webglObject = renderList[ i ]; + var object = webglObject.object; if ( object.visible ) { @@ -22320,7 +21285,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } this.renderImmediateObject = function ( camera, lights, fog, material, object ) { @@ -22359,7 +21324,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function unrollBufferMaterial ( globject ) { @@ -22375,84 +21340,50 @@ THREE.WebGLRenderer = function ( parameters ) { material = material.materials[ materialIndex ]; + globject.material = material; + if ( material.transparent ) { - globject.material = material; transparentObjects.push( globject ); } else { - globject.material = material; opaqueObjects.push( globject ); } - } else { + } else if ( material ) { - if ( material ) { + globject.material = material; - if ( material.transparent ) { + if ( material.transparent ) { - globject.material = material; - transparentObjects.push( globject ); + transparentObjects.push( globject ); - } else { + } else { - globject.material = material; - opaqueObjects.push( globject ); - - } + opaqueObjects.push( globject ); } } - }; + } - // Objects refresh - - var initObjects = function ( scene ) { - - if ( ! scene.__webglObjects ) { - - scene.__webglObjects = {}; - scene.__webglObjectsImmediate = []; - - } - - while ( scene.__objectsAdded.length ) { - - addObject( scene.__objectsAdded[ 0 ], scene ); - scene.__objectsAdded.splice( 0, 1 ); - - } - - while ( scene.__objectsRemoved.length ) { - - removeObject( scene.__objectsRemoved[ 0 ], scene ); - scene.__objectsRemoved.splice( 0, 1 ); - - } - - }; - - // Objects adding - - function addObject( object, scene ) { - - var g, geometry, geometryGroup; + function initObject( object, scene ) { if ( object.__webglInit === undefined ) { object.__webglInit = true; - object._modelViewMatrix = new THREE.Matrix4(); object._normalMatrix = new THREE.Matrix3(); + object.addEventListener( 'removed', onObjectRemoved ); + } - - geometry = object.geometry; - + + var geometry = object.geometry; + if ( geometry === undefined ) { // ImmediateRenderObject @@ -22464,21 +21395,15 @@ THREE.WebGLRenderer = function ( parameters ) { if ( geometry instanceof THREE.BufferGeometry ) { - initDirectBuffers( geometry ); + // } else if ( object instanceof THREE.Mesh ) { - - if ( object.__webglActive !== undefined ) { - removeObject( object, scene ); - - } - - initGeometryGroups(scene, object, geometry); + initGeometryGroups( scene, object, geometry ); } else if ( object instanceof THREE.Line ) { - if ( ! geometry.__webglVertexBuffer ) { + if ( geometry.__webglVertexBuffer === undefined ) { createLineBuffers( geometry ); initLineBuffers( geometry, object ); @@ -22491,7 +21416,7 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.PointCloud ) { - if ( ! geometry.__webglVertexBuffer ) { + if ( geometry.__webglVertexBuffer === undefined ) { createParticleBuffers( geometry ); initParticleBuffers( geometry, object ); @@ -22507,64 +21432,144 @@ THREE.WebGLRenderer = function ( parameters ) { if ( object.__webglActive === undefined) { - if ( object instanceof THREE.Mesh ) { + object.__webglActive = true; - geometry = object.geometry; + if ( object instanceof THREE.Mesh ) { if ( geometry instanceof THREE.BufferGeometry ) { - addBuffer( scene.__webglObjects, geometry, object ); + addBuffer( _webglObjects, geometry, object ); } else if ( geometry instanceof THREE.Geometry ) { - for ( var i = 0,l = geometry.geometryGroupsList.length; i maxVerticesInGroup ) { + + hash_map[ materialIndex ].counter += 1; + groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter; + + if ( ! ( groupHash in groups ) ) { + + group = { + id: geometryGroupCounter ++, + faces3: [], + materialIndex: materialIndex, + vertices: 0, + numMorphTargets: numMorphTargets, + numMorphNormals: numMorphNormals + }; + + groups[ groupHash ] = group; + groupsList.push( group ); + + } + + } + + groups[ groupHash ].faces3.push( f ); + groups[ groupHash ].vertices += 3; } - }; - - function initGeometryGroups( scene, object, geometry ) { - - var g, geometryGroup, material,addBuffers = false; - material = object.material; + return groupsList; + + } + + function initGeometryGroups( scene, object, geometry ) { + + var material = object.material, addBuffers = false; + + if ( geometryGroups[ geometry.id ] === undefined || geometry.groupsNeedUpdate === true ) { + + delete _webglObjects[ object.id ]; + + geometryGroups[ geometry.id ] = makeGroups( geometry, material instanceof THREE.MeshFaceMaterial ); - if ( geometry.geometryGroups === undefined || geometry.groupsNeedUpdate ) { - - delete scene.__webglObjects[object.id]; - geometry.makeGroups( material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 ); geometry.groupsNeedUpdate = false; } + var geometryGroupsList = geometryGroups[ geometry.id ]; + // create separate VBOs per geometry chunk - for ( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { + for ( var i = 0, il = geometryGroupsList.length; i < il; i ++ ) { - geometryGroup = geometry.geometryGroupsList[ i ]; + var geometryGroup = geometryGroupsList[ i ]; // initialise VBO on the first access - if ( ! geometryGroup.__webglVertexBuffer ) { + if ( geometryGroup.__webglVertexBuffer === undefined ) { createMeshBuffers( geometryGroup ); initMeshBuffers( geometryGroup, object ); @@ -22576,17 +21581,19 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.normalsNeedUpdate = true; geometry.tangentsNeedUpdate = true; geometry.colorsNeedUpdate = true; - + addBuffers = true; - + } else { - + addBuffers = false; - + } - + if ( addBuffers || object.__webglActive === undefined ) { - addBuffer( scene.__webglObjects, geometryGroup, object ); + + addBuffer( _webglObjects, geometryGroup, object ); + } } @@ -22594,7 +21601,7 @@ THREE.WebGLRenderer = function ( parameters ) { object.__webglActive = true; } - + function addBuffer( objlist, buffer, object ) { var id = object.id; @@ -22627,39 +21634,33 @@ THREE.WebGLRenderer = function ( parameters ) { // Objects updates - function updateObject(scene, object ) { + function updateObject( object, scene ) { - var geometry = object.geometry, - geometryGroup, customAttributesDirty, material; + var geometry = object.geometry, customAttributesDirty, material; if ( geometry instanceof THREE.BufferGeometry ) { - setDirectBuffers( geometry, _gl.DYNAMIC_DRAW ); + setDirectBuffers( geometry ); } else if ( object instanceof THREE.Mesh ) { // check all geometry groups - if ( geometry.buffersNeedUpdate || geometry.groupsNeedUpdate ) { - - if ( geometry instanceof THREE.BufferGeometry ) { - initDirectBuffers( geometry ); + if ( geometry.groupsNeedUpdate === true ) { + + initGeometryGroups( scene, object, geometry ); - } else if ( object instanceof THREE.Mesh ) { - - initGeometryGroups(scene, object,geometry); - - } - } - for ( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { + var geometryGroupsList = geometryGroups[ geometry.id ]; - geometryGroup = geometry.geometryGroupsList[ i ]; + for ( var i = 0, il = geometryGroupsList.length; i < il; i ++ ) { + + var geometryGroup = geometryGroupsList[ i ]; material = getBufferMaterial( object, geometryGroup ); - if ( geometry.buffersNeedUpdate || geometry.groupsNeedUpdate) { + if ( geometry.groupsNeedUpdate === true ) { initMeshBuffers( geometryGroup, object ); @@ -22685,8 +21686,6 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.colorsNeedUpdate = false; geometry.tangentsNeedUpdate = false; - geometry.buffersNeedUpdate = false; - material.attributes && clearCustomAttributes( material ); } else if ( object instanceof THREE.Line ) { @@ -22727,59 +21726,55 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } // Objects updates - custom attributes check function areCustomAttributesDirty( material ) { - for ( var a in material.attributes ) { + for ( var name in material.attributes ) { - if ( material.attributes[ a ].needsUpdate ) return true; + if ( material.attributes[ name ].needsUpdate ) return true; } return false; - }; + } function clearCustomAttributes( material ) { - for ( var a in material.attributes ) { + for ( var name in material.attributes ) { - material.attributes[ a ].needsUpdate = false; + material.attributes[ name ].needsUpdate = false; } - }; + } // Objects removal - function removeObject( object, scene ) { + function removeObject( object ) { if ( object instanceof THREE.Mesh || object instanceof THREE.PointCloud || object instanceof THREE.Line ) { - removeInstancesWebglObjects( scene.__webglObjects, object ); + delete _webglObjects[ object.id ]; } else if ( object instanceof THREE.ImmediateRenderObject || object.immediateRenderCallback ) { - removeInstances( scene.__webglObjectsImmediate, object ); + removeInstances( _webglObjectsImmediate, object ); } + delete object.__webglInit; + delete object._modelViewMatrix; + delete object._normalMatrix; + delete object.__webglActive; - }; - - - - function removeInstancesWebglObjects( objlist, object ) { - - delete objlist[ object.id ]; - - }; + } function removeInstances( objlist, object ) { @@ -22793,15 +21788,15 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } // Materials - this.initMaterial = function ( material, lights, fog, object ) { + function initMaterial( material, lights, fog, object ) { material.addEventListener( 'dispose', onMaterialDispose ); - var u, a, identifiers, i, parameters, maxLightCount, maxBones, maxShadows, shaderID; + var shaderID; if ( material instanceof THREE.MeshDepthMaterial ) { @@ -22860,13 +21855,11 @@ THREE.WebGLRenderer = function ( parameters ) { // heuristics to create shader parameters according to lights in the scene // (not to blow over maxLights budget) - maxLightCount = allocateLights( lights ); + var maxLightCount = allocateLights( lights ); + var maxShadows = allocateShadows( lights ); + var maxBones = allocateBones( object ); - maxShadows = allocateShadows( lights ); - - maxBones = allocateBones( object ); - - parameters = { + var parameters = { precision: _precision, supportsVertexTextures: _supportsVertexTextures, @@ -22894,8 +21887,8 @@ THREE.WebGLRenderer = function ( parameters ) { morphTargets: material.morphTargets, morphNormals: material.morphNormals, - maxMorphTargets: this.maxMorphTargets, - maxMorphNormals: this.maxMorphNormals, + maxMorphTargets: _this.maxMorphTargets, + maxMorphNormals: _this.maxMorphNormals, maxDirLights: maxLightCount.directional, maxPointLights: maxLightCount.point, @@ -22903,10 +21896,10 @@ THREE.WebGLRenderer = function ( parameters ) { maxHemiLights: maxLightCount.hemi, maxShadows: maxShadows, - shadowMapEnabled: this.shadowMapEnabled && object.receiveShadow && maxShadows > 0, - shadowMapType: this.shadowMapType, - shadowMapDebug: this.shadowMapDebug, - shadowMapCascade: this.shadowMapCascade, + shadowMapEnabled: _this.shadowMapEnabled && object.receiveShadow && maxShadows > 0, + shadowMapType: _this.shadowMapType, + shadowMapDebug: _this.shadowMapDebug, + shadowMapCascade: _this.shadowMapCascade, alphaTest: material.alphaTest, metal: material.metal, @@ -22931,17 +21924,21 @@ THREE.WebGLRenderer = function ( parameters ) { } - for ( var d in material.defines ) { + if ( material.defines !== undefined ) { - chunks.push( d ); - chunks.push( material.defines[ d ] ); + for ( var name in material.defines ) { + + chunks.push( name ); + chunks.push( material.defines[ name ] ); + + } } - for ( var p in parameters ) { + for ( var name in parameters ) { - chunks.push( p ); - chunks.push( parameters[ p ] ); + chunks.push( name ); + chunks.push( parameters[ name ] ); } @@ -22968,7 +21965,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( program === undefined ) { - program = new THREE.WebGLProgram( this, code, material, parameters ); + program = new THREE.WebGLProgram( _this, code, material, parameters ); _programs.push( program ); _this.info.memory.programs = _programs.length; @@ -22977,7 +21974,7 @@ THREE.WebGLRenderer = function ( parameters ) { material.program = program; - var attributes = material.program.attributes; + var attributes = program.attributes; if ( material.morphTargets ) { @@ -22985,7 +21982,7 @@ THREE.WebGLRenderer = function ( parameters ) { var id, base = 'morphTarget'; - for ( i = 0; i < this.maxMorphTargets; i ++ ) { + for ( var i = 0; i < _this.maxMorphTargets; i ++ ) { id = base + i; @@ -23005,7 +22002,7 @@ THREE.WebGLRenderer = function ( parameters ) { var id, base = 'morphNormal'; - for ( i = 0; i < this.maxMorphNormals; i ++ ) { + for ( i = 0; i < _this.maxMorphNormals; i ++ ) { id = base + i; @@ -23021,7 +22018,7 @@ THREE.WebGLRenderer = function ( parameters ) { material.uniformsList = []; - for ( u in material.__webglShader.uniforms ) { + for ( var u in material.__webglShader.uniforms ) { var location = material.program.uniforms[ u ]; @@ -23031,7 +22028,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function setProgram( camera, lights, fog, material, object ) { @@ -23041,7 +22038,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.program ) deallocateMaterial( material ); - _this.initMaterial( material, lights, fog, object ); + initMaterial( material, lights, fog, object ); material.needsUpdate = false; } @@ -23276,7 +22273,7 @@ THREE.WebGLRenderer = function ( parameters ) { return program; - }; + } // Uniforms (refresh uniforms objects) @@ -23371,14 +22368,14 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.combine.value = material.combine; uniforms.useRefract.value = material.envMap && material.envMap.mapping instanceof THREE.CubeRefractionMapping; - }; + } function refreshUniformsLine ( uniforms, material ) { uniforms.diffuse.value = material.color; uniforms.opacity.value = material.opacity; - }; + } function refreshUniformsDash ( uniforms, material ) { @@ -23386,7 +22383,7 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.totalSize.value = material.dashSize + material.gapSize; uniforms.scale.value = material.scale; - }; + } function refreshUniformsParticle ( uniforms, material ) { @@ -23397,7 +22394,7 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.map.value = material.map; - }; + } function refreshUniformsFog ( uniforms, fog ) { @@ -23414,7 +22411,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function refreshUniformsPhong ( uniforms, material ) { @@ -23440,7 +22437,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function refreshUniformsLambert ( uniforms, material ) { @@ -23462,7 +22459,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function refreshUniformsLights ( uniforms, lights ) { @@ -23486,7 +22483,7 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.hemisphereLightGroundColor.value = lights.hemi.groundColors; uniforms.hemisphereLightDirection.value = lights.hemi.positions; - }; + } // If uniforms are marked as clean, they don't need to be loaded to the GPU. @@ -23512,7 +22509,7 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.hemisphereLightGroundColor.needsUpdate = boolean; uniforms.hemisphereLightDirection.needsUpdate = boolean; - }; + } function refreshUniformsShadow ( uniforms, lights ) { @@ -23544,7 +22541,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } // Uniforms (load to GPU) @@ -23558,7 +22555,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function getTextureUnit() { @@ -23574,7 +22571,7 @@ THREE.WebGLRenderer = function ( parameters ) { return textureUnit; - }; + } function loadUniformsGeneric ( uniforms ) { @@ -23647,7 +22644,7 @@ THREE.WebGLRenderer = function ( parameters ) { // - case 'i': + case 'i': // single integer _gl.uniform1i( location, value ); @@ -23675,7 +22672,7 @@ THREE.WebGLRenderer = function ( parameters ) { break; - case 'v4': + case 'v4': // single THREE.Vector4 _gl.uniform4f( location, value.x, value.y, value.z, value.w ); @@ -23910,14 +22907,14 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function setupMatrices ( object, camera ) { object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); object._normalMatrix.getNormalMatrix( object._modelViewMatrix ); - }; + } // @@ -23927,7 +22924,7 @@ THREE.WebGLRenderer = function ( parameters ) { array[ offset + 1 ] = color.g * color.g * intensitySq; array[ offset + 2 ] = color.b * color.b * intensitySq; - }; + } function setColorLinear( array, offset, color, intensity ) { @@ -23935,7 +22932,7 @@ THREE.WebGLRenderer = function ( parameters ) { array[ offset + 1 ] = color.g * intensity; array[ offset + 2 ] = color.b * intensity; - }; + } function setupLights ( lights ) { @@ -24084,15 +23081,14 @@ THREE.WebGLRenderer = function ( parameters ) { } - _vector3.setFromMatrixPosition( light.matrixWorld ); + _direction.setFromMatrixPosition( light.matrixWorld ); - spotPositions[ spotOffset ] = _vector3.x; - spotPositions[ spotOffset + 1 ] = _vector3.y; - spotPositions[ spotOffset + 2 ] = _vector3.z; + spotPositions[ spotOffset ] = _direction.x; + spotPositions[ spotOffset + 1 ] = _direction.y; + spotPositions[ spotOffset + 2 ] = _direction.z; spotDistances[ spotLength ] = distance; - _direction.copy( _vector3 ); _vector3.setFromMatrixPosition( light.target.matrixWorld ); _direction.sub( _vector3 ); _direction.normalize(); @@ -24162,7 +23158,7 @@ THREE.WebGLRenderer = function ( parameters ) { zlights.ambient[ 1 ] = g; zlights.ambient[ 2 ] = b; - }; + } // GL state setting @@ -24284,7 +23280,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function setPolygonOffset ( polygonoffset, factor, units ) { @@ -24313,7 +23309,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } this.setBlending = function ( blending, blendEquation, blendSrc, blendDst ) { @@ -24392,6 +23388,8 @@ THREE.WebGLRenderer = function ( parameters ) { function setTextureParameters ( textureType, texture, isImagePowerOfTwo ) { + var extension; + if ( isImagePowerOfTwo ) { _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) ); @@ -24410,121 +23408,144 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( _glExtensionTextureFilterAnisotropic && texture.type !== THREE.FloatType ) { + extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + if ( extension && texture.type !== THREE.FloatType ) { if ( texture.anisotropy > 1 || texture.__oldAnisotropy ) { - _gl.texParameterf( textureType, _glExtensionTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, _maxAnisotropy ) ); + _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, _this.getMaxAnisotropy() ) ); texture.__oldAnisotropy = texture.anisotropy; } } - }; + } - this.setTexture = function ( texture, slot ) { + this.uploadTexture = function ( texture ) { - if ( texture.needsUpdate ) { + if ( texture.__webglInit === undefined ) { - if ( ! texture.__webglInit ) { + texture.__webglInit = true; - texture.__webglInit = true; + texture.addEventListener( 'dispose', onTextureDispose ); - texture.addEventListener( 'dispose', onTextureDispose ); + texture.__webglTexture = _gl.createTexture(); - texture.__webglTexture = _gl.createTexture(); + _this.info.memory.textures ++; - _this.info.memory.textures ++; + } - } + _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); - _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); - _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); - _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); + texture.image = clampToMaxSize( texture.image, _maxTextureSize ); - var image = texture.image, - isImagePowerOfTwo = THREE.Math.isPowerOfTwo( image.width ) && THREE.Math.isPowerOfTwo( image.height ), - glFormat = paramThreeToGL( texture.format ), - glType = paramThreeToGL( texture.type ); + var image = texture.image, + isImagePowerOfTwo = THREE.Math.isPowerOfTwo( image.width ) && THREE.Math.isPowerOfTwo( image.height ), + glFormat = paramThreeToGL( texture.format ), + glType = paramThreeToGL( texture.type ); - setTextureParameters( _gl.TEXTURE_2D, texture, isImagePowerOfTwo ); + setTextureParameters( _gl.TEXTURE_2D, texture, isImagePowerOfTwo ); - var mipmap, mipmaps = texture.mipmaps; + var mipmap, mipmaps = texture.mipmaps; - if ( texture instanceof THREE.DataTexture ) { + if ( texture instanceof THREE.DataTexture ) { - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels - if ( mipmaps.length > 0 && isImagePowerOfTwo ) { - - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { - - mipmap = mipmaps[ i ]; - _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - - } - - texture.generateMipmaps = false; - - } else { - - _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data ); - - } - - } else if ( texture instanceof THREE.CompressedTexture ) { + if ( mipmaps.length > 0 && isImagePowerOfTwo ) { for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { mipmap = mipmaps[ i ]; - if ( texture.format !== THREE.RGBAFormat ) { - _gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); - } else { - _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - } + _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); } - } else { // regular Texture (image, video, canvas) + texture.generateMipmaps = false; - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels + } else { - if ( mipmaps.length > 0 && isImagePowerOfTwo ) { + _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data ); - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + } - mipmap = mipmaps[ i ]; - _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap ); + } else if ( texture instanceof THREE.CompressedTexture ) { + + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + + if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) { + + if ( getCompressedTextureFormats().indexOf( glFormat ) > -1 ) { + + _gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } else { + + console.warn( "Attempt to load unsupported compressed texture format" ); } - texture.generateMipmaps = false; - } else { - _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image ); + _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); } } - if ( texture.generateMipmaps && isImagePowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); + } else { // regular Texture (image, video, canvas) - texture.needsUpdate = false; + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels - if ( texture.onUpdate ) texture.onUpdate(); + if ( mipmaps.length > 0 && isImagePowerOfTwo ) { + + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap ); + + } + + texture.generateMipmaps = false; + + } else { + + _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image ); + + } + + } + + if ( texture.generateMipmaps && isImagePowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); + + texture.needsUpdate = false; + + if ( texture.onUpdate ) texture.onUpdate(); + + }; + + this.setTexture = function ( texture, slot ) { + + _gl.activeTexture( _gl.TEXTURE0 + slot ); + + if ( texture.needsUpdate ) { + + _this.uploadTexture( texture ); } else { - _gl.activeTexture( _gl.TEXTURE0 + slot ); _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); } @@ -24533,27 +23554,27 @@ THREE.WebGLRenderer = function ( parameters ) { function clampToMaxSize ( image, maxSize ) { - if ( image.width <= maxSize && image.height <= maxSize ) { + if ( image.width > maxSize || image.height > maxSize ) { - return image; + // Warning: Scaling through the canvas will only work with images that use + // premultiplied alpha. + + var scale = maxSize / Math.max( image.width, image.height ); + + var canvas = document.createElement( 'canvas' ); + canvas.width = Math.floor( image.width * scale ); + canvas.height = Math.floor( image.height * scale ); + + var context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height ); + + console.log( 'THREE.WebGLRenderer:', image, 'is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height + '.' ); + + return canvas; } - // Warning: Scaling through the canvas will only work with images that use - // premultiplied alpha. - - var maxDimension = Math.max( image.width, image.height ); - var newWidth = Math.floor( image.width * maxSize / maxDimension ); - var newHeight = Math.floor( image.height * maxSize / maxDimension ); - - var canvas = document.createElement( 'canvas' ); - canvas.width = newWidth; - canvas.height = newHeight; - - var ctx = canvas.getContext( '2d' ); - ctx.drawImage( image, 0, 0, image.width, image.height, 0, 0, newWidth, newHeight ); - - return canvas; + return image; } @@ -24579,18 +23600,19 @@ THREE.WebGLRenderer = function ( parameters ) { _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); var isCompressed = texture instanceof THREE.CompressedTexture; + var isDataTexture = texture.image[ 0 ] instanceof THREE.DataTexture; var cubeImage = []; for ( var i = 0; i < 6; i ++ ) { - if ( _this.autoScaleCubemaps && ! isCompressed ) { + if ( _this.autoScaleCubemaps && ! isCompressed && ! isDataTexture ) { cubeImage[ i ] = clampToMaxSize( texture.image[ i ], _maxCubemapSize ); } else { - cubeImage[ i ] = texture.image[ i ]; + cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; } @@ -24607,7 +23629,15 @@ THREE.WebGLRenderer = function ( parameters ) { if ( ! isCompressed ) { - _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); + if ( isDataTexture ) { + + _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); + + } else { + + _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); + + } } else { @@ -24616,16 +23646,29 @@ THREE.WebGLRenderer = function ( parameters ) { for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) { mipmap = mipmaps[ j ]; - if ( texture.format !== THREE.RGBAFormat ) { - _gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) { + + if ( getCompressedTextureFormats().indexOf( glFormat ) > -1 ) { + + _gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } else { + + console.warn( "Attempt to load unsupported compressed texture format" ); + + } } else { + _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + } } + } + } if ( texture.generateMipmaps && isImagePowerOfTwo ) { @@ -24647,14 +23690,14 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function setCubeTextureDynamic ( texture, slot ) { _gl.activeTexture( _gl.TEXTURE0 + slot ); _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.__webglTexture ); - }; + } // Render targets @@ -24663,7 +23706,7 @@ THREE.WebGLRenderer = function ( parameters ) { _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, renderTarget.__webglTexture, 0 ); - }; + } function setupRenderBuffer ( renderbuffer, renderTarget ) { @@ -24691,13 +23734,13 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } this.setRenderTarget = function ( renderTarget ) { var isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube ); - if ( renderTarget && ! renderTarget.__webglFramebuffer ) { + if ( renderTarget && renderTarget.__webglFramebuffer === undefined ) { if ( renderTarget.depthBuffer === undefined ) renderTarget.depthBuffer = true; if ( renderTarget.stencilBuffer === undefined ) renderTarget.stencilBuffer = true; @@ -24858,7 +23901,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } // Fallback filters for non-power-of-2 textures @@ -24872,12 +23915,14 @@ THREE.WebGLRenderer = function ( parameters ) { return _gl.LINEAR; - }; + } // Map three.js constants to WebGL constants function paramThreeToGL ( p ) { + var extension; + if ( p === THREE.RepeatWrapping ) return _gl.REPEAT; if ( p === THREE.ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE; if ( p === THREE.MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT; @@ -24925,18 +23970,40 @@ THREE.WebGLRenderer = function ( parameters ) { if ( p === THREE.OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR; if ( p === THREE.SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE; - if ( _glExtensionCompressedTextureS3TC !== undefined ) { + extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); - if ( p === THREE.RGB_S3TC_DXT1_Format ) return _glExtensionCompressedTextureS3TC.COMPRESSED_RGB_S3TC_DXT1_EXT; - if ( p === THREE.RGBA_S3TC_DXT1_Format ) return _glExtensionCompressedTextureS3TC.COMPRESSED_RGBA_S3TC_DXT1_EXT; - if ( p === THREE.RGBA_S3TC_DXT3_Format ) return _glExtensionCompressedTextureS3TC.COMPRESSED_RGBA_S3TC_DXT3_EXT; - if ( p === THREE.RGBA_S3TC_DXT5_Format ) return _glExtensionCompressedTextureS3TC.COMPRESSED_RGBA_S3TC_DXT5_EXT; + if ( extension !== null ) { + + if ( p === THREE.RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; + if ( p === THREE.RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if ( p === THREE.RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if ( p === THREE.RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + + } + + extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + + if ( extension !== null ) { + + if ( p === THREE.RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + if ( p === THREE.RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + if ( p === THREE.RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + if ( p === THREE.RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + + } + + extension = extensions.get( 'EXT_blend_minmax' ); + + if ( extension !== null ) { + + if ( p === THREE.MinEquation ) return extension.MIN_EXT; + if ( p === THREE.MaxEquation ) return extension.MAX_EXT; } return 0; - }; + } // Allocations @@ -24977,7 +24044,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - }; + } function allocateLights( lights ) { @@ -25001,7 +24068,7 @@ THREE.WebGLRenderer = function ( parameters ) { return { 'directional': dirLights, 'point': pointLights, 'spot': spotLights, 'hemi': hemiLights }; - }; + } function allocateShadows( lights ) { @@ -25020,129 +24087,33 @@ THREE.WebGLRenderer = function ( parameters ) { return maxShadows; - }; + } - // Initialization + // DEPRECATED + + this.initMaterial = function () { - function initGL() { - - try { - - var attributes = { - alpha: _alpha, - depth: _depth, - stencil: _stencil, - antialias: _antialias, - premultipliedAlpha: _premultipliedAlpha, - preserveDrawingBuffer: _preserveDrawingBuffer - }; - - _gl = _context || _canvas.getContext( 'webgl', attributes ) || _canvas.getContext( 'experimental-webgl', attributes ); - - if ( _gl === null ) { - - throw 'Error creating WebGL context.'; - - } - - } catch ( error ) { - - console.error( error ); - - } - - _glExtensionTextureFloat = _gl.getExtension( 'OES_texture_float' ); - _glExtensionTextureFloatLinear = _gl.getExtension( 'OES_texture_float_linear' ); - _glExtensionStandardDerivatives = _gl.getExtension( 'OES_standard_derivatives' ); - - _glExtensionTextureFilterAnisotropic = _gl.getExtension( 'EXT_texture_filter_anisotropic' ) || _gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || _gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); - - _glExtensionCompressedTextureS3TC = _gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); - - _glExtensionElementIndexUint = _gl.getExtension( 'OES_element_index_uint' ); - - - if ( _glExtensionTextureFloat === null ) { - - console.log( 'THREE.WebGLRenderer: Float textures not supported.' ); - - } - - if ( _glExtensionStandardDerivatives === null ) { - - console.log( 'THREE.WebGLRenderer: Standard derivatives not supported.' ); - - } - - if ( _glExtensionTextureFilterAnisotropic === null ) { - - console.log( 'THREE.WebGLRenderer: Anisotropic texture filtering not supported.' ); - - } - - if ( _glExtensionCompressedTextureS3TC === null ) { - - console.log( 'THREE.WebGLRenderer: S3TC compressed textures not supported.' ); - - } - - if ( _glExtensionElementIndexUint === null ) { - - console.log( 'THREE.WebGLRenderer: elementindex as unsigned integer not supported.' ); - - } - - if ( _gl.getShaderPrecisionFormat === undefined ) { - - _gl.getShaderPrecisionFormat = function () { - - return { - 'rangeMin': 1, - 'rangeMax': 1, - 'precision': 1 - }; - - } - } - - if ( _logarithmicDepthBuffer ) { - - _glExtensionFragDepth = _gl.getExtension( 'EXT_frag_depth' ); - - } + console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' ); }; - function setDefaultGLState () { + this.addPrePlugin = function () { - _gl.clearColor( 0, 0, 0, 1 ); - _gl.clearDepth( 1 ); - _gl.clearStencil( 0 ); - - _gl.enable( _gl.DEPTH_TEST ); - _gl.depthFunc( _gl.LEQUAL ); - - _gl.frontFace( _gl.CCW ); - _gl.cullFace( _gl.BACK ); - _gl.enable( _gl.CULL_FACE ); - - _gl.enable( _gl.BLEND ); - _gl.blendEquation( _gl.FUNC_ADD ); - _gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA ); - - _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight ); - - _gl.clearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); }; - // default plugins (order is important) + this.addPostPlugin = function () { - this.shadowMapPlugin = new THREE.ShadowMapPlugin(); - this.addPrePlugin( this.shadowMapPlugin ); + console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); - this.addPostPlugin( new THREE.SpritePlugin() ); - this.addPostPlugin( new THREE.LensFlarePlugin() ); + }; + + this.updateShadowMap = function () { + + console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); + + }; }; @@ -25249,6 +24220,76 @@ THREE.WebGLRenderTargetCube = function ( width, height, options ) { THREE.WebGLRenderTargetCube.prototype = Object.create( THREE.WebGLRenderTarget.prototype ); +// File:src/renderers/webgl/WebGLExtensions.js + +THREE.WebGLExtensions = function ( gl ) { + + var extensions = {}; + + this.get = function ( name ) { + + if ( extensions[ name ] !== undefined ) { + + return extensions[ name ]; + + } + + var extension; + + switch ( name ) { + + case 'OES_texture_float': + extension = gl.getExtension( 'OES_texture_float' ); + break; + + case 'OES_texture_float_linear': + extension = gl.getExtension( 'OES_texture_float_linear' ); + break; + + case 'OES_standard_derivatives': + extension = gl.getExtension( 'OES_standard_derivatives' ); + break; + + case 'EXT_texture_filter_anisotropic': + extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); + break; + + case 'WEBGL_compressed_texture_s3tc': + extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); + break; + + case 'WEBGL_compressed_texture_pvrtc': + extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); + break; + + case 'OES_element_index_uint': + extension = gl.getExtension( 'OES_element_index_uint' ); + break; + + case 'EXT_blend_minmax': + extension = gl.getExtension( 'EXT_blend_minmax' ); + break; + + case 'EXT_frag_depth': + extension = gl.getExtension( 'EXT_frag_depth' ); + break; + + } + + if ( extension === null ) { + + console.log( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); + + } + + extensions[ name ] = extension; + + return extension; + + }; + +}; + // File:src/renderers/webgl/WebGLProgram.js THREE.WebGLProgram = ( function () { @@ -25614,6 +24655,7 @@ THREE.WebGLProgram = ( function () { } this.attributes = cacheAttributeLocations( _gl, program, identifiers ); + this.attributesKeys = Object.keys( this.attributes ); // @@ -25677,111 +24719,1368 @@ THREE.WebGLShader = ( function () { } )(); -// File:src/renderers/renderables/RenderableVertex.js +// File:src/renderers/webgl/plugins/LensFlarePlugin.js /** - * @author mrdoob / http://mrdoob.com/ + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ */ -THREE.RenderableVertex = function () { +THREE.LensFlarePlugin = function ( renderer, flares ) { - this.position = new THREE.Vector3(); - this.positionWorld = new THREE.Vector3(); - this.positionScreen = new THREE.Vector4(); + var gl = renderer.context; - this.visible = true; + var vertexBuffer, elementBuffer; + var program, attributes, uniforms; + var hasVertexTexture; + + var tempTexture, occlusionTexture; + + var init = function () { + + var vertices = new Float32Array( [ + -1, -1, 0, 0, + 1, -1, 1, 0, + 1, 1, 1, 1, + -1, 1, 0, 1 + ] ); + + var faces = new Uint16Array( [ + 0, 1, 2, + 0, 2, 3 + ] ); + + // buffers + + vertexBuffer = gl.createBuffer(); + elementBuffer = gl.createBuffer(); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); + + // textures + + tempTexture = gl.createTexture(); + occlusionTexture = gl.createTexture(); + + gl.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + + gl.bindTexture( gl.TEXTURE_2D, occlusionTexture ); + gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + + hasVertexTexture = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ) > 0; + + var shader; + + if ( hasVertexTexture ) { + + shader = { + + vertexShader: [ + + "uniform lowp int renderType;", + + "uniform vec3 screenPosition;", + "uniform vec2 scale;", + "uniform float rotation;", + + "uniform sampler2D occlusionMap;", + + "attribute vec2 position;", + "attribute vec2 uv;", + + "varying vec2 vUV;", + "varying float vVisibility;", + + "void main() {", + + "vUV = uv;", + + "vec2 pos = position;", + + "if( renderType == 2 ) {", + + "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", + + "vVisibility = visibility.r / 9.0;", + "vVisibility *= 1.0 - visibility.g / 9.0;", + "vVisibility *= visibility.b / 9.0;", + "vVisibility *= 1.0 - visibility.a / 9.0;", + + "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", + "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", + + "}", + + "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", + + "}" + + ].join( "\n" ), + + fragmentShader: [ + + "uniform lowp int renderType;", + + "uniform sampler2D map;", + "uniform float opacity;", + "uniform vec3 color;", + + "varying vec2 vUV;", + "varying float vVisibility;", + + "void main() {", + + // pink square + + "if( renderType == 0 ) {", + + "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", + + // restore + + "} else if( renderType == 1 ) {", + + "gl_FragColor = texture2D( map, vUV );", + + // flare + + "} else {", + + "vec4 texture = texture2D( map, vUV );", + "texture.a *= opacity * vVisibility;", + "gl_FragColor = texture;", + "gl_FragColor.rgb *= color;", + + "}", + + "}" + + ].join( "\n" ) + + }; + + } else { + + shader = { + + vertexShader: [ + + "uniform lowp int renderType;", + + "uniform vec3 screenPosition;", + "uniform vec2 scale;", + "uniform float rotation;", + + "attribute vec2 position;", + "attribute vec2 uv;", + + "varying vec2 vUV;", + + "void main() {", + + "vUV = uv;", + + "vec2 pos = position;", + + "if( renderType == 2 ) {", + + "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", + "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", + + "}", + + "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", + + "}" + + ].join( "\n" ), + + fragmentShader: [ + + "precision mediump float;", + + "uniform lowp int renderType;", + + "uniform sampler2D map;", + "uniform sampler2D occlusionMap;", + "uniform float opacity;", + "uniform vec3 color;", + + "varying vec2 vUV;", + + "void main() {", + + // pink square + + "if( renderType == 0 ) {", + + "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", + + // restore + + "} else if( renderType == 1 ) {", + + "gl_FragColor = texture2D( map, vUV );", + + // flare + + "} else {", + + "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", + "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", + "visibility = ( 1.0 - visibility / 4.0 );", + + "vec4 texture = texture2D( map, vUV );", + "texture.a *= opacity * visibility;", + "gl_FragColor = texture;", + "gl_FragColor.rgb *= color;", + + "}", + + "}" + + ].join( "\n" ) + + }; + + } + + program = createProgram( shader ); + + attributes = { + vertex: gl.getAttribLocation ( program, "position" ), + uv: gl.getAttribLocation ( program, "uv" ) + } + + uniforms = { + renderType: gl.getUniformLocation( program, "renderType" ), + map: gl.getUniformLocation( program, "map" ), + occlusionMap: gl.getUniformLocation( program, "occlusionMap" ), + opacity: gl.getUniformLocation( program, "opacity" ), + color: gl.getUniformLocation( program, "color" ), + scale: gl.getUniformLocation( program, "scale" ), + rotation: gl.getUniformLocation( program, "rotation" ), + screenPosition: gl.getUniformLocation( program, "screenPosition" ) + }; + + }; + + /* + * Render lens flares + * Method: renders 16x16 0xff00ff-colored points scattered over the light source area, + * reads these back and calculates occlusion. + */ + + this.render = function ( scene, camera, viewportWidth, viewportHeight ) { + + if ( flares.length === 0 ) return; + + var tempPosition = new THREE.Vector3(); + + var invAspect = viewportHeight / viewportWidth, + halfViewportWidth = viewportWidth * 0.5, + halfViewportHeight = viewportHeight * 0.5; + + var size = 16 / viewportHeight, + scale = new THREE.Vector2( size * invAspect, size ); + + var screenPosition = new THREE.Vector3( 1, 1, 0 ), + screenPositionPixels = new THREE.Vector2( 1, 1 ); + + if ( program === undefined ) { + + init(); + + } + + gl.useProgram( program ); + + gl.enableVertexAttribArray( attributes.vertex ); + gl.enableVertexAttribArray( attributes.uv ); + + // loop through all lens flares to update their occlusion and positions + // setup gl and common used attribs/unforms + + gl.uniform1i( uniforms.occlusionMap, 0 ); + gl.uniform1i( uniforms.map, 1 ); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.vertexAttribPointer( attributes.vertex, 2, gl.FLOAT, false, 2 * 8, 0 ); + gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + + gl.disable( gl.CULL_FACE ); + gl.depthMask( false ); + + for ( var i = 0, l = flares.length; i < l; i ++ ) { + + size = 16 / viewportHeight; + scale.set( size * invAspect, size ); + + // calc object screen position + + var flare = flares[ i ]; + + tempPosition.set( flare.matrixWorld.elements[12], flare.matrixWorld.elements[13], flare.matrixWorld.elements[14] ); + + tempPosition.applyMatrix4( camera.matrixWorldInverse ); + tempPosition.applyProjection( camera.projectionMatrix ); + + // setup arrays for gl programs + + screenPosition.copy( tempPosition ) + + screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth; + screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight; + + // screen cull + + if ( hasVertexTexture || ( + screenPositionPixels.x > 0 && + screenPositionPixels.x < viewportWidth && + screenPositionPixels.y > 0 && + screenPositionPixels.y < viewportHeight ) ) { + + // save current RGB to temp texture + + gl.activeTexture( gl.TEXTURE1 ); + gl.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); + + + // render pink quad + + gl.uniform1i( uniforms.renderType, 0 ); + gl.uniform2f( uniforms.scale, scale.x, scale.y ); + gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); + + gl.disable( gl.BLEND ); + gl.enable( gl.DEPTH_TEST ); + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + + // copy result to occlusionMap + + gl.activeTexture( gl.TEXTURE0 ); + gl.bindTexture( gl.TEXTURE_2D, occlusionTexture ); + gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); + + + // restore graphics + + gl.uniform1i( uniforms.renderType, 1 ); + gl.disable( gl.DEPTH_TEST ); + + gl.activeTexture( gl.TEXTURE1 ); + gl.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + + // update object positions + + flare.positionScreen.copy( screenPosition ) + + if ( flare.customUpdateCallback ) { + + flare.customUpdateCallback( flare ); + + } else { + + flare.updateLensFlares(); + + } + + // render flares + + gl.uniform1i( uniforms.renderType, 2 ); + gl.enable( gl.BLEND ); + + for ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) { + + var sprite = flare.lensFlares[ j ]; + + if ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) { + + screenPosition.x = sprite.x; + screenPosition.y = sprite.y; + screenPosition.z = sprite.z; + + size = sprite.size * sprite.scale / viewportHeight; + + scale.x = size * invAspect; + scale.y = size; + + gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); + gl.uniform2f( uniforms.scale, scale.x, scale.y ); + gl.uniform1f( uniforms.rotation, sprite.rotation ); + + gl.uniform1f( uniforms.opacity, sprite.opacity ); + gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); + + renderer.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst ); + renderer.setTexture( sprite.texture, 1 ); + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + } + + } + + } + + } + + // restore gl + + gl.enable( gl.CULL_FACE ); + gl.enable( gl.DEPTH_TEST ); + gl.depthMask( true ); + + renderer.resetGLState(); + + }; + + function createProgram ( shader ) { + + var program = gl.createProgram(); + + var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); + var vertexShader = gl.createShader( gl.VERTEX_SHADER ); + + var prefix = "precision " + renderer.getPrecision() + " float;\n"; + + gl.shaderSource( fragmentShader, prefix + shader.fragmentShader ); + gl.shaderSource( vertexShader, prefix + shader.vertexShader ); + + gl.compileShader( fragmentShader ); + gl.compileShader( vertexShader ); + + gl.attachShader( program, fragmentShader ); + gl.attachShader( program, vertexShader ); + + gl.linkProgram( program ); + + return program; + + } }; -THREE.RenderableVertex.prototype.copy = function ( vertex ) { +// File:src/renderers/webgl/plugins/ShadowMapPlugin.js - this.positionWorld.copy( vertex.positionWorld ); - this.positionScreen.copy( vertex.positionScreen ); +/** + * @author alteredq / http://alteredqualia.com/ + */ + +THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObjectsImmediate ) { + + var _gl = _renderer.context; + + var _depthMaterial, _depthMaterialMorph, _depthMaterialSkin, _depthMaterialMorphSkin, + + _frustum = new THREE.Frustum(), + _projScreenMatrix = new THREE.Matrix4(), + + _min = new THREE.Vector3(), + _max = new THREE.Vector3(), + + _matrixPosition = new THREE.Vector3(), + + _renderList = []; + + // init + + var depthShader = THREE.ShaderLib[ "depthRGBA" ]; + var depthUniforms = THREE.UniformsUtils.clone( depthShader.uniforms ); + + _depthMaterial = new THREE.ShaderMaterial( { + uniforms: depthUniforms, + vertexShader: depthShader.vertexShader, + fragmentShader: depthShader.fragmentShader + } ); + + _depthMaterialMorph = new THREE.ShaderMaterial( { + uniforms: depthUniforms, + vertexShader: depthShader.vertexShader, + fragmentShader: depthShader.fragmentShader, + morphTargets: true + } ); + + _depthMaterialSkin = new THREE.ShaderMaterial( { + uniforms: depthUniforms, + vertexShader: depthShader.vertexShader, + fragmentShader: depthShader.fragmentShader, + skinning: true + } ); + + _depthMaterialMorphSkin = new THREE.ShaderMaterial( { + uniforms: depthUniforms, + vertexShader: depthShader.vertexShader, + fragmentShader: depthShader.fragmentShader, + morphTargets: true, + skinning: true + } ); + + _depthMaterial._shadowPass = true; + _depthMaterialMorph._shadowPass = true; + _depthMaterialSkin._shadowPass = true; + _depthMaterialMorphSkin._shadowPass = true; + + this.render = function ( scene, camera ) { + + if ( _renderer.shadowMapEnabled === false ) return; + + var i, il, j, jl, n, + + shadowMap, shadowMatrix, shadowCamera, + program, buffer, material, + webglObject, object, light, + + lights = [], + k = 0, + + fog = null; + + // set GL state for depth map + + _gl.clearColor( 1, 1, 1, 1 ); + _gl.disable( _gl.BLEND ); + + _gl.enable( _gl.CULL_FACE ); + _gl.frontFace( _gl.CCW ); + + if ( _renderer.shadowMapCullFace === THREE.CullFaceFront ) { + + _gl.cullFace( _gl.FRONT ); + + } else { + + _gl.cullFace( _gl.BACK ); + + } + + _renderer.setDepthTest( true ); + + // preprocess lights + // - skip lights that are not casting shadows + // - create virtual lights for cascaded shadow maps + + for ( i = 0, il = _lights.length; i < il; i ++ ) { + + light = _lights[ i ]; + + if ( ! light.castShadow ) continue; + + if ( ( light instanceof THREE.DirectionalLight ) && light.shadowCascade ) { + + for ( n = 0; n < light.shadowCascadeCount; n ++ ) { + + var virtualLight; + + if ( ! light.shadowCascadeArray[ n ] ) { + + virtualLight = createVirtualLight( light, n ); + virtualLight.originalCamera = camera; + + var gyro = new THREE.Gyroscope(); + gyro.position.copy( light.shadowCascadeOffset ); + + gyro.add( virtualLight ); + gyro.add( virtualLight.target ); + + camera.add( gyro ); + + light.shadowCascadeArray[ n ] = virtualLight; + + console.log( "Created virtualLight", virtualLight ); + + } else { + + virtualLight = light.shadowCascadeArray[ n ]; + + } + + updateVirtualLight( light, n ); + + lights[ k ] = virtualLight; + k ++; + + } + + } else { + + lights[ k ] = light; + k ++; + + } + + } + + // render depth map + + for ( i = 0, il = lights.length; i < il; i ++ ) { + + light = lights[ i ]; + + if ( ! light.shadowMap ) { + + var shadowFilter = THREE.LinearFilter; + + if ( _renderer.shadowMapType === THREE.PCFSoftShadowMap ) { + + shadowFilter = THREE.NearestFilter; + + } + + var pars = { minFilter: shadowFilter, magFilter: shadowFilter, format: THREE.RGBAFormat }; + + light.shadowMap = new THREE.WebGLRenderTarget( light.shadowMapWidth, light.shadowMapHeight, pars ); + light.shadowMapSize = new THREE.Vector2( light.shadowMapWidth, light.shadowMapHeight ); + + light.shadowMatrix = new THREE.Matrix4(); + + } + + if ( ! light.shadowCamera ) { + + if ( light instanceof THREE.SpotLight ) { + + light.shadowCamera = new THREE.PerspectiveCamera( light.shadowCameraFov, light.shadowMapWidth / light.shadowMapHeight, light.shadowCameraNear, light.shadowCameraFar ); + + } else if ( light instanceof THREE.DirectionalLight ) { + + light.shadowCamera = new THREE.OrthographicCamera( light.shadowCameraLeft, light.shadowCameraRight, light.shadowCameraTop, light.shadowCameraBottom, light.shadowCameraNear, light.shadowCameraFar ); + + } else { + + console.error( "Unsupported light type for shadow" ); + continue; + + } + + scene.add( light.shadowCamera ); + + if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); + + } + + if ( light.shadowCameraVisible && ! light.cameraHelper ) { + + light.cameraHelper = new THREE.CameraHelper( light.shadowCamera ); + scene.add( light.cameraHelper ); + + } + + if ( light.isVirtual && virtualLight.originalCamera == camera ) { + + updateShadowCamera( camera, light ); + + } + + shadowMap = light.shadowMap; + shadowMatrix = light.shadowMatrix; + shadowCamera = light.shadowCamera; + + // + + shadowCamera.position.setFromMatrixPosition( light.matrixWorld ); + _matrixPosition.setFromMatrixPosition( light.target.matrixWorld ); + shadowCamera.lookAt( _matrixPosition ); + shadowCamera.updateMatrixWorld(); + + shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld ); + + // + + if ( light.cameraHelper ) light.cameraHelper.visible = light.shadowCameraVisible; + if ( light.shadowCameraVisible ) light.cameraHelper.update(); + + // compute shadow matrix + + shadowMatrix.set( + 0.5, 0.0, 0.0, 0.5, + 0.0, 0.5, 0.0, 0.5, + 0.0, 0.0, 0.5, 0.5, + 0.0, 0.0, 0.0, 1.0 + ); + + shadowMatrix.multiply( shadowCamera.projectionMatrix ); + shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); + + // update camera matrices and frustum + + _projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); + _frustum.setFromMatrix( _projScreenMatrix ); + + // render shadow map + + _renderer.setRenderTarget( shadowMap ); + _renderer.clear(); + + // set object matrices & frustum culling + + _renderList.length = 0; + + projectObject( scene, scene, shadowCamera ); + + + // render regular objects + + var objectMaterial, useMorphing, useSkinning; + + for ( j = 0, jl = _renderList.length; j < jl; j ++ ) { + + webglObject = _renderList[ j ]; + + object = webglObject.object; + buffer = webglObject.buffer; + + // culling is overriden globally for all objects + // while rendering depth map + + // need to deal with MeshFaceMaterial somehow + // in that case just use the first of material.materials for now + // (proper solution would require to break objects by materials + // similarly to regular rendering and then set corresponding + // depth materials per each chunk instead of just once per object) + + objectMaterial = getObjectMaterial( object ); + + useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets; + useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning; + + if ( object.customDepthMaterial ) { + + material = object.customDepthMaterial; + + } else if ( useSkinning ) { + + material = useMorphing ? _depthMaterialMorphSkin : _depthMaterialSkin; + + } else if ( useMorphing ) { + + material = _depthMaterialMorph; + + } else { + + material = _depthMaterial; + + } + + _renderer.setMaterialFaces( objectMaterial ); + + if ( buffer instanceof THREE.BufferGeometry ) { + + _renderer.renderBufferDirect( shadowCamera, _lights, fog, material, buffer, object ); + + } else { + + _renderer.renderBuffer( shadowCamera, _lights, fog, material, buffer, object ); + + } + + } + + // set matrices and render immediate objects + + for ( j = 0, jl = _webglObjectsImmediate.length; j < jl; j ++ ) { + + webglObject = _webglObjectsImmediate[ j ]; + object = webglObject.object; + + if ( object.visible && object.castShadow ) { + + object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); + + _renderer.renderImmediateObject( shadowCamera, _lights, fog, _depthMaterial, object ); + + } + + } + + } + + // restore GL state + + var clearColor = _renderer.getClearColor(), + clearAlpha = _renderer.getClearAlpha(); + + _gl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha ); + _gl.enable( _gl.BLEND ); + + if ( _renderer.shadowMapCullFace === THREE.CullFaceFront ) { + + _gl.cullFace( _gl.BACK ); + + } + + _renderer.resetGLState(); + + }; + + function projectObject( scene, object, shadowCamera ){ + + if ( object.visible ) { + + var webglObjects = _webglObjects[ object.id ]; + + if ( webglObjects && object.castShadow && (object.frustumCulled === false || _frustum.intersectsObject( object ) === true) ) { + + for ( var i = 0, l = webglObjects.length; i < l; i ++ ) { + + var webglObject = webglObjects[ i ]; + + object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); + _renderList.push( webglObject ); + + } + + } + + for ( var i = 0, l = object.children.length; i < l; i ++ ) { + + projectObject( scene, object.children[ i ], shadowCamera ); + + } + + } + + } + + function createVirtualLight( light, cascade ) { + + var virtualLight = new THREE.DirectionalLight(); + + virtualLight.isVirtual = true; + + virtualLight.onlyShadow = true; + virtualLight.castShadow = true; + + virtualLight.shadowCameraNear = light.shadowCameraNear; + virtualLight.shadowCameraFar = light.shadowCameraFar; + + virtualLight.shadowCameraLeft = light.shadowCameraLeft; + virtualLight.shadowCameraRight = light.shadowCameraRight; + virtualLight.shadowCameraBottom = light.shadowCameraBottom; + virtualLight.shadowCameraTop = light.shadowCameraTop; + + virtualLight.shadowCameraVisible = light.shadowCameraVisible; + + virtualLight.shadowDarkness = light.shadowDarkness; + + virtualLight.shadowBias = light.shadowCascadeBias[ cascade ]; + virtualLight.shadowMapWidth = light.shadowCascadeWidth[ cascade ]; + virtualLight.shadowMapHeight = light.shadowCascadeHeight[ cascade ]; + + virtualLight.pointsWorld = []; + virtualLight.pointsFrustum = []; + + var pointsWorld = virtualLight.pointsWorld, + pointsFrustum = virtualLight.pointsFrustum; + + for ( var i = 0; i < 8; i ++ ) { + + pointsWorld[ i ] = new THREE.Vector3(); + pointsFrustum[ i ] = new THREE.Vector3(); + + } + + var nearZ = light.shadowCascadeNearZ[ cascade ]; + var farZ = light.shadowCascadeFarZ[ cascade ]; + + pointsFrustum[ 0 ].set( - 1, - 1, nearZ ); + pointsFrustum[ 1 ].set( 1, - 1, nearZ ); + pointsFrustum[ 2 ].set( - 1, 1, nearZ ); + pointsFrustum[ 3 ].set( 1, 1, nearZ ); + + pointsFrustum[ 4 ].set( - 1, - 1, farZ ); + pointsFrustum[ 5 ].set( 1, - 1, farZ ); + pointsFrustum[ 6 ].set( - 1, 1, farZ ); + pointsFrustum[ 7 ].set( 1, 1, farZ ); + + return virtualLight; + + } + + // Synchronize virtual light with the original light + + function updateVirtualLight( light, cascade ) { + + var virtualLight = light.shadowCascadeArray[ cascade ]; + + virtualLight.position.copy( light.position ); + virtualLight.target.position.copy( light.target.position ); + virtualLight.lookAt( virtualLight.target ); + + virtualLight.shadowCameraVisible = light.shadowCameraVisible; + virtualLight.shadowDarkness = light.shadowDarkness; + + virtualLight.shadowBias = light.shadowCascadeBias[ cascade ]; + + var nearZ = light.shadowCascadeNearZ[ cascade ]; + var farZ = light.shadowCascadeFarZ[ cascade ]; + + var pointsFrustum = virtualLight.pointsFrustum; + + pointsFrustum[ 0 ].z = nearZ; + pointsFrustum[ 1 ].z = nearZ; + pointsFrustum[ 2 ].z = nearZ; + pointsFrustum[ 3 ].z = nearZ; + + pointsFrustum[ 4 ].z = farZ; + pointsFrustum[ 5 ].z = farZ; + pointsFrustum[ 6 ].z = farZ; + pointsFrustum[ 7 ].z = farZ; + + } + + // Fit shadow camera's ortho frustum to camera frustum + + function updateShadowCamera( camera, light ) { + + var shadowCamera = light.shadowCamera, + pointsFrustum = light.pointsFrustum, + pointsWorld = light.pointsWorld; + + _min.set( Infinity, Infinity, Infinity ); + _max.set( - Infinity, - Infinity, - Infinity ); + + for ( var i = 0; i < 8; i ++ ) { + + var p = pointsWorld[ i ]; + + p.copy( pointsFrustum[ i ] ); + p.unproject( camera ); + + p.applyMatrix4( shadowCamera.matrixWorldInverse ); + + if ( p.x < _min.x ) _min.x = p.x; + if ( p.x > _max.x ) _max.x = p.x; + + if ( p.y < _min.y ) _min.y = p.y; + if ( p.y > _max.y ) _max.y = p.y; + + if ( p.z < _min.z ) _min.z = p.z; + if ( p.z > _max.z ) _max.z = p.z; + + } + + shadowCamera.left = _min.x; + shadowCamera.right = _max.x; + shadowCamera.top = _max.y; + shadowCamera.bottom = _min.y; + + // can't really fit near/far + //shadowCamera.near = _min.z; + //shadowCamera.far = _max.z; + + shadowCamera.updateProjectionMatrix(); + + } + + // For the moment just ignore objects that have multiple materials with different animation methods + // Only the first material will be taken into account for deciding which depth material to use for shadow maps + + function getObjectMaterial( object ) { + + return object.material instanceof THREE.MeshFaceMaterial + ? object.material.materials[ 0 ] + : object.material; + + }; }; -// File:src/renderers/renderables/RenderableFace.js +// File:src/renderers/webgl/plugins/SpritePlugin.js /** - * @author mrdoob / http://mrdoob.com/ + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ */ -THREE.RenderableFace = function () { +THREE.SpritePlugin = function ( renderer, sprites ) { - this.id = 0; + var gl = renderer.context; - this.v1 = new THREE.RenderableVertex(); - this.v2 = new THREE.RenderableVertex(); - this.v3 = new THREE.RenderableVertex(); + var vertexBuffer, elementBuffer; + var program, attributes, uniforms; - this.normalModel = new THREE.Vector3(); + var texture; + + var init = function () { - this.vertexNormalsModel = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; - this.vertexNormalsLength = 0; + var vertices = new Float32Array( [ + - 0.5, - 0.5, 0, 0, + 0.5, - 0.5, 1, 0, + 0.5, 0.5, 1, 1, + - 0.5, 0.5, 0, 1 + ] ); - this.color = new THREE.Color(); - this.material = null; - this.uvs = [ new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2() ]; + var faces = new Uint16Array( [ + 0, 1, 2, + 0, 2, 3 + ] ); - this.z = 0; + vertexBuffer = gl.createBuffer(); + elementBuffer = gl.createBuffer(); -}; + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); -// File:src/renderers/renderables/RenderableObject.js + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); -/** - * @author mrdoob / http://mrdoob.com/ - */ + program = createProgram(); -THREE.RenderableObject = function () { + attributes = { + position: gl.getAttribLocation ( program, 'position' ), + uv: gl.getAttribLocation ( program, 'uv' ) + }; - this.id = 0; + uniforms = { + uvOffset: gl.getUniformLocation( program, 'uvOffset' ), + uvScale: gl.getUniformLocation( program, 'uvScale' ), - this.object = null; - this.z = 0; + rotation: gl.getUniformLocation( program, 'rotation' ), + scale: gl.getUniformLocation( program, 'scale' ), -}; + color: gl.getUniformLocation( program, 'color' ), + map: gl.getUniformLocation( program, 'map' ), + opacity: gl.getUniformLocation( program, 'opacity' ), -// File:src/renderers/renderables/RenderableSprite.js + modelViewMatrix: gl.getUniformLocation( program, 'modelViewMatrix' ), + projectionMatrix: gl.getUniformLocation( program, 'projectionMatrix' ), -/** - * @author mrdoob / http://mrdoob.com/ - */ + fogType: gl.getUniformLocation( program, 'fogType' ), + fogDensity: gl.getUniformLocation( program, 'fogDensity' ), + fogNear: gl.getUniformLocation( program, 'fogNear' ), + fogFar: gl.getUniformLocation( program, 'fogFar' ), + fogColor: gl.getUniformLocation( program, 'fogColor' ), -THREE.RenderableSprite = function () { + alphaTest: gl.getUniformLocation( program, 'alphaTest' ) + }; - this.id = 0; + var canvas = document.createElement( 'canvas' ); + canvas.width = 8; + canvas.height = 8; - this.object = null; + var context = canvas.getContext( '2d' ); + context.fillStyle = 'white'; + context.fillRect( 0, 0, 8, 8 ); - this.x = 0; - this.y = 0; - this.z = 0; + texture = new THREE.Texture( canvas ); + texture.needsUpdate = true; - this.rotation = 0; - this.scale = new THREE.Vector2(); + }; - this.material = null; + this.render = function ( scene, camera ) { -}; + if ( sprites.length === 0 ) return; -// File:src/renderers/renderables/RenderableLine.js + // setup gl -/** - * @author mrdoob / http://mrdoob.com/ - */ + if ( program === undefined ) { -THREE.RenderableLine = function () { + init(); - this.id = 0; + } - this.v1 = new THREE.RenderableVertex(); - this.v2 = new THREE.RenderableVertex(); + gl.useProgram( program ); - this.vertexColors = [ new THREE.Color(), new THREE.Color() ]; - this.material = null; + gl.enableVertexAttribArray( attributes.position ); + gl.enableVertexAttribArray( attributes.uv ); - this.z = 0; + gl.disable( gl.CULL_FACE ); + gl.enable( gl.BLEND ); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.vertexAttribPointer( attributes.position, 2, gl.FLOAT, false, 2 * 8, 0 ); + gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + + gl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera.projectionMatrix.elements ); + + gl.activeTexture( gl.TEXTURE0 ); + gl.uniform1i( uniforms.map, 0 ); + + var oldFogType = 0; + var sceneFogType = 0; + var fog = scene.fog; + + if ( fog ) { + + gl.uniform3f( uniforms.fogColor, fog.color.r, fog.color.g, fog.color.b ); + + if ( fog instanceof THREE.Fog ) { + + gl.uniform1f( uniforms.fogNear, fog.near ); + gl.uniform1f( uniforms.fogFar, fog.far ); + + gl.uniform1i( uniforms.fogType, 1 ); + oldFogType = 1; + sceneFogType = 1; + + } else if ( fog instanceof THREE.FogExp2 ) { + + gl.uniform1f( uniforms.fogDensity, fog.density ); + + gl.uniform1i( uniforms.fogType, 2 ); + oldFogType = 2; + sceneFogType = 2; + + } + + } else { + + gl.uniform1i( uniforms.fogType, 0 ); + oldFogType = 0; + sceneFogType = 0; + + } + + + // update positions and sort + + for ( var i = 0, l = sprites.length; i < l; i ++ ) { + + var sprite = sprites[ i ]; + + sprite._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld ); + + if ( sprite.renderDepth === null ) { + + sprite.z = - sprite._modelViewMatrix.elements[ 14 ]; + + } else { + + sprite.z = sprite.renderDepth; + + } + + } + + sprites.sort( painterSortStable ); + + // render all sprites + + var scale = []; + + for ( var i = 0, l = sprites.length; i < l; i ++ ) { + + var sprite = sprites[ i ]; + var material = sprite.material; + + gl.uniform1f( uniforms.alphaTest, material.alphaTest ); + gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements ); + + scale[ 0 ] = sprite.scale.x; + scale[ 1 ] = sprite.scale.y; + + var fogType = 0; + + if ( scene.fog && material.fog ) { + + fogType = sceneFogType; + + } + + if ( oldFogType !== fogType ) { + + gl.uniform1i( uniforms.fogType, fogType ); + oldFogType = fogType; + + } + + if ( material.map !== null ) { + + gl.uniform2f( uniforms.uvOffset, material.map.offset.x, material.map.offset.y ); + gl.uniform2f( uniforms.uvScale, material.map.repeat.x, material.map.repeat.y ); + + } else { + + gl.uniform2f( uniforms.uvOffset, 0, 0 ); + gl.uniform2f( uniforms.uvScale, 1, 1 ); + + } + + gl.uniform1f( uniforms.opacity, material.opacity ); + gl.uniform3f( uniforms.color, material.color.r, material.color.g, material.color.b ); + + gl.uniform1f( uniforms.rotation, material.rotation ); + gl.uniform2fv( uniforms.scale, scale ); + + renderer.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst ); + renderer.setDepthTest( material.depthTest ); + renderer.setDepthWrite( material.depthWrite ); + + if ( material.map && material.map.image && material.map.image.width ) { + + renderer.setTexture( material.map, 0 ); + + } else { + + renderer.setTexture( texture, 0 ); + + } + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + } + + // restore gl + + gl.enable( gl.CULL_FACE ); + + renderer.resetGLState(); + + }; + + function createProgram () { + + var program = gl.createProgram(); + + var vertexShader = gl.createShader( gl.VERTEX_SHADER ); + var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); + + gl.shaderSource( vertexShader, [ + + 'precision ' + renderer.getPrecision() + ' float;', + + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform float rotation;', + 'uniform vec2 scale;', + 'uniform vec2 uvOffset;', + 'uniform vec2 uvScale;', + + 'attribute vec2 position;', + 'attribute vec2 uv;', + + 'varying vec2 vUV;', + + 'void main() {', + + 'vUV = uvOffset + uv * uvScale;', + + 'vec2 alignedPosition = position * scale;', + + 'vec2 rotatedPosition;', + 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;', + 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;', + + 'vec4 finalPosition;', + + 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );', + 'finalPosition.xy += rotatedPosition;', + 'finalPosition = projectionMatrix * finalPosition;', + + 'gl_Position = finalPosition;', + + '}' + + ].join( '\n' ) ); + + gl.shaderSource( fragmentShader, [ + + 'precision ' + renderer.getPrecision() + ' float;', + + 'uniform vec3 color;', + 'uniform sampler2D map;', + 'uniform float opacity;', + + 'uniform int fogType;', + 'uniform vec3 fogColor;', + 'uniform float fogDensity;', + 'uniform float fogNear;', + 'uniform float fogFar;', + 'uniform float alphaTest;', + + 'varying vec2 vUV;', + + 'void main() {', + + 'vec4 texture = texture2D( map, vUV );', + + 'if ( texture.a < alphaTest ) discard;', + + 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );', + + 'if ( fogType > 0 ) {', + + 'float depth = gl_FragCoord.z / gl_FragCoord.w;', + 'float fogFactor = 0.0;', + + 'if ( fogType == 1 ) {', + + 'fogFactor = smoothstep( fogNear, fogFar, depth );', + + '} else {', + + 'const float LOG2 = 1.442695;', + 'float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );', + 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );', + + '}', + + 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );', + + '}', + + '}' + + ].join( '\n' ) ); + + gl.compileShader( vertexShader ); + gl.compileShader( fragmentShader ); + + gl.attachShader( program, vertexShader ); + gl.attachShader( program, fragmentShader ); + + gl.linkProgram( program ); + + return program; + + }; + + function painterSortStable ( a, b ) { + + if ( a.z !== b.z ) { + + return b.z - a.z; + + } else { + + return b.id - a.id; + + } + + }; }; @@ -26561,6 +26860,139 @@ THREE.FontUtils.generateShapes = function ( text, parameters ) { self._typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace }; THREE.typeface_js = self._typeface_js; +// File:src/extras/audio/Audio.js + +/** + * @author mrdoob / http://mrdoob.com/ + */ + +THREE.Audio = function ( listener ) { + + THREE.Object3D.call( this ); + + this.type = 'Audio'; + + this.context = listener.context; + this.source = this.context.createBufferSource(); + + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); + + this.panner = this.context.createPanner(); + this.panner.connect( this.gain ); + +}; + +THREE.Audio.prototype = Object.create( THREE.Object3D.prototype ); + +THREE.Audio.prototype.load = function ( file ) { + + var scope = this; + + var request = new XMLHttpRequest(); + request.open( 'GET', file, true ); + request.responseType = 'arraybuffer'; + request.onload = function ( e ) { + + scope.context.decodeAudioData( this.response, function ( buffer ) { + + scope.source.buffer = buffer; + scope.source.connect( scope.panner ); + scope.source.start( 0 ); + + } ); + + }; + request.send(); + + return this; + +}; + +THREE.Audio.prototype.setLoop = function ( value ) { + + this.source.loop = value; + +}; + +THREE.Audio.prototype.setRefDistance = function ( value ) { + + this.panner.refDistance = value; + +}; + +THREE.Audio.prototype.setRolloffFactor = function ( value ) { + + this.panner.rolloffFactor = value; + +}; + +THREE.Audio.prototype.updateMatrixWorld = ( function () { + + var position = new THREE.Vector3(); + + return function ( force ) { + + THREE.Object3D.prototype.updateMatrixWorld.call( this, force ); + + position.setFromMatrixPosition( this.matrixWorld ); + + this.panner.setPosition( position.x, position.y, position.z ); + + }; + +} )(); + +// File:src/extras/audio/AudioListener.js + +/** + * @author mrdoob / http://mrdoob.com/ + */ + +THREE.AudioListener = function () { + + THREE.Object3D.call( this ); + + this.type = 'AudioListener'; + + this.context = new ( window.AudioContext || window.webkitAudioContext )(); + +}; + +THREE.AudioListener.prototype = Object.create( THREE.Object3D.prototype ); + +THREE.AudioListener.prototype.updateMatrixWorld = ( function () { + + var position = new THREE.Vector3(); + var quaternion = new THREE.Quaternion(); + var scale = new THREE.Vector3(); + + var orientation = new THREE.Vector3(); + var velocity = new THREE.Vector3(); + + var positionPrev = new THREE.Vector3(); + + return function ( force ) { + + THREE.Object3D.prototype.updateMatrixWorld.call( this, force ); + + var listener = this.context.listener; + + this.matrixWorld.decompose( position, quaternion, scale ); + + orientation.set( 0, 0, -1 ).applyQuaternion( quaternion ); + velocity.subVectors( position, positionPrev ); + + listener.setPosition( position.x, position.y, position.z ); + listener.setOrientation( orientation.x, orientation.y, orientation.z, this.up.x, this.up.y, this.up.z ); + listener.setVelocity( velocity.x, velocity.y, velocity.z ); + + positionPrev.copy( position ); + + }; + +} )(); + // File:src/extras/core/Curve.js /** @@ -26851,8 +27283,8 @@ THREE.Curve.Utils = { 3 * p1 * (1 - t) * (1-t) - 6 *t *p1 * (1-t) + 6 * t * p2 * (1-t) - 3 * t * t * p2 + 3 * t * t * p3; - }, + }, tangentSpline: function ( t, p0, p1, p2, p3 ) { @@ -27241,54 +27673,58 @@ THREE.Gyroscope = function () { THREE.Gyroscope.prototype = Object.create( THREE.Object3D.prototype ); -THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) { +THREE.Gyroscope.prototype.updateMatrixWorld = ( function () { - this.matrixAutoUpdate && this.updateMatrix(); + var translationObject = new THREE.Vector3(); + var quaternionObject = new THREE.Quaternion(); + var scaleObject = new THREE.Vector3(); - // update matrixWorld + var translationWorld = new THREE.Vector3(); + var quaternionWorld = new THREE.Quaternion(); + var scaleWorld = new THREE.Vector3(); - if ( this.matrixWorldNeedsUpdate || force ) { + return function ( force ) { - if ( this.parent ) { + this.matrixAutoUpdate && this.updateMatrix(); - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + // update matrixWorld - this.matrixWorld.decompose( this.translationWorld, this.quaternionWorld, this.scaleWorld ); - this.matrix.decompose( this.translationObject, this.quaternionObject, this.scaleObject ); + if ( this.matrixWorldNeedsUpdate || force ) { - this.matrixWorld.compose( this.translationWorld, this.quaternionObject, this.scaleWorld ); + if ( this.parent ) { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + this.matrixWorld.decompose( translationWorld, quaternionWorld, scaleWorld ); + this.matrix.decompose( translationObject, quaternionObject, scaleObject ); + + this.matrixWorld.compose( translationWorld, quaternionObject, scaleWorld ); - } else { + } else { - this.matrixWorld.copy( this.matrix ); + this.matrixWorld.copy( this.matrix ); + + } + + + this.matrixWorldNeedsUpdate = false; + + force = true; } + // update children - this.matrixWorldNeedsUpdate = false; + for ( var i = 0, l = this.children.length; i < l; i ++ ) { - force = true; + this.children[ i ].updateMatrixWorld( force ); - } - - // update children - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - this.children[ i ].updateMatrixWorld( force ); - - } - -}; - -THREE.Gyroscope.prototype.translationWorld = new THREE.Vector3(); -THREE.Gyroscope.prototype.translationObject = new THREE.Vector3(); -THREE.Gyroscope.prototype.quaternionWorld = new THREE.Quaternion(); -THREE.Gyroscope.prototype.quaternionObject = new THREE.Quaternion(); -THREE.Gyroscope.prototype.scaleWorld = new THREE.Vector3(); -THREE.Gyroscope.prototype.scaleObject = new THREE.Vector3(); + } + }; + +}() ); // File:src/extras/core/Path.js @@ -28607,29 +29043,26 @@ THREE.QuadraticBezierCurve.prototype = Object.create( THREE.Curve.prototype ); THREE.QuadraticBezierCurve.prototype.getPoint = function ( t ) { - var tx, ty; + var vector = new THREE.Vector2(); - tx = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); + vector.x = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); + vector.y = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); - return new THREE.Vector2( tx, ty ); + return vector; }; THREE.QuadraticBezierCurve.prototype.getTangent = function( t ) { - var tx, ty; + var vector = new THREE.Vector2(); - tx = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y ); + vector.x = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ); + vector.y = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y ); // returns unit vector - var tangent = new THREE.Vector2( tx, ty ); - tangent.normalize(); - - return tangent; + return vector.normalize(); }; @@ -28683,7 +29116,7 @@ THREE.CubicBezierCurve.prototype.getTangent = function( t ) { THREE.SplineCurve = function ( points /* array of Vector2 */ ) { - this.points = (points == undefined) ? [] : points; + this.points = ( points == undefined ) ? [] : points; }; @@ -28691,23 +29124,23 @@ THREE.SplineCurve.prototype = Object.create( THREE.Curve.prototype ); THREE.SplineCurve.prototype.getPoint = function ( t ) { - var v = new THREE.Vector2(); - var c = []; - var points = this.points, point, intPoint, weight; - point = ( points.length - 1 ) * t; + var points = this.points; + var point = ( points.length - 1 ) * t; - intPoint = Math.floor( point ); - weight = point - intPoint; + var intPoint = Math.floor( point ); + var weight = point - intPoint; - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > points.length - 2 ? points.length -1 : intPoint + 1; - c[ 3 ] = intPoint > points.length - 3 ? points.length -1 : intPoint + 2; + var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ] + var point1 = points[ intPoint ] + var point2 = points[ intPoint > points.length - 2 ? points.length -1 : intPoint + 1 ] + var point3 = points[ intPoint > points.length - 3 ? points.length -1 : intPoint + 2 ] - v.x = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].x, points[ c[ 1 ] ].x, points[ c[ 2 ] ].x, points[ c[ 3 ] ].x, weight ); - v.y = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].y, points[ c[ 1 ] ].y, points[ c[ 2 ] ].y, points[ c[ 3 ] ].y, weight ); + var vector = new THREE.Vector2(); - return v; + vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight ); + vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight ); + + return vector; }; @@ -28736,12 +29169,13 @@ THREE.EllipseCurve.prototype = Object.create( THREE.Curve.prototype ); THREE.EllipseCurve.prototype.getPoint = function ( t ) { - var angle; var deltaAngle = this.aEndAngle - this.aStartAngle; if ( deltaAngle < 0 ) deltaAngle += Math.PI * 2; if ( deltaAngle > Math.PI * 2 ) deltaAngle -= Math.PI * 2; + var angle; + if ( this.aClockwise === true ) { angle = this.aEndAngle + ( 1 - t ) * ( Math.PI * 2 - deltaAngle ); @@ -28751,11 +29185,13 @@ THREE.EllipseCurve.prototype.getPoint = function ( t ) { angle = this.aStartAngle + t * deltaAngle; } + + var vector = new THREE.Vector2(); - var tx = this.aX + this.xRadius * Math.cos( angle ); - var ty = this.aY + this.yRadius * Math.sin( angle ); + vector.x = this.aX + this.xRadius * Math.cos( angle ); + vector.y = this.aY + this.yRadius * Math.sin( angle ); - return new THREE.Vector2( tx, ty ); + return vector; }; @@ -28789,14 +29225,13 @@ THREE.LineCurve3 = THREE.Curve.create( function ( t ) { - var r = new THREE.Vector3(); + var vector = new THREE.Vector3(); + vector.subVectors( this.v2, this.v1 ); // diff + vector.multiplyScalar( t ); + vector.add( this.v1 ); - r.subVectors( this.v2, this.v1 ); // diff - r.multiplyScalar( t ); - r.add( this.v1 ); - - return r; + return vector; } @@ -28820,13 +29255,13 @@ THREE.QuadraticBezierCurve3 = THREE.Curve.create( function ( t ) { - var tx, ty, tz; + var vector = new THREE.Vector3(); - tx = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); - tz = THREE.Shape.Utils.b2( t, this.v0.z, this.v1.z, this.v2.z ); + vector.x = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); + vector.y = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); + vector.z = THREE.Shape.Utils.b2( t, this.v0.z, this.v1.z, this.v2.z ); - return new THREE.Vector3( tx, ty, tz ); + return vector; } @@ -28851,13 +29286,13 @@ THREE.CubicBezierCurve3 = THREE.Curve.create( function ( t ) { - var tx, ty, tz; + var vector = new THREE.Vector3(); - tx = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ); - ty = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ); - tz = THREE.Shape.Utils.b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z ); + vector.x = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ); + vector.y = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ); + vector.z = THREE.Shape.Utils.b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z ); - return new THREE.Vector3( tx, ty, tz ); + return vector; } @@ -28874,69 +29309,35 @@ THREE.SplineCurve3 = THREE.Curve.create( function ( points /* array of Vector3 */) { - this.points = (points == undefined) ? [] : points; + this.points = ( points == undefined ) ? [] : points; }, function ( t ) { - var v = new THREE.Vector3(); - var c = []; - var points = this.points, point, intPoint, weight; - point = ( points.length - 1 ) * t; + var points = this.points; + var point = ( points.length - 1 ) * t; - intPoint = Math.floor( point ); - weight = point - intPoint; + var intPoint = Math.floor( point ); + var weight = point - intPoint; - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > points.length - 2 ? points.length - 1 : intPoint + 1; - c[ 3 ] = intPoint > points.length - 3 ? points.length - 1 : intPoint + 2; + var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ]; + var point1 = points[ intPoint ]; + var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; - var pt0 = points[ c[0] ], - pt1 = points[ c[1] ], - pt2 = points[ c[2] ], - pt3 = points[ c[3] ]; + var vector = new THREE.Vector3(); - v.x = THREE.Curve.Utils.interpolate(pt0.x, pt1.x, pt2.x, pt3.x, weight); - v.y = THREE.Curve.Utils.interpolate(pt0.y, pt1.y, pt2.y, pt3.y, weight); - v.z = THREE.Curve.Utils.interpolate(pt0.z, pt1.z, pt2.z, pt3.z, weight); + vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight ); + vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight ); + vector.z = THREE.Curve.Utils.interpolate( point0.z, point1.z, point2.z, point3.z, weight ); - return v; + return vector; } ); - -// THREE.SplineCurve3.prototype.getTangent = function(t) { -// var v = new THREE.Vector3(); -// var c = []; -// var points = this.points, point, intPoint, weight; -// point = ( points.length - 1 ) * t; - -// intPoint = Math.floor( point ); -// weight = point - intPoint; - -// c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; -// c[ 1 ] = intPoint; -// c[ 2 ] = intPoint > points.length - 2 ? points.length - 1 : intPoint + 1; -// c[ 3 ] = intPoint > points.length - 3 ? points.length - 1 : intPoint + 2; - -// var pt0 = points[ c[0] ], -// pt1 = points[ c[1] ], -// pt2 = points[ c[2] ], -// pt3 = points[ c[3] ]; - -// // t = weight; -// v.x = THREE.Curve.Utils.tangentSpline( t, pt0.x, pt1.x, pt2.x, pt3.x ); -// v.y = THREE.Curve.Utils.tangentSpline( t, pt0.y, pt1.y, pt2.y, pt3.y ); -// v.z = THREE.Curve.Utils.tangentSpline( t, pt0.z, pt1.z, pt2.z, pt3.z ); - -// return v; - -// } - // File:src/extras/curves/ClosedSplineCurve3.js /************************************************************** @@ -28948,34 +29349,34 @@ THREE.ClosedSplineCurve3 = THREE.Curve.create( function ( points /* array of Vector3 */) { - this.points = (points == undefined) ? [] : points; + this.points = ( points == undefined ) ? [] : points; }, - function ( t ) { + function ( t ) { - var v = new THREE.Vector3(); - var c = []; - var points = this.points, point, intPoint, weight; - point = ( points.length - 0 ) * t; - // This needs to be from 0-length +1 + var points = this.points; + var point = ( points.length - 0 ) * t; // This needs to be from 0-length +1 - intPoint = Math.floor( point ); - weight = point - intPoint; + var intPoint = Math.floor( point ); + var weight = point - intPoint; - intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / points.length ) + 1 ) * points.length; - c[ 0 ] = ( intPoint - 1 ) % points.length; - c[ 1 ] = ( intPoint ) % points.length; - c[ 2 ] = ( intPoint + 1 ) % points.length; - c[ 3 ] = ( intPoint + 2 ) % points.length; + intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / points.length ) + 1 ) * points.length; - v.x = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].x, points[ c[ 1 ] ].x, points[ c[ 2 ] ].x, points[ c[ 3 ] ].x, weight ); - v.y = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].y, points[ c[ 1 ] ].y, points[ c[ 2 ] ].y, points[ c[ 3 ] ].y, weight ); - v.z = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].z, points[ c[ 1 ] ].z, points[ c[ 2 ] ].z, points[ c[ 3 ] ].z, weight ); + var point0 = points[ ( intPoint - 1 ) % points.length ]; + var point1 = points[ ( intPoint ) % points.length ]; + var point2 = points[ ( intPoint + 1 ) % points.length ]; + var point3 = points[ ( intPoint + 2 ) % points.length ]; - return v; + var vector = new THREE.Vector3(); - } + vector.x = THREE.Curve.Utils.interpolate( point0.x, point1.x, point2.x, point3.x, weight ); + vector.y = THREE.Curve.Utils.interpolate( point0.y, point1.y, point2.y, point3.y, weight ); + vector.z = THREE.Curve.Utils.interpolate( point0.z, point1.z, point2.z, point3.z, weight ); + + return vector; + + } ); @@ -29174,6 +29575,12 @@ THREE.AnimationHandler = { update: function ( deltaTimeMS ) { + for ( var i = 0; i < this.animations.length; i ++ ) { + + this.animations[ i ].resetBlendWeights( ); + + } + for ( var i = 0; i < this.animations.length; i ++ ) { this.animations[ i ].update( deltaTimeMS ); @@ -29245,20 +29652,26 @@ THREE.Animation.prototype.reset = function () { if ( object.animationCache === undefined ) { - object.animationCache = {}; + object.animationCache = { + animations: {}, + blending: { + positionWeight: 0.0, + quaternionWeight: 0.0, + scaleWeight: 0.0 + } + }; + } + + if ( object.animationCache.animations[this.data.name] === undefined ) { + + object.animationCache.animations[this.data.name] = {}; + object.animationCache.animations[this.data.name].prevKey = { pos: 0, rot: 0, scl: 0 }; + object.animationCache.animations[this.data.name].nextKey = { pos: 0, rot: 0, scl: 0 }; + object.animationCache.animations[this.data.name].originalMatrix = object.matrix; } - if ( object.animationCache[this.data.name] === undefined ) { - - object.animationCache[this.data.name] = {}; - object.animationCache[this.data.name].prevKey = { pos: 0, rot: 0, scl: 0 }; - object.animationCache[this.data.name].nextKey = { pos: 0, rot: 0, scl: 0 }; - object.animationCache[this.data.name].originalMatrix = object.matrix; - - } - - var animationCache = object.animationCache[this.data.name]; + var animationCache = object.animationCache.animations[this.data.name]; // Get keys to match our current time @@ -29285,6 +29698,23 @@ THREE.Animation.prototype.reset = function () { }; +THREE.Animation.prototype.resetBlendWeights = function () { + + for ( var h = 0, hl = this.hierarchy.length; h < hl; h ++ ) { + + var object = this.hierarchy[ h ]; + + if ( object.animationCache !== undefined ) { + + object.animationCache.blending.positionWeight = 0.0; + object.animationCache.blending.quaternionWeight = 0.0; + object.animationCache.blending.scaleWeight = 0.0; + + } + + } + +}; THREE.Animation.prototype.update = (function(){ @@ -29348,22 +29778,31 @@ THREE.Animation.prototype.update = (function(){ var duration = this.data.length; - if ( this.loop === true && this.currentTime > duration ) { + if ( this.currentTime > duration || this.currentTime < 0 ) { - this.currentTime %= duration; - this.reset(); + if ( this.loop ) { - } else if ( this.loop === false && this.currentTime > duration ) { + this.currentTime %= duration; - this.stop(); - return; + if ( this.currentTime < 0 ) + this.currentTime += duration; + + this.reset(); + + } else { + + this.stop(); + return; + + } } for ( var h = 0, hl = this.hierarchy.length; h < hl; h ++ ) { var object = this.hierarchy[ h ]; - var animationCache = object.animationCache[this.data.name]; + var animationCache = object.animationCache.animations[this.data.name]; + var blending = object.animationCache.blending; // loop through pos/rot/scl @@ -29375,7 +29814,8 @@ THREE.Animation.prototype.update = (function(){ var prevKey = animationCache.prevKey[ type ]; var nextKey = animationCache.nextKey[ type ]; - if ( nextKey.time <= this.currentTime ) { + if ( ( this.timeScale > 0 && nextKey.time <= this.currentTime ) || + ( this.timeScale < 0 && prevKey.time >= this.currentTime ) ) { prevKey = this.data.hierarchy[ h ].keys[ 0 ]; nextKey = this.getNextKeyWith( type, h, 1 ); @@ -29414,17 +29854,9 @@ THREE.Animation.prototype.update = (function(){ newVector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; // blend - if ( object instanceof THREE.Bone ) { - - var proportionalWeight = this.weight / ( this.weight + object.accumulatedPosWeight ); - object.position.lerp( newVector, proportionalWeight ); - object.accumulatedPosWeight += this.weight; - - } else { - - object.position.copy( newVector ); - - } + var proportionalWeight = this.weight / ( this.weight + blending.positionWeight ); + object.position.lerp( newVector, proportionalWeight ); + blending.positionWeight += this.weight; } else if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { @@ -29437,14 +29869,8 @@ THREE.Animation.prototype.update = (function(){ scale = scale * 0.33 + 0.33; var currentPoint = interpolateCatmullRom( points, scale ); - var proportionalWeight = 1; - - if ( object instanceof THREE.Bone ) { - - proportionalWeight = this.weight / ( this.weight + object.accumulatedPosWeight ); - object.accumulatedPosWeight += this.weight; - - } + var proportionalWeight = this.weight / ( this.weight + blending.positionWeight ); + blending.positionWeight += this.weight; // blend @@ -29475,20 +29901,16 @@ THREE.Animation.prototype.update = (function(){ THREE.Quaternion.slerp( prevXYZ, nextXYZ, newQuat, scale ); // Avoid paying the cost of an additional slerp if we don't have to - if ( ! ( object instanceof THREE.Bone ) ) { + if ( blending.quaternionWeight === 0 ) { object.quaternion.copy(newQuat); - - } else if ( object.accumulatedRotWeight === 0 ) { - - object.quaternion.copy(newQuat); - object.accumulatedRotWeight = this.weight; + blending.quaternionWeight = this.weight; } else { - var proportionalWeight = this.weight / ( this.weight + object.accumulatedRotWeight ); + var proportionalWeight = this.weight / ( this.weight + blending.quaternionWeight ); THREE.Quaternion.slerp( object.quaternion, newQuat, object.quaternion, proportionalWeight ); - object.accumulatedRotWeight += this.weight; + blending.quaternionWeight += this.weight; } @@ -29498,17 +29920,9 @@ THREE.Animation.prototype.update = (function(){ newVector.y = prevXYZ[ 1 ] + ( nextXYZ[ 1 ] - prevXYZ[ 1 ] ) * scale; newVector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; - if ( object instanceof THREE.Bone ) { - - var proportionalWeight = this.weight / ( this.weight + object.accumulatedSclWeight); - object.scale.lerp( newVector, proportionalWeight ); - object.accumulatedSclWeight += this.weight; - - } else { - - object.scale.copy( newVector ); - - } + var proportionalWeight = this.weight / ( this.weight + blending.scaleWeight ); + object.scale.lerp( newVector, proportionalWeight ); + blending.scaleWeight += this.weight; } @@ -29921,6 +30335,8 @@ THREE.BoxGeometry = function ( width, height, depth, widthSegments, heightSegmen THREE.Geometry.call( this ); + this.type = 'BoxGeometry'; + this.parameters = { width: width, height: height, @@ -30047,6 +30463,8 @@ THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) { THREE.Geometry.call( this ); + this.type = 'CircleGeometry'; + this.parameters = { radius: radius, segments: segments, @@ -30105,7 +30523,7 @@ THREE.CircleGeometry.prototype = Object.create( THREE.Geometry.prototype ); THREE.CubeGeometry = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) { - console.warn( 'THEE.CubeGeometry has been renamed to THREE.BoxGeometry.' ); + console.warn( 'THREE.CubeGeometry has been renamed to THREE.BoxGeometry.' ); return new THREE.BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ); }; @@ -30120,6 +30538,8 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme THREE.Geometry.call( this ); + this.type = 'CylinderGeometry'; + this.parameters = { radiusTop: radiusTop, radiusBottom: radiusBottom, @@ -30315,6 +30735,8 @@ THREE.ExtrudeGeometry = function ( shapes, options ) { THREE.Geometry.call( this ); + this.type = 'ExtrudeGeometry'; + shapes = shapes instanceof Array ? shapes : [ shapes ]; this.addShapeList( shapes, options ); @@ -30473,7 +30895,6 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { function getBevelVec( inPt, inPrev, inNext ) { var EPSILON = 0.0000000001; - var sign = THREE.Math.sign; // computes for inPt the corresponding point inPt' on a new contour // shiftet by 1 unit (length of normalized vector) to the left @@ -30539,7 +30960,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { if ( v_prev_x < - EPSILON ) { if ( v_next_x < - EPSILON ) { direction_eq = true; } } else { - if ( sign(v_prev_y) == sign(v_next_y) ) { direction_eq = true; } + if ( Math.sign(v_prev_y) == Math.sign(v_next_y) ) { direction_eq = true; } } } @@ -30776,7 +31197,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { for ( i = 0; i < flen; i ++ ) { face = faces[ i ]; - f3( face[ 2 ]+ offset, face[ 1 ]+ offset, face[ 0 ] + offset, true ); + f3( face[ 2 ]+ offset, face[ 1 ]+ offset, face[ 0 ] + offset ); } @@ -30788,7 +31209,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { for ( i = 0; i < flen; i ++ ) { face = faces[ i ]; - f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset, false ); + f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); } @@ -30799,7 +31220,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { for ( i = 0; i < flen; i ++ ) { face = faces[ i ]; - f3( face[ 2 ], face[ 1 ], face[ 0 ], true ); + f3( face[ 2 ], face[ 1 ], face[ 0 ] ); } @@ -30808,7 +31229,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { for ( i = 0; i < flen; i ++ ) { face = faces[ i ]; - f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps, false ); + f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); } } @@ -30874,7 +31295,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { } - function f3( a, b, c, isBottom ) { + function f3( a, b, c ) { a += shapesOffset; b += shapesOffset; @@ -30883,7 +31304,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { // normal, color, material scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) ); - var uvs = isBottom ? uvgen.generateBottomUV( scope, shape, options, a, b, c ) : uvgen.generateTopUV( scope, shape, options, a, b, c ); + var uvs = uvgen.generateTopUV( scope, a, b, c ); scope.faceVertexUvs[ 0 ].push( uvs ); @@ -30899,8 +31320,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) ); scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) ); - var uvs = uvgen.generateSideWallUV( scope, shape, wallContour, options, a, b, c, d, - stepIndex, stepsLength, contourIndex1, contourIndex2 ); + var uvs = uvgen.generateSideWallUV( scope, a, b, c, d ); scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] ); scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] ); @@ -30911,75 +31331,49 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { THREE.ExtrudeGeometry.WorldUVGenerator = { - generateTopUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) { - var ax = geometry.vertices[ indexA ].x, - ay = geometry.vertices[ indexA ].y, + generateTopUV: function ( geometry, indexA, indexB, indexC ) { - bx = geometry.vertices[ indexB ].x, - by = geometry.vertices[ indexB ].y, + var vertices = geometry.vertices; - cx = geometry.vertices[ indexC ].x, - cy = geometry.vertices[ indexC ].y; + var a = vertices[ indexA ]; + var b = vertices[ indexB ]; + var c = vertices[ indexC ]; return [ - new THREE.Vector2( ax, ay ), - new THREE.Vector2( bx, by ), - new THREE.Vector2( cx, cy ) + new THREE.Vector2( a.x, a.y ), + new THREE.Vector2( b.x, b.y ), + new THREE.Vector2( c.x, c.y ) ]; }, - generateBottomUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) { + generateSideWallUV: function ( geometry, indexA, indexB, indexC, indexD ) { - return this.generateTopUV( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ); + var vertices = geometry.vertices; - }, + var a = vertices[ indexA ]; + var b = vertices[ indexB ]; + var c = vertices[ indexC ]; + var d = vertices[ indexD ]; - generateSideWallUV: function( geometry, extrudedShape, wallContour, extrudeOptions, - indexA, indexB, indexC, indexD, stepIndex, stepsLength, - contourIndex1, contourIndex2 ) { - - var ax = geometry.vertices[ indexA ].x, - ay = geometry.vertices[ indexA ].y, - az = geometry.vertices[ indexA ].z, - - bx = geometry.vertices[ indexB ].x, - by = geometry.vertices[ indexB ].y, - bz = geometry.vertices[ indexB ].z, - - cx = geometry.vertices[ indexC ].x, - cy = geometry.vertices[ indexC ].y, - cz = geometry.vertices[ indexC ].z, - - dx = geometry.vertices[ indexD ].x, - dy = geometry.vertices[ indexD ].y, - dz = geometry.vertices[ indexD ].z; - - if ( Math.abs( ay - by ) < 0.01 ) { + if ( Math.abs( a.y - b.y ) < 0.01 ) { return [ - new THREE.Vector2( ax, 1 - az ), - new THREE.Vector2( bx, 1 - bz ), - new THREE.Vector2( cx, 1 - cz ), - new THREE.Vector2( dx, 1 - dz ) + new THREE.Vector2( a.x, 1 - a.z ), + new THREE.Vector2( b.x, 1 - b.z ), + new THREE.Vector2( c.x, 1 - c.z ), + new THREE.Vector2( d.x, 1 - d.z ) ]; } else { return [ - new THREE.Vector2( ay, 1 - az ), - new THREE.Vector2( by, 1 - bz ), - new THREE.Vector2( cy, 1 - cz ), - new THREE.Vector2( dy, 1 - dz ) + new THREE.Vector2( a.y, 1 - a.z ), + new THREE.Vector2( b.y, 1 - b.z ), + new THREE.Vector2( c.y, 1 - c.z ), + new THREE.Vector2( d.y, 1 - d.z ) ]; } } }; -THREE.ExtrudeGeometry.__v1 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v2 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v3 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v4 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v5 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v6 = new THREE.Vector2(); - // File:src/extras/geometries/ShapeGeometry.js /** @@ -31002,6 +31396,8 @@ THREE.ShapeGeometry = function ( shapes, options ) { THREE.Geometry.call( this ); + this.type = 'ShapeGeometry'; + if ( shapes instanceof Array === false ) shapes = [ shapes ]; this.addShapeList( shapes, options ); @@ -31108,7 +31504,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) { var c = face[ 2 ] + shapesOffset; this.faces.push( new THREE.Face3( a, b, c, null, null, material ) ); - this.faceVertexUvs[ 0 ].push( uvgen.generateBottomUV( this, shape, options, a, b, c ) ); + this.faceVertexUvs[ 0 ].push( uvgen.generateTopUV( this, a, b, c ) ); } @@ -31128,10 +31524,20 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) { // phiStart - the starting radian // phiLength - the radian (0 to 2*PI) range of the lathed section // 2*pi is a closed lathe, less than 2PI is a portion. + THREE.LatheGeometry = function ( points, segments, phiStart, phiLength ) { THREE.Geometry.call( this ); + this.type = 'LatheGeometry'; + + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; + segments = segments || 12; phiStart = phiStart || 0; phiLength = phiLength || 2 * Math.PI; @@ -31221,8 +31627,12 @@ THREE.LatheGeometry.prototype = Object.create( THREE.Geometry.prototype ); THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) { + console.info( 'THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.' ); + THREE.Geometry.call( this ); + this.type = 'PlaneGeometry'; + this.parameters = { width: width, height: height, @@ -31230,71 +31640,110 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) heightSegments: heightSegments }; - var ix, iz; - var width_half = width / 2; - var height_half = height / 2; - - var gridX = widthSegments || 1; - var gridZ = heightSegments || 1; - - var gridX1 = gridX + 1; - var gridZ1 = gridZ + 1; - - var segment_width = width / gridX; - var segment_height = height / gridZ; - - var normal = new THREE.Vector3( 0, 0, 1 ); - - for ( iz = 0; iz < gridZ1; iz ++ ) { - - var y = iz * segment_height - height_half; - - for ( ix = 0; ix < gridX1; ix ++ ) { - - var x = ix * segment_width - width_half; - - this.vertices.push( new THREE.Vector3( x, - y, 0 ) ); - - } - - } - - for ( iz = 0; iz < gridZ; iz ++ ) { - - for ( ix = 0; ix < gridX; ix ++ ) { - - var a = ix + gridX1 * iz; - var b = ix + gridX1 * ( iz + 1 ); - var c = ( ix + 1 ) + gridX1 * ( iz + 1 ); - var d = ( ix + 1 ) + gridX1 * iz; - - var uva = new THREE.Vector2( ix / gridX, 1 - iz / gridZ ); - var uvb = new THREE.Vector2( ix / gridX, 1 - ( iz + 1 ) / gridZ ); - var uvc = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - ( iz + 1 ) / gridZ ); - var uvd = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - iz / gridZ ); - - var face = new THREE.Face3( a, b, d ); - face.normal.copy( normal ); - face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() ); - - this.faces.push( face ); - this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] ); - - face = new THREE.Face3( b, c, d ); - face.normal.copy( normal ); - face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() ); - - this.faces.push( face ); - this.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] ); - - } - - } + this.fromBufferGeometry( new THREE.PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); }; THREE.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype ); +// File:src/extras/geometries/PlaneBufferGeometry.js + +/** + * @author mrdoob / http://mrdoob.com/ + * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as + */ + +THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegments ) { + + THREE.BufferGeometry.call( this ); + + this.type = 'PlaneBufferGeometry'; + + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; + + var width_half = width / 2; + var height_half = height / 2; + + var gridX = widthSegments || 1; + var gridY = heightSegments || 1; + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var segment_width = width / gridX; + var segment_height = height / gridY; + + var vertices = new Float32Array( gridX1 * gridY1 * 3 ); + var normals = new Float32Array( gridX1 * gridY1 * 3 ); + var uvs = new Float32Array( gridX1 * gridY1 * 2 ); + + var offset = 0; + var offset2 = 0; + + for ( var iy = 0; iy < gridY1; iy ++ ) { + + var y = iy * segment_height - height_half; + + for ( var ix = 0; ix < gridX1; ix ++ ) { + + var x = ix * segment_width - width_half; + + vertices[ offset ] = x; + vertices[ offset + 1 ] = - y; + + normals[ offset + 2 ] = 1; + + uvs[ offset2 ] = ix / gridX; + uvs[ offset2 + 1 ] = 1 - ( iy / gridY ); + + offset += 3; + offset2 += 2; + + } + + } + + offset = 0; + + var indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 ); + + for ( var iy = 0; iy < gridY; iy ++ ) { + + for ( var ix = 0; ix < gridX; ix ++ ) { + + var a = ix + gridX1 * iy; + var b = ix + gridX1 * ( iy + 1 ); + var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); + var d = ( ix + 1 ) + gridX1 * iy; + + indices[ offset ] = a; + indices[ offset + 1 ] = b; + indices[ offset + 2 ] = d; + + indices[ offset + 3 ] = b; + indices[ offset + 4 ] = c; + indices[ offset + 5 ] = d; + + offset += 6; + + } + + } + + this.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) ); + this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) ); + this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); + +}; + +THREE.PlaneBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); + // File:src/extras/geometries/RingGeometry.js /** @@ -31305,6 +31754,17 @@ THREE.RingGeometry = function ( innerRadius, outerRadius, thetaSegments, phiSegm THREE.Geometry.call( this ); + this.type = 'RingGeometry'; + + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + innerRadius = innerRadius || 0; outerRadius = outerRadius || 50; @@ -31379,6 +31839,8 @@ THREE.SphereGeometry = function ( radius, widthSegments, heightSegments, phiStar THREE.Geometry.call( this ); + this.type = 'SphereGeometry'; + this.parameters = { radius: radius, widthSegments: widthSegments, @@ -31540,6 +32002,8 @@ THREE.TextGeometry = function ( text, parameters ) { THREE.ExtrudeGeometry.call( this, textShapes, parameters ); + this.type = 'TextGeometry'; + }; THREE.TextGeometry.prototype = Object.create( THREE.ExtrudeGeometry.prototype ); @@ -31556,6 +32020,8 @@ THREE.TorusGeometry = function ( radius, tube, radialSegments, tubularSegments, THREE.Geometry.call( this ); + this.type = 'TorusGeometry'; + this.parameters = { radius: radius, tube: tube, @@ -31634,6 +32100,8 @@ THREE.TorusKnotGeometry = function ( radius, tube, radialSegments, tubularSegmen THREE.Geometry.call( this ); + this.type = 'TorusKnotGeometry'; + this.parameters = { radius: radius, tube: tube, @@ -31755,6 +32223,8 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed ) THREE.Geometry.call( this ); + this.type = 'TubeGeometry'; + this.parameters = { path: path, segments: segments, @@ -32031,6 +32501,15 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { THREE.Geometry.call( this ); + this.type = 'PolyhedronGeometry'; + + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; + radius = radius || 1; detail = detail || 0; @@ -32248,6 +32727,64 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { THREE.PolyhedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); +// File:src/extras/geometries/DodecahedronGeometry.js + +/** + * @author Abe Pazos / https://hamoid.com + */ + +THREE.DodecahedronGeometry = function ( radius, detail ) { + + this.parameters = { + radius: radius, + detail: detail + }; + + var t = ( 1 + Math.sqrt( 5 ) ) / 2; + var r = 1 / t; + + var vertices = [ + + // (±1, ±1, ±1) + -1, -1, -1, -1, -1, 1, + -1, 1, -1, -1, 1, 1, + 1, -1, -1, 1, -1, 1, + 1, 1, -1, 1, 1, 1, + + // (0, ±1/φ, ±φ) + 0, -r, -t, 0, -r, t, + 0, r, -t, 0, r, t, + + // (±1/φ, ±φ, 0) + -r, -t, 0, -r, t, 0, + r, -t, 0, r, t, 0, + + // (±φ, 0, ±1/φ) + -t, 0, -r, t, 0, -r, + -t, 0, r, t, 0, r + ]; + + var indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; + + THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail ); + +}; + +THREE.DodecahedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); + // File:src/extras/geometries/IcosahedronGeometry.js /** @@ -32256,11 +32793,6 @@ THREE.PolyhedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); THREE.IcosahedronGeometry = function ( radius, detail ) { - this.parameters = { - radius: radius, - detail: detail - }; - var t = ( 1 + Math.sqrt( 5 ) ) / 2; var vertices = [ @@ -32278,6 +32810,12 @@ THREE.IcosahedronGeometry = function ( radius, detail ) { THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail ); + this.type = 'IcosahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; }; THREE.IcosahedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); @@ -32304,6 +32842,13 @@ THREE.OctahedronGeometry = function ( radius, detail ) { ]; THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail ); + + this.type = 'OctahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; }; THREE.OctahedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); @@ -32326,6 +32871,13 @@ THREE.TetrahedronGeometry = function ( radius, detail ) { THREE.PolyhedronGeometry.call( this, vertices, indices, radius, detail ); + this.type = 'TetrahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + }; THREE.TetrahedronGeometry.prototype = Object.create( THREE.Geometry.prototype ); @@ -32345,6 +32897,14 @@ THREE.ParametricGeometry = function ( func, slices, stacks ) { THREE.Geometry.call( this ); + this.type = 'ParametricGeometry'; + + this.parameters = { + func: func, + slices: slices, + stacks: stacks + }; + var verts = this.vertices; var faces = this.faces; var uvs = this.faceVertexUvs[ 0 ]; @@ -32650,8 +33210,8 @@ THREE.BoxHelper.prototype.update = function ( object ) { this.geometry.computeBoundingSphere(); + this.matrix = object.matrixWorld; this.matrixAutoUpdate = false; - this.matrixWorld = object.matrixWorld; }; @@ -32785,7 +33345,7 @@ THREE.CameraHelper = function ( camera ) { THREE.Line.call( this, geometry, material, THREE.LinePieces ); this.camera = camera; - this.matrixWorld = camera.matrixWorld; + this.matrix = camera.matrixWorld; this.matrixAutoUpdate = false; this.pointMap = pointMap; @@ -32798,13 +33358,33 @@ THREE.CameraHelper.prototype = Object.create( THREE.Line.prototype ); THREE.CameraHelper.prototype.update = function () { + var geometry, pointMap; + var vector = new THREE.Vector3(); var camera = new THREE.Camera(); - var projector = new THREE.Projector(); + + var setPoint = function ( point, x, y, z ) { + + vector.set( x, y, z ).unproject( camera ); + + var points = pointMap[ point ]; + + if ( points !== undefined ) { + + for ( var i = 0, il = points.length; i < il; i ++ ) { + + geometry.vertices[ points[ i ] ].copy( vector ); + + } + + } + + }; return function () { - var scope = this; + geometry = this.geometry; + pointMap = this.pointMap; var w = 1, h = 1; @@ -32821,55 +33401,36 @@ THREE.CameraHelper.prototype.update = function () { // near setPoint( "n1", - w, - h, - 1 ); - setPoint( "n2", w, - h, - 1 ); - setPoint( "n3", - w, h, - 1 ); - setPoint( "n4", w, h, - 1 ); + setPoint( "n2", w, - h, - 1 ); + setPoint( "n3", - w, h, - 1 ); + setPoint( "n4", w, h, - 1 ); // far setPoint( "f1", - w, - h, 1 ); - setPoint( "f2", w, - h, 1 ); - setPoint( "f3", - w, h, 1 ); - setPoint( "f4", w, h, 1 ); + setPoint( "f2", w, - h, 1 ); + setPoint( "f3", - w, h, 1 ); + setPoint( "f4", w, h, 1 ); // up - setPoint( "u1", w * 0.7, h * 1.1, - 1 ); + setPoint( "u1", w * 0.7, h * 1.1, - 1 ); setPoint( "u2", - w * 0.7, h * 1.1, - 1 ); - setPoint( "u3", 0, h * 2, - 1 ); + setPoint( "u3", 0, h * 2, - 1 ); // cross - setPoint( "cf1", - w, 0, 1 ); - setPoint( "cf2", w, 0, 1 ); - setPoint( "cf3", 0, - h, 1 ); - setPoint( "cf4", 0, h, 1 ); + setPoint( "cf1", - w, 0, 1 ); + setPoint( "cf2", w, 0, 1 ); + setPoint( "cf3", 0, - h, 1 ); + setPoint( "cf4", 0, h, 1 ); - setPoint( "cn1", - w, 0, - 1 ); - setPoint( "cn2", w, 0, - 1 ); - setPoint( "cn3", 0, - h, - 1 ); - setPoint( "cn4", 0, h, - 1 ); + setPoint( "cn1", - w, 0, - 1 ); + setPoint( "cn2", w, 0, - 1 ); + setPoint( "cn3", 0, - h, - 1 ); + setPoint( "cn4", 0, h, - 1 ); - function setPoint( point, x, y, z ) { - - vector.set( x, y, z ); - projector.unprojectVector( vector, camera ); - - var points = scope.pointMap[ point ]; - - if ( points !== undefined ) { - - for ( var i = 0, il = points.length; i < il; i ++ ) { - - scope.geometry.vertices[ points[ i ] ].copy( vector ); - - } - - } - - } - - this.geometry.verticesNeedUpdate = true; + geometry.verticesNeedUpdate = true; }; @@ -32890,7 +33451,7 @@ THREE.DirectionalLightHelper = function ( light, size ) { this.light = light; this.light.updateMatrixWorld(); - this.matrixWorld = light.matrixWorld; + this.matrix = light.matrixWorld; this.matrixAutoUpdate = false; size = size || 1; @@ -32929,7 +33490,7 @@ THREE.DirectionalLightHelper = function ( light, size ) { THREE.DirectionalLightHelper.prototype = Object.create( THREE.Object3D.prototype ); THREE.DirectionalLightHelper.prototype.dispose = function () { - + this.lightPlane.geometry.dispose(); this.lightPlane.material.dispose(); this.targetLine.geometry.dispose(); @@ -32955,11 +33516,10 @@ THREE.DirectionalLightHelper.prototype.update = function () { this.targetLine.geometry.verticesNeedUpdate = true; this.targetLine.material.color.copy( this.lightPlane.material.color ); - } + }; }(); - // File:src/extras/helpers/EdgesHelper.js /** @@ -33012,9 +33572,7 @@ THREE.EdgesHelper = function ( object, hex ) { } - geometry.addAttribute( 'position', new THREE.Float32Attribute( numEdges * 2 * 3, 3 ) ); - - var coords = geometry.attributes.position.array; + var coords = new Float32Array( numEdges * 2 * 3 ); var index = 0; @@ -33038,10 +33596,12 @@ THREE.EdgesHelper = function ( object, hex ) { } + geometry.addAttribute( 'position', new THREE.BufferAttribute( coords, 3 ) ); + THREE.Line.call( this, geometry, new THREE.LineBasicMaterial( { color: color } ), THREE.LinePieces ); + this.matrix = object.matrixWorld; this.matrixAutoUpdate = false; - this.matrixWorld = object.matrixWorld; }; @@ -33180,7 +33740,7 @@ THREE.HemisphereLightHelper = function ( light, sphereSize, arrowLength, domeSiz this.light = light; this.light.updateMatrixWorld(); - this.matrixWorld = light.matrixWorld; + this.matrix = light.matrixWorld; this.matrixAutoUpdate = false; this.colors = [ new THREE.Color(), new THREE.Color() ]; @@ -33226,7 +33786,6 @@ THREE.HemisphereLightHelper.prototype.update = function () { }(); - // File:src/extras/helpers/PointLightHelper.js /** @@ -33245,7 +33804,7 @@ THREE.PointLightHelper = function ( light, sphereSize ) { THREE.Mesh.call( this, geometry, material ); - this.matrixWorld = this.light.matrixWorld; + this.matrix = this.light.matrixWorld; this.matrixAutoUpdate = false; /* @@ -33275,7 +33834,7 @@ THREE.PointLightHelper = function ( light, sphereSize ) { THREE.PointLightHelper.prototype = Object.create( THREE.Mesh.prototype ); THREE.PointLightHelper.prototype.dispose = function () { - + this.geometry.dispose(); this.material.dispose(); }; @@ -33301,7 +33860,6 @@ THREE.PointLightHelper.prototype.update = function () { }; - // File:src/extras/helpers/SkeletonHelper.js /** @@ -33338,7 +33896,7 @@ THREE.SkeletonHelper = function ( object ) { this.root = object; - this.matrixWorld = object.matrixWorld; + this.matrix = object.matrixWorld; this.matrixAutoUpdate = false; this.update(); @@ -33417,7 +33975,7 @@ THREE.SpotLightHelper = function ( light ) { this.light = light; this.light.updateMatrixWorld(); - this.matrixWorld = light.matrixWorld; + this.matrix = light.matrixWorld; this.matrixAutoUpdate = false; var geometry = new THREE.CylinderGeometry( 0, 1, 1, 8, 1, true ); @@ -33426,7 +33984,7 @@ THREE.SpotLightHelper = function ( light ) { geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) ); var material = new THREE.MeshBasicMaterial( { wireframe: true, fog: false } ); - + this.cone = new THREE.Mesh( geometry, material ); this.add( this.cone ); @@ -33740,17 +34298,23 @@ THREE.WireframeHelper = function ( object, hex ) { var vertices = object.geometry.attributes.position.array; var indices = object.geometry.attributes.index.array; - var offsets = object.geometry.offsets; + var drawcalls = object.geometry.drawcalls; var numEdges = 0; + if ( drawcalls.length === 0 ) { + + drawcalls = [ { count : indices.length, index : 0, start : 0 } ]; + + } + // allocate maximal size var edges = new Uint32Array( 2 * indices.length ); - for ( var o = 0, ol = offsets.length; o < ol; ++ o ) { + for ( var o = 0, ol = drawcalls.length; o < ol; ++ o ) { - var start = offsets[ o ].start; - var count = offsets[ o ].count; - var index = offsets[ o ].index; + var start = drawcalls[ o ].start; + var count = drawcalls[ o ].count; + var index = drawcalls[ o ].index; for ( var i = start, il = start + count; i < il; i += 3 ) { @@ -33831,8 +34395,8 @@ THREE.WireframeHelper = function ( object, hex ) { THREE.Line.call( this, geometry, new THREE.LineBasicMaterial( { color: color } ), THREE.LinePieces ); + this.matrix = object.matrixWorld; this.matrixAutoUpdate = false; - this.matrixWorld = object.matrixWorld; }; @@ -33854,98 +34418,6 @@ THREE.ImmediateRenderObject = function () { THREE.ImmediateRenderObject.prototype = Object.create( THREE.Object3D.prototype ); -// File:src/extras/objects/LensFlare.js - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.LensFlare = function ( texture, size, distance, blending, color ) { - - THREE.Object3D.call( this ); - - this.lensFlares = []; - - this.positionScreen = new THREE.Vector3(); - this.customUpdateCallback = undefined; - - if( texture !== undefined ) { - - this.add( texture, size, distance, blending, color ); - - } - -}; - -THREE.LensFlare.prototype = Object.create( THREE.Object3D.prototype ); - - -/* - * Add: adds another flare - */ - -THREE.LensFlare.prototype.add = function ( texture, size, distance, blending, color, opacity ) { - - if( size === undefined ) size = - 1; - if( distance === undefined ) distance = 0; - if( opacity === undefined ) opacity = 1; - if( color === undefined ) color = new THREE.Color( 0xffffff ); - if( blending === undefined ) blending = THREE.NormalBlending; - - distance = Math.min( distance, Math.max( 0, distance ) ); - - this.lensFlares.push( { texture: texture, // THREE.Texture - size: size, // size in pixels (-1 = use texture.width) - distance: distance, // distance (0-1) from light source (0=at light source) - x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: 1, // scale - rotation: 1, // rotation - opacity: opacity, // opacity - color: color, // color - blending: blending } ); // blending - -}; - - -/* - * Update lens flares update positions on all flares based on the screen position - * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way. - */ - -THREE.LensFlare.prototype.updateLensFlares = function () { - - var f, fl = this.lensFlares.length; - var flare; - var vecX = - this.positionScreen.x * 2; - var vecY = - this.positionScreen.y * 2; - - for( f = 0; f < fl; f ++ ) { - - flare = this.lensFlares[ f ]; - - flare.x = this.positionScreen.x + vecX * flare.distance; - flare.y = this.positionScreen.y + vecY * flare.distance; - - flare.wantedRotation = flare.x * Math.PI * 0.25; - flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25; - - } - -}; - - - - - - - - - - - - - // File:src/extras/objects/MorphBlendMesh.js /** @@ -34256,1587 +34728,3 @@ THREE.MorphBlendMesh.prototype.update = function ( delta ) { }; -// File:src/extras/renderers/plugins/LensFlarePlugin.js - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.LensFlarePlugin = function () { - - var flares = []; - - var _gl, _renderer, _precision, _lensFlare = {}; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - _precision = renderer.getPrecision(); - - _lensFlare.vertices = new Float32Array( 8 + 8 ); - _lensFlare.faces = new Uint16Array( 6 ); - - var i = 0; - _lensFlare.vertices[ i ++ ] = - 1; _lensFlare.vertices[ i ++ ] = - 1; // vertex - _lensFlare.vertices[ i ++ ] = 0; _lensFlare.vertices[ i ++ ] = 0; // uv... etc. - - _lensFlare.vertices[ i ++ ] = 1; _lensFlare.vertices[ i ++ ] = - 1; - _lensFlare.vertices[ i ++ ] = 1; _lensFlare.vertices[ i ++ ] = 0; - - _lensFlare.vertices[ i ++ ] = 1; _lensFlare.vertices[ i ++ ] = 1; - _lensFlare.vertices[ i ++ ] = 1; _lensFlare.vertices[ i ++ ] = 1; - - _lensFlare.vertices[ i ++ ] = - 1; _lensFlare.vertices[ i ++ ] = 1; - _lensFlare.vertices[ i ++ ] = 0; _lensFlare.vertices[ i ++ ] = 1; - - i = 0; - _lensFlare.faces[ i ++ ] = 0; _lensFlare.faces[ i ++ ] = 1; _lensFlare.faces[ i ++ ] = 2; - _lensFlare.faces[ i ++ ] = 0; _lensFlare.faces[ i ++ ] = 2; _lensFlare.faces[ i ++ ] = 3; - - // buffers - - _lensFlare.vertexBuffer = _gl.createBuffer(); - _lensFlare.elementBuffer = _gl.createBuffer(); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _lensFlare.vertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, _lensFlare.vertices, _gl.STATIC_DRAW ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.elementBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.faces, _gl.STATIC_DRAW ); - - // textures - - _lensFlare.tempTexture = _gl.createTexture(); - _lensFlare.occlusionTexture = _gl.createTexture(); - - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGB, 16, 16, 0, _gl.RGB, _gl.UNSIGNED_BYTE, null ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); - - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.occlusionTexture ); - _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, 16, 16, 0, _gl.RGBA, _gl.UNSIGNED_BYTE, null ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); - - if ( _gl.getParameter( _gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ) <= 0 ) { - - _lensFlare.hasVertexTexture = false; - _lensFlare.program = createProgram( THREE.ShaderFlares[ "lensFlare" ], _precision ); - - } else { - - _lensFlare.hasVertexTexture = true; - _lensFlare.program = createProgram( THREE.ShaderFlares[ "lensFlareVertexTexture" ], _precision ); - - } - - _lensFlare.attributes = {}; - _lensFlare.uniforms = {}; - - _lensFlare.attributes.vertex = _gl.getAttribLocation ( _lensFlare.program, "position" ); - _lensFlare.attributes.uv = _gl.getAttribLocation ( _lensFlare.program, "uv" ); - - _lensFlare.uniforms.renderType = _gl.getUniformLocation( _lensFlare.program, "renderType" ); - _lensFlare.uniforms.map = _gl.getUniformLocation( _lensFlare.program, "map" ); - _lensFlare.uniforms.occlusionMap = _gl.getUniformLocation( _lensFlare.program, "occlusionMap" ); - _lensFlare.uniforms.opacity = _gl.getUniformLocation( _lensFlare.program, "opacity" ); - _lensFlare.uniforms.color = _gl.getUniformLocation( _lensFlare.program, "color" ); - _lensFlare.uniforms.scale = _gl.getUniformLocation( _lensFlare.program, "scale" ); - _lensFlare.uniforms.rotation = _gl.getUniformLocation( _lensFlare.program, "rotation" ); - _lensFlare.uniforms.screenPosition = _gl.getUniformLocation( _lensFlare.program, "screenPosition" ); - - }; - - - /* - * Render lens flares - * Method: renders 16x16 0xff00ff-colored points scattered over the light source area, - * reads these back and calculates occlusion. - * Then _lensFlare.update_lensFlares() is called to re-position and - * update transparency of flares. Then they are rendered. - * - */ - - this.render = function ( scene, camera, viewportWidth, viewportHeight ) { - - flares.length = 0; - - scene.traverseVisible( function ( child ) { - - if ( child instanceof THREE.LensFlare ) { - - flares.push( child ); - - } - - } ); - - if ( flares.length === 0 ) return; - - var tempPosition = new THREE.Vector3(); - - var invAspect = viewportHeight / viewportWidth, - halfViewportWidth = viewportWidth * 0.5, - halfViewportHeight = viewportHeight * 0.5; - - var size = 16 / viewportHeight, - scale = new THREE.Vector2( size * invAspect, size ); - - var screenPosition = new THREE.Vector3( 1, 1, 0 ), - screenPositionPixels = new THREE.Vector2( 1, 1 ); - - var uniforms = _lensFlare.uniforms, - attributes = _lensFlare.attributes; - - // set _lensFlare program and reset blending - - _gl.useProgram( _lensFlare.program ); - - _gl.enableVertexAttribArray( _lensFlare.attributes.vertex ); - _gl.enableVertexAttribArray( _lensFlare.attributes.uv ); - - // loop through all lens flares to update their occlusion and positions - // setup gl and common used attribs/unforms - - _gl.uniform1i( uniforms.occlusionMap, 0 ); - _gl.uniform1i( uniforms.map, 1 ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _lensFlare.vertexBuffer ); - _gl.vertexAttribPointer( attributes.vertex, 2, _gl.FLOAT, false, 2 * 8, 0 ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 2 * 8, 8 ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.elementBuffer ); - - _gl.disable( _gl.CULL_FACE ); - _gl.depthMask( false ); - - for ( var i = 0, l = flares.length; i < l; i ++ ) { - - size = 16 / viewportHeight; - scale.set( size * invAspect, size ); - - // calc object screen position - - var flare = flares[ i ]; - - tempPosition.set( flare.matrixWorld.elements[12], flare.matrixWorld.elements[13], flare.matrixWorld.elements[14] ); - - tempPosition.applyMatrix4( camera.matrixWorldInverse ); - tempPosition.applyProjection( camera.projectionMatrix ); - - // setup arrays for gl programs - - screenPosition.copy( tempPosition ) - - screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth; - screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight; - - // screen cull - - if ( _lensFlare.hasVertexTexture || ( - screenPositionPixels.x > 0 && - screenPositionPixels.x < viewportWidth && - screenPositionPixels.y > 0 && - screenPositionPixels.y < viewportHeight ) ) { - - // save current RGB to temp texture - - _gl.activeTexture( _gl.TEXTURE1 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.copyTexImage2D( _gl.TEXTURE_2D, 0, _gl.RGB, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); - - - // render pink quad - - _gl.uniform1i( uniforms.renderType, 0 ); - _gl.uniform2f( uniforms.scale, scale.x, scale.y ); - _gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); - - _gl.disable( _gl.BLEND ); - _gl.enable( _gl.DEPTH_TEST ); - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - - // copy result to occlusionMap - - _gl.activeTexture( _gl.TEXTURE0 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.occlusionTexture ); - _gl.copyTexImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); - - - // restore graphics - - _gl.uniform1i( uniforms.renderType, 1 ); - _gl.disable( _gl.DEPTH_TEST ); - - _gl.activeTexture( _gl.TEXTURE1 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - - // update object positions - - flare.positionScreen.copy( screenPosition ) - - if ( flare.customUpdateCallback ) { - - flare.customUpdateCallback( flare ); - - } else { - - flare.updateLensFlares(); - - } - - // render flares - - _gl.uniform1i( uniforms.renderType, 2 ); - _gl.enable( _gl.BLEND ); - - for ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) { - - var sprite = flare.lensFlares[ j ]; - - if ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) { - - screenPosition.x = sprite.x; - screenPosition.y = sprite.y; - screenPosition.z = sprite.z; - - size = sprite.size * sprite.scale / viewportHeight; - - scale.x = size * invAspect; - scale.y = size; - - _gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); - _gl.uniform2f( uniforms.scale, scale.x, scale.y ); - _gl.uniform1f( uniforms.rotation, sprite.rotation ); - - _gl.uniform1f( uniforms.opacity, sprite.opacity ); - _gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); - - _renderer.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst ); - _renderer.setTexture( sprite.texture, 1 ); - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - } - - } - - } - - } - - // restore gl - - _gl.enable( _gl.CULL_FACE ); - _gl.enable( _gl.DEPTH_TEST ); - _gl.depthMask( true ); - - }; - - function createProgram ( shader, precision ) { - - var program = _gl.createProgram(); - - var fragmentShader = _gl.createShader( _gl.FRAGMENT_SHADER ); - var vertexShader = _gl.createShader( _gl.VERTEX_SHADER ); - - var prefix = "precision " + precision + " float;\n"; - - _gl.shaderSource( fragmentShader, prefix + shader.fragmentShader ); - _gl.shaderSource( vertexShader, prefix + shader.vertexShader ); - - _gl.compileShader( fragmentShader ); - _gl.compileShader( vertexShader ); - - _gl.attachShader( program, fragmentShader ); - _gl.attachShader( program, vertexShader ); - - _gl.linkProgram( program ); - - return program; - - }; - -}; - -// File:src/extras/renderers/plugins/ShadowMapPlugin.js - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.ShadowMapPlugin = function () { - - var _gl, - _renderer, - _depthMaterial, _depthMaterialMorph, _depthMaterialSkin, _depthMaterialMorphSkin, - - _frustum = new THREE.Frustum(), - _projScreenMatrix = new THREE.Matrix4(), - - _min = new THREE.Vector3(), - _max = new THREE.Vector3(), - - _matrixPosition = new THREE.Vector3(), - - _renderList = []; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - var depthShader = THREE.ShaderLib[ "depthRGBA" ]; - var depthUniforms = THREE.UniformsUtils.clone( depthShader.uniforms ); - - _depthMaterial = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms } ); - _depthMaterialMorph = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, morphTargets: true } ); - _depthMaterialSkin = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, skinning: true } ); - _depthMaterialMorphSkin = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, morphTargets: true, skinning: true } ); - - _depthMaterial._shadowPass = true; - _depthMaterialMorph._shadowPass = true; - _depthMaterialSkin._shadowPass = true; - _depthMaterialMorphSkin._shadowPass = true; - - }; - - this.render = function ( scene, camera ) { - - if ( ! ( _renderer.shadowMapEnabled && _renderer.shadowMapAutoUpdate ) ) return; - - this.update( scene, camera ); - - }; - - this.update = function ( scene, camera ) { - - var i, il, j, jl, n, - - shadowMap, shadowMatrix, shadowCamera, - program, buffer, material, - webglObject, object, light, - - lights = [], - k = 0, - - fog = null; - - // set GL state for depth map - - _gl.clearColor( 1, 1, 1, 1 ); - _gl.disable( _gl.BLEND ); - - _gl.enable( _gl.CULL_FACE ); - _gl.frontFace( _gl.CCW ); - - if ( _renderer.shadowMapCullFace === THREE.CullFaceFront ) { - - _gl.cullFace( _gl.FRONT ); - - } else { - - _gl.cullFace( _gl.BACK ); - - } - - _renderer.setDepthTest( true ); - - // preprocess lights - // - skip lights that are not casting shadows - // - create virtual lights for cascaded shadow maps - - for ( i = 0, il = scene.__lights.length; i < il; i ++ ) { - - light = scene.__lights[ i ]; - - if ( ! light.castShadow ) continue; - - if ( ( light instanceof THREE.DirectionalLight ) && light.shadowCascade ) { - - for ( n = 0; n < light.shadowCascadeCount; n ++ ) { - - var virtualLight; - - if ( ! light.shadowCascadeArray[ n ] ) { - - virtualLight = createVirtualLight( light, n ); - virtualLight.originalCamera = camera; - - var gyro = new THREE.Gyroscope(); - gyro.position.copy( light.shadowCascadeOffset ); - - gyro.add( virtualLight ); - gyro.add( virtualLight.target ); - - camera.add( gyro ); - - light.shadowCascadeArray[ n ] = virtualLight; - - console.log( "Created virtualLight", virtualLight ); - - } else { - - virtualLight = light.shadowCascadeArray[ n ]; - - } - - updateVirtualLight( light, n ); - - lights[ k ] = virtualLight; - k ++; - - } - - } else { - - lights[ k ] = light; - k ++; - - } - - } - - // render depth map - - for ( i = 0, il = lights.length; i < il; i ++ ) { - - light = lights[ i ]; - - if ( ! light.shadowMap ) { - - var shadowFilter = THREE.LinearFilter; - - if ( _renderer.shadowMapType === THREE.PCFSoftShadowMap ) { - - shadowFilter = THREE.NearestFilter; - - } - - var pars = { minFilter: shadowFilter, magFilter: shadowFilter, format: THREE.RGBAFormat }; - - light.shadowMap = new THREE.WebGLRenderTarget( light.shadowMapWidth, light.shadowMapHeight, pars ); - light.shadowMapSize = new THREE.Vector2( light.shadowMapWidth, light.shadowMapHeight ); - - light.shadowMatrix = new THREE.Matrix4(); - - } - - if ( ! light.shadowCamera ) { - - if ( light instanceof THREE.SpotLight ) { - - light.shadowCamera = new THREE.PerspectiveCamera( light.shadowCameraFov, light.shadowMapWidth / light.shadowMapHeight, light.shadowCameraNear, light.shadowCameraFar ); - - } else if ( light instanceof THREE.DirectionalLight ) { - - light.shadowCamera = new THREE.OrthographicCamera( light.shadowCameraLeft, light.shadowCameraRight, light.shadowCameraTop, light.shadowCameraBottom, light.shadowCameraNear, light.shadowCameraFar ); - - } else { - - console.error( "Unsupported light type for shadow" ); - continue; - - } - - scene.add( light.shadowCamera ); - - if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); - - } - - if ( light.shadowCameraVisible && ! light.cameraHelper ) { - - light.cameraHelper = new THREE.CameraHelper( light.shadowCamera ); - light.shadowCamera.add( light.cameraHelper ); - - } - - if ( light.isVirtual && virtualLight.originalCamera == camera ) { - - updateShadowCamera( camera, light ); - - } - - shadowMap = light.shadowMap; - shadowMatrix = light.shadowMatrix; - shadowCamera = light.shadowCamera; - - shadowCamera.position.setFromMatrixPosition( light.matrixWorld ); - _matrixPosition.setFromMatrixPosition( light.target.matrixWorld ); - shadowCamera.lookAt( _matrixPosition ); - shadowCamera.updateMatrixWorld(); - - shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld ); - - if ( light.cameraHelper ) light.cameraHelper.visible = light.shadowCameraVisible; - if ( light.shadowCameraVisible ) light.cameraHelper.update(); - - // compute shadow matrix - - shadowMatrix.set( 0.5, 0.0, 0.0, 0.5, - 0.0, 0.5, 0.0, 0.5, - 0.0, 0.0, 0.5, 0.5, - 0.0, 0.0, 0.0, 1.0 ); - - shadowMatrix.multiply( shadowCamera.projectionMatrix ); - shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); - - // update camera matrices and frustum - - _projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); - - // render shadow map - - _renderer.setRenderTarget( shadowMap ); - _renderer.clear(); - - // set object matrices & frustum culling - - _renderList.length = 0; - projectObject(scene,scene,shadowCamera); - - - // render regular objects - - var objectMaterial, useMorphing, useSkinning; - - for ( j = 0, jl = _renderList.length; j < jl; j ++ ) { - - webglObject = _renderList[ j ]; - - object = webglObject.object; - buffer = webglObject.buffer; - - // culling is overriden globally for all objects - // while rendering depth map - - // need to deal with MeshFaceMaterial somehow - // in that case just use the first of material.materials for now - // (proper solution would require to break objects by materials - // similarly to regular rendering and then set corresponding - // depth materials per each chunk instead of just once per object) - - objectMaterial = getObjectMaterial( object ); - - useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets; - useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning; - - if ( object.customDepthMaterial ) { - - material = object.customDepthMaterial; - - } else if ( useSkinning ) { - - material = useMorphing ? _depthMaterialMorphSkin : _depthMaterialSkin; - - } else if ( useMorphing ) { - - material = _depthMaterialMorph; - - } else { - - material = _depthMaterial; - - } - - _renderer.setMaterialFaces( objectMaterial ); - - if ( buffer instanceof THREE.BufferGeometry ) { - - _renderer.renderBufferDirect( shadowCamera, scene.__lights, fog, material, buffer, object ); - - } else { - - _renderer.renderBuffer( shadowCamera, scene.__lights, fog, material, buffer, object ); - - } - - } - - // set matrices and render immediate objects - - var renderList = scene.__webglObjectsImmediate; - - for ( j = 0, jl = renderList.length; j < jl; j ++ ) { - - webglObject = renderList[ j ]; - object = webglObject.object; - - if ( object.visible && object.castShadow ) { - - object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); - - _renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object ); - - } - - } - - } - - // restore GL state - - var clearColor = _renderer.getClearColor(), - clearAlpha = _renderer.getClearAlpha(); - - _gl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha ); - _gl.enable( _gl.BLEND ); - - if ( _renderer.shadowMapCullFace === THREE.CullFaceFront ) { - - _gl.cullFace( _gl.BACK ); - - } - - }; - - function projectObject(scene, object,shadowCamera){ - - if ( object.visible ) { - - var webglObjects = scene.__webglObjects[object.id]; - - if (webglObjects && object.castShadow && (object.frustumCulled === false || _frustum.intersectsObject( object ) === true) ) { - - - for (var i = 0, l = webglObjects.length; i < l; i++){ - - var webglObject = webglObjects[i]; - - object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); - _renderList.push(webglObject); - - } - } - - for(var i = 0, l = object.children.length; i < l; i++) { - - projectObject(scene, object.children[i],shadowCamera); - } - - } - } - - function createVirtualLight( light, cascade ) { - - var virtualLight = new THREE.DirectionalLight(); - - virtualLight.isVirtual = true; - - virtualLight.onlyShadow = true; - virtualLight.castShadow = true; - - virtualLight.shadowCameraNear = light.shadowCameraNear; - virtualLight.shadowCameraFar = light.shadowCameraFar; - - virtualLight.shadowCameraLeft = light.shadowCameraLeft; - virtualLight.shadowCameraRight = light.shadowCameraRight; - virtualLight.shadowCameraBottom = light.shadowCameraBottom; - virtualLight.shadowCameraTop = light.shadowCameraTop; - - virtualLight.shadowCameraVisible = light.shadowCameraVisible; - - virtualLight.shadowDarkness = light.shadowDarkness; - - virtualLight.shadowBias = light.shadowCascadeBias[ cascade ]; - virtualLight.shadowMapWidth = light.shadowCascadeWidth[ cascade ]; - virtualLight.shadowMapHeight = light.shadowCascadeHeight[ cascade ]; - - virtualLight.pointsWorld = []; - virtualLight.pointsFrustum = []; - - var pointsWorld = virtualLight.pointsWorld, - pointsFrustum = virtualLight.pointsFrustum; - - for ( var i = 0; i < 8; i ++ ) { - - pointsWorld[ i ] = new THREE.Vector3(); - pointsFrustum[ i ] = new THREE.Vector3(); - - } - - var nearZ = light.shadowCascadeNearZ[ cascade ]; - var farZ = light.shadowCascadeFarZ[ cascade ]; - - pointsFrustum[ 0 ].set( - 1, - 1, nearZ ); - pointsFrustum[ 1 ].set( 1, - 1, nearZ ); - pointsFrustum[ 2 ].set( - 1, 1, nearZ ); - pointsFrustum[ 3 ].set( 1, 1, nearZ ); - - pointsFrustum[ 4 ].set( - 1, - 1, farZ ); - pointsFrustum[ 5 ].set( 1, - 1, farZ ); - pointsFrustum[ 6 ].set( - 1, 1, farZ ); - pointsFrustum[ 7 ].set( 1, 1, farZ ); - - return virtualLight; - - } - - // Synchronize virtual light with the original light - - function updateVirtualLight( light, cascade ) { - - var virtualLight = light.shadowCascadeArray[ cascade ]; - - virtualLight.position.copy( light.position ); - virtualLight.target.position.copy( light.target.position ); - virtualLight.lookAt( virtualLight.target ); - - virtualLight.shadowCameraVisible = light.shadowCameraVisible; - virtualLight.shadowDarkness = light.shadowDarkness; - - virtualLight.shadowBias = light.shadowCascadeBias[ cascade ]; - - var nearZ = light.shadowCascadeNearZ[ cascade ]; - var farZ = light.shadowCascadeFarZ[ cascade ]; - - var pointsFrustum = virtualLight.pointsFrustum; - - pointsFrustum[ 0 ].z = nearZ; - pointsFrustum[ 1 ].z = nearZ; - pointsFrustum[ 2 ].z = nearZ; - pointsFrustum[ 3 ].z = nearZ; - - pointsFrustum[ 4 ].z = farZ; - pointsFrustum[ 5 ].z = farZ; - pointsFrustum[ 6 ].z = farZ; - pointsFrustum[ 7 ].z = farZ; - - } - - // Fit shadow camera's ortho frustum to camera frustum - - function updateShadowCamera( camera, light ) { - - var shadowCamera = light.shadowCamera, - pointsFrustum = light.pointsFrustum, - pointsWorld = light.pointsWorld; - - _min.set( Infinity, Infinity, Infinity ); - _max.set( - Infinity, - Infinity, - Infinity ); - - for ( var i = 0; i < 8; i ++ ) { - - var p = pointsWorld[ i ]; - - p.copy( pointsFrustum[ i ] ); - THREE.ShadowMapPlugin.__projector.unprojectVector( p, camera ); - - p.applyMatrix4( shadowCamera.matrixWorldInverse ); - - if ( p.x < _min.x ) _min.x = p.x; - if ( p.x > _max.x ) _max.x = p.x; - - if ( p.y < _min.y ) _min.y = p.y; - if ( p.y > _max.y ) _max.y = p.y; - - if ( p.z < _min.z ) _min.z = p.z; - if ( p.z > _max.z ) _max.z = p.z; - - } - - shadowCamera.left = _min.x; - shadowCamera.right = _max.x; - shadowCamera.top = _max.y; - shadowCamera.bottom = _min.y; - - // can't really fit near/far - //shadowCamera.near = _min.z; - //shadowCamera.far = _max.z; - - shadowCamera.updateProjectionMatrix(); - - } - - // For the moment just ignore objects that have multiple materials with different animation methods - // Only the first material will be taken into account for deciding which depth material to use for shadow maps - - function getObjectMaterial( object ) { - - return object.material instanceof THREE.MeshFaceMaterial - ? object.material.materials[ 0 ] - : object.material; - - }; - -}; - -THREE.ShadowMapPlugin.__projector = new THREE.Projector(); - -// File:src/extras/renderers/plugins/SpritePlugin.js - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SpritePlugin = function () { - - var _gl, _renderer, _texture; - - var sprites = []; - - var vertices, faces, vertexBuffer, elementBuffer; - var program, attributes, uniforms; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - vertices = new Float32Array( [ - - 0.5, - 0.5, 0, 0, - 0.5, - 0.5, 1, 0, - 0.5, 0.5, 1, 1, - - 0.5, 0.5, 0, 1 - ] ); - - faces = new Uint16Array( [ - 0, 1, 2, - 0, 2, 3 - ] ); - - vertexBuffer = _gl.createBuffer(); - elementBuffer = _gl.createBuffer(); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, vertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, vertices, _gl.STATIC_DRAW ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, faces, _gl.STATIC_DRAW ); - - program = createProgram(); - - attributes = { - position: _gl.getAttribLocation ( program, 'position' ), - uv: _gl.getAttribLocation ( program, 'uv' ) - }; - - uniforms = { - uvOffset: _gl.getUniformLocation( program, 'uvOffset' ), - uvScale: _gl.getUniformLocation( program, 'uvScale' ), - - rotation: _gl.getUniformLocation( program, 'rotation' ), - scale: _gl.getUniformLocation( program, 'scale' ), - - color: _gl.getUniformLocation( program, 'color' ), - map: _gl.getUniformLocation( program, 'map' ), - opacity: _gl.getUniformLocation( program, 'opacity' ), - - modelViewMatrix: _gl.getUniformLocation( program, 'modelViewMatrix' ), - projectionMatrix: _gl.getUniformLocation( program, 'projectionMatrix' ), - - fogType: _gl.getUniformLocation( program, 'fogType' ), - fogDensity: _gl.getUniformLocation( program, 'fogDensity' ), - fogNear: _gl.getUniformLocation( program, 'fogNear' ), - fogFar: _gl.getUniformLocation( program, 'fogFar' ), - fogColor: _gl.getUniformLocation( program, 'fogColor' ), - - alphaTest: _gl.getUniformLocation( program, 'alphaTest' ) - }; - - var canvas = document.createElement( 'canvas' ); - canvas.width = 8; - canvas.height = 8; - - var context = canvas.getContext( '2d' ); - context.fillStyle = 'white'; - context.fillRect( 0, 0, 8, 8 ); - - _texture = new THREE.Texture( canvas ); - _texture.needsUpdate = true; - - }; - - this.render = function ( scene, camera, viewportWidth, viewportHeight ) { - - sprites.length = 0; - - scene.traverseVisible( function ( child ) { - - if ( child instanceof THREE.Sprite ) { - - sprites.push( child ); - - } - - } ); - - if ( sprites.length === 0 ) return; - - // setup gl - - _gl.useProgram( program ); - - _gl.enableVertexAttribArray( attributes.position ); - _gl.enableVertexAttribArray( attributes.uv ); - - _gl.disable( _gl.CULL_FACE ); - _gl.enable( _gl.BLEND ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, vertexBuffer ); - _gl.vertexAttribPointer( attributes.position, 2, _gl.FLOAT, false, 2 * 8, 0 ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 2 * 8, 8 ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); - - _gl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera.projectionMatrix.elements ); - - _gl.activeTexture( _gl.TEXTURE0 ); - _gl.uniform1i( uniforms.map, 0 ); - - var oldFogType = 0; - var sceneFogType = 0; - var fog = scene.fog; - - if ( fog ) { - - _gl.uniform3f( uniforms.fogColor, fog.color.r, fog.color.g, fog.color.b ); - - if ( fog instanceof THREE.Fog ) { - - _gl.uniform1f( uniforms.fogNear, fog.near ); - _gl.uniform1f( uniforms.fogFar, fog.far ); - - _gl.uniform1i( uniforms.fogType, 1 ); - oldFogType = 1; - sceneFogType = 1; - - } else if ( fog instanceof THREE.FogExp2 ) { - - _gl.uniform1f( uniforms.fogDensity, fog.density ); - - _gl.uniform1i( uniforms.fogType, 2 ); - oldFogType = 2; - sceneFogType = 2; - - } - - } else { - - _gl.uniform1i( uniforms.fogType, 0 ); - oldFogType = 0; - sceneFogType = 0; - - } - - - // update positions and sort - - for ( var i = 0, l = sprites.length; i < l; i ++ ) { - - var sprite = sprites[ i ]; - var material = sprite.material; - - sprite._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld ); - sprite.z = - sprite._modelViewMatrix.elements[ 14 ]; - - } - - sprites.sort( painterSortStable ); - - // render all sprites - - var scale = []; - - for ( var i = 0, l = sprites.length; i < l; i ++ ) { - - var sprite = sprites[ i ]; - var material = sprite.material; - - _gl.uniform1f( uniforms.alphaTest, material.alphaTest ); - _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements ); - - scale[ 0 ] = sprite.scale.x; - scale[ 1 ] = sprite.scale.y; - - var fogType = 0; - - if ( scene.fog && material.fog ) { - - fogType = sceneFogType; - - } - - if ( oldFogType !== fogType ) { - - _gl.uniform1i( uniforms.fogType, fogType ); - oldFogType = fogType; - - } - - if ( material.map !== null ) { - - _gl.uniform2f( uniforms.uvOffset, material.map.offset.x, material.map.offset.y ); - _gl.uniform2f( uniforms.uvScale, material.map.repeat.x, material.map.repeat.y ); - - } else { - - _gl.uniform2f( uniforms.uvOffset, 0, 0 ); - _gl.uniform2f( uniforms.uvScale, 1, 1 ); - - } - - _gl.uniform1f( uniforms.opacity, material.opacity ); - _gl.uniform3f( uniforms.color, material.color.r, material.color.g, material.color.b ); - - _gl.uniform1f( uniforms.rotation, material.rotation ); - _gl.uniform2fv( uniforms.scale, scale ); - - _renderer.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst ); - _renderer.setDepthTest( material.depthTest ); - _renderer.setDepthWrite( material.depthWrite ); - - if ( material.map && material.map.image && material.map.image.width ) { - - _renderer.setTexture( material.map, 0 ); - - } else { - - _renderer.setTexture( _texture, 0 ); - - } - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - } - - // restore gl - - _gl.enable( _gl.CULL_FACE ); - - }; - - function createProgram () { - - var program = _gl.createProgram(); - - var vertexShader = _gl.createShader( _gl.VERTEX_SHADER ); - var fragmentShader = _gl.createShader( _gl.FRAGMENT_SHADER ); - - _gl.shaderSource( vertexShader, [ - - 'precision ' + _renderer.getPrecision() + ' float;', - - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform float rotation;', - 'uniform vec2 scale;', - 'uniform vec2 uvOffset;', - 'uniform vec2 uvScale;', - - 'attribute vec2 position;', - 'attribute vec2 uv;', - - 'varying vec2 vUV;', - - 'void main() {', - - 'vUV = uvOffset + uv * uvScale;', - - 'vec2 alignedPosition = position * scale;', - - 'vec2 rotatedPosition;', - 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;', - 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;', - - 'vec4 finalPosition;', - - 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );', - 'finalPosition.xy += rotatedPosition;', - 'finalPosition = projectionMatrix * finalPosition;', - - 'gl_Position = finalPosition;', - - '}' - - ].join( '\n' ) ); - - _gl.shaderSource( fragmentShader, [ - - 'precision ' + _renderer.getPrecision() + ' float;', - - 'uniform vec3 color;', - 'uniform sampler2D map;', - 'uniform float opacity;', - - 'uniform int fogType;', - 'uniform vec3 fogColor;', - 'uniform float fogDensity;', - 'uniform float fogNear;', - 'uniform float fogFar;', - 'uniform float alphaTest;', - - 'varying vec2 vUV;', - - 'void main() {', - - 'vec4 texture = texture2D( map, vUV );', - - 'if ( texture.a < alphaTest ) discard;', - - 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );', - - 'if ( fogType > 0 ) {', - - 'float depth = gl_FragCoord.z / gl_FragCoord.w;', - 'float fogFactor = 0.0;', - - 'if ( fogType == 1 ) {', - - 'fogFactor = smoothstep( fogNear, fogFar, depth );', - - '} else {', - - 'const float LOG2 = 1.442695;', - 'float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );', - 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );', - - '}', - - 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );', - - '}', - - '}' - - ].join( '\n' ) ); - - _gl.compileShader( vertexShader ); - _gl.compileShader( fragmentShader ); - - _gl.attachShader( program, vertexShader ); - _gl.attachShader( program, fragmentShader ); - - _gl.linkProgram( program ); - - return program; - - }; - - function painterSortStable ( a, b ) { - - if ( a.z !== b.z ) { - - return b.z - a.z; - - } else { - - return b.id - a.id; - - } - - }; - -}; - -// File:src/extras/renderers/plugins/DepthPassPlugin.js - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.DepthPassPlugin = function () { - - this.enabled = false; - this.renderTarget = null; - - var _gl, - _renderer, - _depthMaterial, _depthMaterialMorph, _depthMaterialSkin, _depthMaterialMorphSkin, - - _frustum = new THREE.Frustum(), - _projScreenMatrix = new THREE.Matrix4(), - _renderList = []; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - var depthShader = THREE.ShaderLib[ "depthRGBA" ]; - var depthUniforms = THREE.UniformsUtils.clone( depthShader.uniforms ); - - _depthMaterial = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms } ); - _depthMaterialMorph = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, morphTargets: true } ); - _depthMaterialSkin = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, skinning: true } ); - _depthMaterialMorphSkin = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, morphTargets: true, skinning: true } ); - - _depthMaterial._shadowPass = true; - _depthMaterialMorph._shadowPass = true; - _depthMaterialSkin._shadowPass = true; - _depthMaterialMorphSkin._shadowPass = true; - - }; - - this.render = function ( scene, camera ) { - - if ( ! this.enabled ) return; - - this.update( scene, camera ); - - }; - - this.update = function ( scene, camera ) { - - var i, il, j, jl, n, - - program, buffer, material, - webglObject, object, light, - renderList, - - fog = null; - - // set GL state for depth map - - _gl.clearColor( 1, 1, 1, 1 ); - _gl.disable( _gl.BLEND ); - - _renderer.setDepthTest( true ); - - // update scene - - if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); - - // update camera matrices and frustum - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); - - // render depth map - - _renderer.setRenderTarget( this.renderTarget ); - _renderer.clear(); - - // set object matrices & frustum culling - - _renderList.length = 0; - projectObject(scene,scene,camera); - - // render regular objects - - var objectMaterial, useMorphing, useSkinning; - - for ( j = 0, jl = _renderList.length; j < jl; j ++ ) { - - webglObject = _renderList[ j ]; - - object = webglObject.object; - buffer = webglObject.buffer; - - // todo: create proper depth material for particles - - if ( object instanceof THREE.PointCloud && ! object.customDepthMaterial ) continue; - - objectMaterial = getObjectMaterial( object ); - - if ( objectMaterial ) _renderer.setMaterialFaces( object.material ); - - useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets; - useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning; - - if ( object.customDepthMaterial ) { - - material = object.customDepthMaterial; - - } else if ( useSkinning ) { - - material = useMorphing ? _depthMaterialMorphSkin : _depthMaterialSkin; - - } else if ( useMorphing ) { - - material = _depthMaterialMorph; - - } else { - - material = _depthMaterial; - - } - - if ( buffer instanceof THREE.BufferGeometry ) { - - _renderer.renderBufferDirect( camera, scene.__lights, fog, material, buffer, object ); - - } else { - - _renderer.renderBuffer( camera, scene.__lights, fog, material, buffer, object ); - - } - - - } - - // set matrices and render immediate objects - - renderList = scene.__webglObjectsImmediate; - - for ( j = 0, jl = renderList.length; j < jl; j ++ ) { - - webglObject = renderList[ j ]; - object = webglObject.object; - - if ( object.visible ) { - - object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); - - _renderer.renderImmediateObject( camera, scene.__lights, fog, _depthMaterial, object ); - - } - - } - - // restore GL state - - var clearColor = _renderer.getClearColor(), - clearAlpha = _renderer.getClearAlpha(); - - _gl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha ); - _gl.enable( _gl.BLEND ); - - }; - - function projectObject(scene, object,camera){ - - if ( object.visible ) { - - var webglObjects = scene.__webglObjects[object.id]; - - if (webglObjects && (object.frustumCulled === false || _frustum.intersectsObject( object ) === true) ) { - - - for (var i = 0, l = webglObjects.length; i < l; i++){ - - var webglObject = webglObjects[i]; - - object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); - _renderList.push(webglObject); - - } - } - - for(var i = 0, l = object.children.length; i < l; i++) { - - projectObject(scene, object.children[i], camera); - } - - } - } - - // For the moment just ignore objects that have multiple materials with different animation methods - // Only the first material will be taken into account for deciding which depth material to use - - function getObjectMaterial( object ) { - - return object.material instanceof THREE.MeshFaceMaterial - ? object.material.materials[ 0 ] - : object.material; - - }; - -}; - - -// File:src/extras/shaders/ShaderFlares.js - -/** - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.ShaderFlares = { - - 'lensFlareVertexTexture': { - - vertexShader: [ - - "uniform lowp int renderType;", - - "uniform vec3 screenPosition;", - "uniform vec2 scale;", - "uniform float rotation;", - - "uniform sampler2D occlusionMap;", - - "attribute vec2 position;", - "attribute vec2 uv;", - - "varying vec2 vUV;", - "varying float vVisibility;", - - "void main() {", - - "vUV = uv;", - - "vec2 pos = position;", - - "if( renderType == 2 ) {", - - "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", - - "vVisibility = visibility.r / 9.0;", - "vVisibility *= 1.0 - visibility.g / 9.0;", - "vVisibility *= visibility.b / 9.0;", - "vVisibility *= 1.0 - visibility.a / 9.0;", - - "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", - "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", - - "}", - - "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", - - "}" - - ].join( "\n" ), - - fragmentShader: [ - - "uniform lowp int renderType;", - - "uniform sampler2D map;", - "uniform float opacity;", - "uniform vec3 color;", - - "varying vec2 vUV;", - "varying float vVisibility;", - - "void main() {", - - // pink square - - "if( renderType == 0 ) {", - - "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", - - // restore - - "} else if( renderType == 1 ) {", - - "gl_FragColor = texture2D( map, vUV );", - - // flare - - "} else {", - - "vec4 texture = texture2D( map, vUV );", - "texture.a *= opacity * vVisibility;", - "gl_FragColor = texture;", - "gl_FragColor.rgb *= color;", - - "}", - - "}" - ].join( "\n" ) - - }, - - - 'lensFlare': { - - vertexShader: [ - - "uniform lowp int renderType;", - - "uniform vec3 screenPosition;", - "uniform vec2 scale;", - "uniform float rotation;", - - "attribute vec2 position;", - "attribute vec2 uv;", - - "varying vec2 vUV;", - - "void main() {", - - "vUV = uv;", - - "vec2 pos = position;", - - "if( renderType == 2 ) {", - - "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", - "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", - - "}", - - "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", - - "}" - - ].join( "\n" ), - - fragmentShader: [ - - "precision mediump float;", - - "uniform lowp int renderType;", - - "uniform sampler2D map;", - "uniform sampler2D occlusionMap;", - "uniform float opacity;", - "uniform vec3 color;", - - "varying vec2 vUV;", - - "void main() {", - - // pink square - - "if( renderType == 0 ) {", - - "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", - - // restore - - "} else if( renderType == 1 ) {", - - "gl_FragColor = texture2D( map, vUV );", - - // flare - - "} else {", - - "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", - "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", - "visibility = ( 1.0 - visibility / 4.0 );", - - "vec4 texture = texture2D( map, vUV );", - "texture.a *= opacity * visibility;", - "gl_FragColor = texture;", - "gl_FragColor.rgb *= color;", - - "}", - - "}" - - ].join( "\n" ) - - } - -}; - diff --git a/libs/three.js/build/three.min.js b/libs/three.js/build/three.min.js index 6c2757dc..a88b4afa 100644 --- a/libs/three.js/build/three.min.js +++ b/libs/three.js/build/three.min.js @@ -1,14 +1,15 @@ // threejs.org/license -'use strict';var THREE={REVISION:"68"};"object"===typeof module&&(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0; -THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209; -THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005; -THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023; -THREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)}; +'use strict';var THREE={REVISION:"69"};"object"===typeof module&&(module.exports=THREE);void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=0.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= +c:.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< -8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=0.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(c=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= -0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= +b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],n=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= +.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= -1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, -multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); -return a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x= -c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y, -this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,n=b._w;this._x=c*n+f*g+d*k-e*h;this._y=d*n+f*h+e*g-c*k;this._z=e*n+f*k+c*h-d*g;this._w=f*n-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); +return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h= +Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback= +a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= -this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},clone:function(){return new THREE.Vector2(this.x,this.y)}}; +THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= -(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x; -this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z= -b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x= -0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+ -Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y= -e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0=== -a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}, -setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a, -b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z= -a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; +(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,n=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-n*-f;this.y=k*a+b*-f+n*-e-h*-g;this.z=n*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0=== +a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x> +a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a, +b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z); +return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/ +b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this}, +projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length()); +return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}, +getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a, +b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x=== +this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, -setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(0.01>Math.abs(d-g)&&0.01>Math.abs(f-c)&&0.01>Math.abs(k-b)){if(0.1>Math.abs(d+g)&&0.1>Math.abs(f+c)&&0.1>Math.abs(k+b)&&0.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?0.01>e?(b=0,d=c=0.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?0.01>h?(b=0.707106781,c=0,d=0.707106781):(c= -Math.sqrt(h),b=d/c,d=k/c):0.01>l?(c=b=0.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));0.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z); -this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w): -Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, -setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z, -this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var n=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+n-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;n=(n+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>n?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>n?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h), +b=d/c,d=k/c):.01>n?(c=b=.707106781,d=0):(d=Math.sqrt(n),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+n-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w); +return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w); +return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, +setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]= +this.z;a[b+3]=this.w;return a},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= -a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)): -(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),0.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):"XZY"===b?(this._z= -Math.asin(-c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2* -(a.z*a.w-a.x*a.y),h+e-f-g)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):"YZX"=== -b?(this._x=Math.atan2(2*(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this); +a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],n=d[9],p=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-n,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(n,-1,1)),.99999>Math.abs(n)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)):(this._y= +Math.atan2(-p,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-p,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(p,-1,1)),.99999>Math.abs(p)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-n,k),this._y=Math.atan2(-p,e)):(this._x=0,this._y=Math.atan2(g,d))):"XZY"===b?(this._z=Math.asin(-c(f, +-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-n,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*(a.z*a.w-a.x* +a.y),h+e-f-g)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):"YZX"===b?(this._x=Math.atan2(2* +(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this); this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}}; THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; -THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, +THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; -THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; -THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y|| -a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y|| -a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=0.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this}, -union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); -a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}}; -THREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1}; -THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)}, +THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x- +this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a= +new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y, +this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a); +this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*= -c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(0.5*a)); -var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a= -this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; +0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,n=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,n*g+c,n*h-d*f,0,k*h-d*g,n*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a, +0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,n=1/k;b.elements[0]*=c;b.elements[1]*= +c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=n;b.elements[9]*=n;b.elements[10]*=n;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a)); +var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,n=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/n;g[14]=-((f+e)/n);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}}; +THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); -var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(0.5),f=b.clone().sub(a).normalize(),g=0.5*a.distanceTo(b), -h=this.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0f)return null;f=Math.sqrt(f-e);e=d-f; +var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(.5),f=b.clone().sub(a).normalize(),g=.5*a.distanceTo(b),h= +this.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),n=h.lengthSq(),p=Math.abs(1-a*a),q,m;0<=p?(h=a*k-b,q=a*b-k,m=g*p,0<=h?q>=-m?q<=m?(g=1/p,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+n):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+n):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+n):q<=-m?(h=Math.max(0,-(-a*g+b)),q=0f)return null;f=Math.sqrt(f-e);e=d-f; d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3; return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!== c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null; @@ -123,8 +126,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; -THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+ -a,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, +THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],n=c[7],p=c[8],q=c[9],m=c[10],r=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,r-p,c-t).normalize();b[1].setComponents(f+ +a,n+g,r+p,c+t).normalize();b[2].setComponents(f+d,n+h,r+q,c+s).normalize();b[3].setComponents(f-d,n-h,r-q,c-s).normalize();b[4].setComponents(f-e,n-k,r-m,c-u).normalize();b[5].setComponents(f+e,n+k,r+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, @@ -133,123 +136,118 @@ b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal). coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);g.applyMatrix4(d);this.setFromNormalAndCoplanarPoint(f,g);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&& a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}}; THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: -f+2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a= +180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}}; +THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,n,p,q,m;this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+ +2;n=this.points[c[0]];p=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(n.x,p.x,q.x,m.x,g,h,k);d.y=b(n.y,p.y,q.y,m.y,g,h,k);d.z=b(n.z,p.z,q.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); -THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| +THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), -a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; +a=.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;ee&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a, -b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l, -checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t); -s.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix, -R);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}}); -!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;nva;va++)s.uvs[va].copy(ua[va]); -s.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/ -(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0}; +a,"can't be added as a child of itself."),this;a instanceof THREE.Object3D?(void 0!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add:",a,"is not an instance of THREE.Object3D.");return this},remove:function(a){if(1b.max.x&&(b.max.x=e);fb.max.y&& -(b.max.y=f);gb.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&& -(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;eBa?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent= -{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;np;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array, -b,c,d,e=0,f=a.length;eza?-1:1;h[4*a]=la.x;h[4*a+1]=la.y;h[4*a+2]=la.z;h[4*a+3]=Ga}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array, +e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;ps;s++)t=a[3*c+s],-1==m[t]?(q[2*s]=t,q[2*s+1]=-1,p++):m[t]k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)s=q[p+1],-1p;p+=2)t=q[p],s=q[p+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;ed?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cc&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& @@ -262,89 +260,99 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)}; THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.'); a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)}; -THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,q,r,t,s,p,v,w,u=a.faces;n=a.vertices;var D=a.normals,A=a.colors,x=0;if(void 0!==a.uvs){for(d=0;dg;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++], -D[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)r=u[k++],w=v[2*r],r=v[2*r+1], -w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;dg;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*y[k++],r.normal.set(G[q++],G[q++],G[q]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)q=3*y[k++],t=new THREE.Vector3(G[q++], +G[q++],G[q]),2!==d&&r.vertexNormals.push(t),0!==d&&s.vertexNormals.push(t);p&&(p=y[k++],p=w[p],r.color.setHex(p),s.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=w[p],2!==d&&r.vertexColors.push(new THREE.Color(p)),0!==d&&s.vertexColors.push(new THREE.Color(p));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=y[k++];r.b=y[k++];r.c=y[k++];h&&(h=y[k++],r.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)m=y[k++],v=u[2*m],m=u[2*m+1], +v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*y[k++],r.normal.set(G[q++],G[q++],G[q]));if(t)for(d=0;3>d;d++)q=3*y[k++],t=new THREE.Vector3(G[q++],G[q++],G[q]),r.vertexNormals.push(t);p&&(p=y[k++],r.color.setHex(w[p]));if(b)for(d=0;3>d;d++)p=y[k++],r.vertexColors.push(new THREE.Color(w[p]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;dthis.opacity&&(a.opacity=this.opacity);!1!==this.transparent&&(a.transparent=this.transparent);!1!==this.wireframe&&(a.wireframe=this.wireframe);return a},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor= +this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0; +THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.type="LineBasicMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype); +THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; +THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.type="LineDashedMaterial";this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype); +THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.scale=this.scale;a.dashSize=this.dashSize;a.gapSize=this.gapSize;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; +THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.type="MeshBasicMaterial";this.color=new THREE.Color(16777215);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=!1;this.setValues(a)}; THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype); THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap; a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a}; -THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap= -"round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype); +THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.type="MeshLambertMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth= +1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype); THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog; a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; -THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity= -1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype); +THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.type="MeshPhongMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine= +THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype); THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.bumpMap=this.bumpMap;a.bumpScale=this.bumpScale;a.normalMap=this.normalMap;a.normalScale.copy(this.normalScale); a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; -THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a}; -THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a}; -THREE.MeshFaceMaterial=function(a){this.materials=a instanceof Array?a:[]};THREE.MeshFaceMaterial.prototype.clone=function(){for(var a=new THREE.MeshFaceMaterial,b=0;bf)){var r=b.origin.distanceTo(l);rd.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a}; -THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); +THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.mode=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype); +THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),g instanceof THREE.Geometry))for(var g=g.vertices,h=g.length,k=new THREE.Vector3,n=new THREE.Vector3,p=this.mode===THREE.LineStrip? +1:2,q=0;qf)){var m=b.origin.distanceTo(n);md.far||e.push({distance:m,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a}; +THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;kg.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;wg.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype); -THREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0}; +THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var n= +this.material;if(void 0!==n){var p=k.attributes,q,m,r=g.precision;if(void 0!==p.index){var t=p.index.array,s=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,y=u.length;vg.far||h.push({distance:x,point:K,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=p.position.array,t=k=0,w=s.length;k +g.far||h.push({distance:x,point:K,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,v=0,y=k.faces.length;vg.far||h.push({distance:x,point:K,face:G,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype); THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; @@ -356,46 +364,25 @@ THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(v THREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(); THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(1=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0}; -THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype); -THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;bE&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1T.positionScreen.z||1=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof -THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=0.5*ma.x+0.5,qa=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=0.5*ma.x+0.5,ja=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=0.5*ma.x+0.5,va=0.5*ma.y+0.5,f(ya,Ea,Aa,za, -Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-0.5*ma.x+0.5,qa=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-0.5*ma.x+0.5,ja=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-0.5*ma.x+0.5,va=-0.5*ma.y+0.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth, -E.wireframeLinecap,E.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(0.5).addScalar(0.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={}; -THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n";THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\tvec3 dirVector = normalize( lDirection.xyz );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat lDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n\n#endif"; +THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;d.addAttribute("index",new THREE.BufferAttribute(a,1));d.addAttribute("position",new THREE.BufferAttribute(b,3));d.addAttribute("uv",new THREE.BufferAttribute(c,2));return function(a){THREE.Object3D.call(this);this.type="Sprite";this.geometry=d;this.material=void 0!==a?a:new THREE.SpriteMaterial}}(); +THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite; +THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype); +THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; +THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;"; THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif"; THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n\n#endif";THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif";THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\n\n#endif";THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif"; -THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tif ( useRefract ) {\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t} else {\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tif ( useRefract ) {\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t} else {\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t}\n\n#endif"; THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t#ifdef GAMMA_OUTPUT\n\n\t\tshadowColor *= shadowColor;\n\n\t#endif\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n\n#endif\n"; THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#endif\n\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#endif\n\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif"; THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif"; THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n"; THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"; -THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b 0\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_HEMI_LIGHTS > 0\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\n\tuniform vec3 wrapRGB;\n#endif\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +specular:{type:"c",value:new THREE.Color(1118481)},ambient:{type:"c",value:new THREE.Color(16777215)},shininess:{type:"f",value:30},opacity:{type:"f",value:1},useRefract:{type:"i",value:0},refractionRatio:{type:"f",value:.98},reflectivity:{type:"f",value:.5},uOffset:{type:"v2",value:new THREE.Vector2(0,0)},uRepeat:{type:"v2",value:new THREE.Vector2(1,1)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:["uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\nuniform bool enableDiffuse;\nuniform bool enableSpecular;\nuniform bool enableAO;\nuniform bool enableReflection;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tSpecular;\nuniform sampler2D tAO;\nuniform samplerCube tCube;\nuniform vec2 uNormalScale;\nuniform bool useRefract;\nuniform float refractionRatio;\nuniform float reflectivity;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_HEMI_LIGHTS > 0\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\n\tuniform vec3 wrapRGB;\n#endif\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\n\tvec3 specularTex = vec3( 1.0 );\n\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\n\tnormalTex.xy *= uNormalScale;\n\tnormalTex = normalize( normalTex );\n\tif( enableDiffuse ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 texelColor = texture2D( tDiffuse, vUv );\n\t\t\ttexelColor.xyz *= texelColor.xyz;\n\t\t\tgl_FragColor = gl_FragColor * texelColor;\n\t\t#else\n\t\t\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n\t\t#endif\n\t}\n\tif( enableAO ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 aoColor = texture2D( tAO, vUv );\n\t\t\taoColor.xyz *= aoColor.xyz;\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n\t\t#else\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n\t\t#endif\n\t}", THREE.ShaderChunk.alphatest_fragment,"\tif( enableSpecular )\n\t\tspecularTex = texture2D( tSpecular, vUv ).xyz;\n\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\n\tvec3 finalNormal = tsb * normalTex;\n\t#ifdef FLIP_SIDED\n\t\tfinalNormal = -finalNormal;\n\t#endif\n\tvec3 normal = normalize( finalNormal );\n\tvec3 viewPosition = normalize( vViewPosition );\n\t#if MAX_POINT_LIGHTS > 0\n\t\tvec3 pointDiffuse = vec3( 0.0 );\n\t\tvec3 pointSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\t\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat pointDistance = 1.0;\n\t\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\t\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\n\t\t\tpointVector = normalize( pointVector );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\n\t\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n\t\t\t#endif\n\t\t\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\n\t\t\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\n\t\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\t\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\tvec3 spotDiffuse = vec3( 0.0 );\n\t\tvec3 spotSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\t\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat spotDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\n\t\t\tspotVector = normalize( spotVector );\n\t\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\t\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\t\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\t\t\t\t#ifdef WRAP_AROUND\n\t\t\t\t\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\n\t\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\t\t\t\t#else\n\t\t\t\t\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t#endif\n\t\t\t\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\n\t\t\t\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\n\t\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\t\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\t\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\n\t\t\t}\n\t\t}\n\t#endif\n\t#if MAX_DIR_LIGHTS > 0\n\t\tvec3 dirDiffuse = vec3( 0.0 );\n\t\tvec3 dirSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\t\tvec3 dirVector = normalize( lDirection.xyz );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\n\t\t\t\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n\t\t\t#endif\n\t\t\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\n\t\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\t\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\tvec3 hemiDiffuse = vec3( 0.0 );\n\t\tvec3 hemiSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\t\tvec3 lVector = normalize( lDirection.xyz );\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\t\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\t\t\themiDiffuse += diffuse * hemiColor;\n\t\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\t\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\t\t\tvec3 lVectorGround = -lVector;\n\t\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\t\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\t\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\t\t}\n\t#endif\n\tvec3 totalDiffuse = vec3( 0.0 );\n\tvec3 totalSpecular = vec3( 0.0 );\n\t#if MAX_DIR_LIGHTS > 0\n\t\ttotalDiffuse += dirDiffuse;\n\t\ttotalSpecular += dirSpecular;\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\ttotalDiffuse += hemiDiffuse;\n\t\ttotalSpecular += hemiSpecular;\n\t#endif\n\t#if MAX_POINT_LIGHTS > 0\n\t\ttotalDiffuse += pointDiffuse;\n\t\ttotalSpecular += pointSpecular;\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\ttotalDiffuse += spotDiffuse;\n\t\ttotalSpecular += spotSpecular;\n\t#endif\n\t#ifdef METAL\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\t#else\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\t#endif\n\tif ( enableReflection ) {\n\t\tvec3 vReflect;\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tif ( useRefract ) {\n\t\t\tvReflect = refract( cameraToVertex, normal, refractionRatio );\n\t\t} else {\n\t\t\tvReflect = reflect( cameraToVertex, normal );\n\t\t}\n\t\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n\t\t#ifdef GAMMA_INPUT\n\t\t\tcubeColor.xyz *= cubeColor.xyz;\n\t\t#endif\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\n\t}", THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\nuniform bool enableDisplacement;\n#ifdef VERTEX_TEXTURES\n\tuniform sampler2D tDisplacement;\n\tuniform float uDisplacementScale;\n\tuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", @@ -445,235 +432,270 @@ THREE.ShaderChunk.logdepthbuf_vertex,"\tvWorldPosition = worldPosition.xyz;\n\tv THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; -THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}} -function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0ja;ja++)Da=R[ja], -yb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;Bja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0c;c++)G.autoScaleCubemaps&&!U?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height); -f=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v=Qb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)} -function ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a, -m.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer); -G.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer); -void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer); -G.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;ad.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;pf;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer(); -m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture), -E(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer): -Q(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin); -this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; +THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate= +!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1Aa;Aa++)Cb=ma[Aa],Ta[Sa]=Cb.x,Ta[Sa+1]=Cb.y,Ta[Sa+2]=Cb.z,Sa+=3;else for(Aa=0;3>Aa;Aa++)Ta[Sa]=pa.x,Ta[Sa+1]=pa.y,Ta[Sa+2]=pa.z,Sa+=3;l.bindBuffer(l.ARRAY_BUFFER,C.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER, +Ta,S)}if(Kc&&ua){M=0;for(ea=N.length;MAa;Aa++)Oa=hb[Aa],sb[qb]=Oa.x,sb[qb+1]=Oa.y,qb+=2;0Aa;Aa++)Qb=za[Aa],fb[rb]=Qb.x,fb[rb+1]=Qb.y,rb+=2;0h&&(f[v].counter+=1,k=f[v].hash+"_"+f[v].counter,k in r||(p={id:rc++, +faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},r[k]=p,q.push(p)));r[k].faces3.push(t);r[k].vertices+=3}a[g]=q;d.groupsNeedUpdate=!1}a=xb[d.id];g=0;for(e=a.length;gDa;Da++)kb[Da]=!J.autoScaleCubemaps||Ob||Tb?Tb?ua.image[Da].image:ua.image[Da]:R(ua.image[Da],$c);var ka=kb[0],Zb=THREE.Math.isPowerOfTwo(ka.width)&&THREE.Math.isPowerOfTwo(ka.height),ab=Q(ua.format),Fb=Q(ua.type);F(l.TEXTURE_CUBE_MAP,ua,Zb);for(Da=0;6>Da;Da++)if(Ob)for(var gb,$b=kb[Da].mipmaps,ga=0,Xb=$b.length;ga=Oc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ +Oc);dc+=1;return a}function x(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function D(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function E(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function A(a){a!==Pc&&(l.lineWidth(a),Pc=a)}function B(a,b,c){Qc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),Qc=a);!a||Rc===b&&Sc===c||(l.polygonOffset(b,c),Rc=b,Sc=c)}function F(a,b,c){c? +(l.texParameteri(a,l.TEXTURE_WRAP_S,Q(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,Q(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,Q(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,Q(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter)));(c=pa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+ +".");return d}return a}function H(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width, +b.height)}function C(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function T(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function Q(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT; +if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE; +if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB; +if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a=== +THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;b=pa.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT; +if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=pa.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; +if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=pa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var O=void 0!==a.canvas?a.canvas:document.createElement("canvas"),S=void 0!==a.context?a.context:null,X=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,la=void 0!==a.depth?a.depth:!0,ma=void 0!==a.stencil? +a.stencil:!0,ya=void 0!==a.antialias?a.antialias:!1,P=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Ga=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Fa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,za=new THREE.Color(0),bb=0,cb=[],ob={},jb=[],Jb=[],Ib=[],yb=[],Ra=[];this.domElement=O;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil= +this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,hb=[],tc=null,Tc=null,Kb=-1,Oa=-1,ec=null,dc=0,Lb=-1,Mb=-1,pb=-1,Nb=-1,Ob=-1, +Xb=-1,Yb=-1,nb=-1,Qc=null,Rc=null,Sc=null,Pc=null,Pb=0,kc=0,lc=O.width,mc=O.height,Uc=0,Vc=0,wb=new Uint8Array(16),ib=new Uint8Array(16),Ec=new THREE.Frustum,Ac=new THREE.Matrix4,Gc=new THREE.Matrix4,Na=new THREE.Vector3,sa=new THREE.Vector3,fc=!0,Mc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[], +positions:[]}},l;try{var Wc={alpha:Y,depth:la,stencil:ma,antialias:ya,premultipliedAlpha:P,preserveDrawingBuffer:Ga};l=S||O.getContext("webgl",Wc)||O.getContext("experimental-webgl",Wc);if(null===l){if(null!==O.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}}catch(ad){console.error(ad)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var pa=new THREE.WebGLExtensions(l); +pa.get("OES_texture_float");pa.get("OES_texture_float_linear");pa.get("OES_standard_derivatives");Fa&&pa.get("EXT_frag_depth");l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(Pb,kc,lc,mc);l.clearColor(za.r,za.g,za.b,bb);this.context=l;var Oc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS), +bd=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),cd=l.getParameter(l.MAX_TEXTURE_SIZE),$c=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),sc=0b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]); +else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}J.info.memory.textures--},Dc=function(a){a=a.target;a.removeEventListener("dispose",Dc);Cc(a)},Yc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "), +c=0,d=b.length;cd.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0, +0]);for(m=0;mf;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);H(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer= +l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),F(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT, +l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):H(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=lc,a=mc, +d=Pb,e=kc);b!==Tc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Tc=b);Uc=c;Vc=a};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}; THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype); -THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s="#define "+p+" "+s,t.push(s)); -t=t.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+ +THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "OES_texture_float":d=a.getExtension("OES_texture_float");break;case "OES_texture_float_linear":d=a.getExtension("OES_texture_float_linear");break;case "OES_standard_derivatives":d=a.getExtension("OES_standard_derivatives");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); +break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case "OES_element_index_uint":d=a.getExtension("OES_element_index_uint");break;case "EXT_blend_minmax":d=a.getExtension("EXT_blend_minmax");break; +case "EXT_frag_depth":d=a.getExtension("EXT_frag_depth")}null===d&&console.log("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}; +THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var r,t;r=[];for(var s in g)t=g[s],!1!==t&&(t="#define "+s+" "+t,r.push(t)); +r=r.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",r,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+ e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND": -"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), -b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": +"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), +b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",r,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": "",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP": -"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."), -console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")): -q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;qT;T++)F[T]=new THREE.Vector3,A[T]=new THREE.Vector3;F=B.shadowCascadeNearZ[C];B=B.shadowCascadeFarZ[C];A[0].set(-1,-1,F);A[1].set(1,-1,F);A[2].set(-1,1,F);A[3].set(1,1,F);A[4].set(-1,-1,B);A[5].set(1,-1,B);A[6].set(-1,1,B);A[7].set(1,1,B);H.originalCamera=v;A=new THREE.Gyroscope;A.position.copy(x.shadowCascadeOffset);A.add(H);A.add(H.target);v.add(A);x.shadowCascadeArray[E]=H;console.log("Created virtualLight",H)}C= +x;F=E;B=C.shadowCascadeArray[F];B.position.copy(C.position);B.target.position.copy(C.target.position);B.lookAt(B.target);B.shadowCameraVisible=C.shadowCameraVisible;B.shadowDarkness=C.shadowDarkness;B.shadowBias=C.shadowCascadeBias[F];A=C.shadowCascadeNearZ[F];C=C.shadowCascadeFarZ[F];B=B.pointsFrustum;B[0].z=A;B[1].z=A;B[2].z=A;B[3].z=A;B[4].z=C;B[5].z=C;B[6].z=C;B[7].z=C;R[D]=H;D++}else R[D]=x,D++;u=0;for(K=R.length;uC;C++)F=B[C],F.copy(A[C]),F.unproject(E),F.applyMatrix4(D.matrixWorldInverse),F.xr.x&&(r.x=F.x),F.yr.y&&(r.y=F.y),F.zr.z&&(r.z=F.z);D.left=m.x;D.right=r.x;D.top=r.y;D.bottom=m.y;D.updateProjectionMatrix()}D=x.shadowMap;A=x.shadowMatrix;E=x.shadowCamera;E.position.setFromMatrixPosition(x.matrixWorld);t.setFromMatrixPosition(x.target.matrixWorld);E.lookAt(t);E.updateMatrixWorld();E.matrixWorldInverse.getInverse(E.matrixWorld);x.cameraHelper&& +(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(E.projectionMatrix);A.multiply(E.matrixWorldInverse);q.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(D);a.clear();s.length=0;e(c,c,E);x=0;for(D=s.length;x 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); +w.compileShader(R);w.compileShader(H);w.attachShader(F,R);w.attachShader(F,H);w.linkProgram(F);D=F;v=w.getAttribLocation(D,"position");y=w.getAttribLocation(D,"uv");c=w.getUniformLocation(D,"uvOffset");d=w.getUniformLocation(D,"uvScale");e=w.getUniformLocation(D,"rotation");f=w.getUniformLocation(D,"scale");g=w.getUniformLocation(D,"color");h=w.getUniformLocation(D,"map");k=w.getUniformLocation(D,"opacity");n=w.getUniformLocation(D,"modelViewMatrix");p=w.getUniformLocation(D,"projectionMatrix");q= +w.getUniformLocation(D,"fogType");m=w.getUniformLocation(D,"fogDensity");r=w.getUniformLocation(D,"fogNear");t=w.getUniformLocation(D,"fogFar");s=w.getUniformLocation(D,"fogColor");u=w.getUniformLocation(D,"alphaTest");F=document.createElement("canvas");F.width=8;F.height=8;R=F.getContext("2d");R.fillStyle="white";R.fillRect(0,0,8,8);E=new THREE.Texture(F);E.needsUpdate=!0}w.useProgram(D);w.enableVertexAttribArray(v);w.enableVertexAttribArray(y);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER, +K);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(y,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,x);w.uniformMatrix4fv(p,!1,B.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);R=F=0;(H=A.fog)?(w.uniform3f(s,H.color.r,H.color.g,H.color.b),H instanceof THREE.Fog?(w.uniform1f(r,H.near),w.uniform1f(t,H.far),w.uniform1i(q,1),R=F=1):H instanceof THREE.FogExp2&&(w.uniform1f(m,H.density),w.uniform1i(q,2),R=F=2)):(w.uniform1i(q,0),R=F=0);for(var H=0,C=b.length;H< +C;H++){var T=b[H];T._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,T.matrixWorld);T.z=null===T.renderDepth?-T._modelViewMatrix.elements[14]:T.renderDepth}b.sort(G);for(var Q=[],H=0,C=b.length;Hq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255* -b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;tq-1?0:q-1,r=q+1>e-1?e-1:q+1,t=0>p-1?0:p-1,s=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(q*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+p)]/255* +b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);m=[];t=u.length;for(r=0;re)return null;var f=[],g=[],h=[],k,l,n;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A= -void 0,t=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;rk)g=d+1;else if(0b&&(b=0);1e)return null;var f=[],g=[],h=[],k,n,p;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var r=m=void 0,t=void 0,s=void 0,u=void 0,v=void 0,y=void 0,G=void 0,w=void 0, +r=a[g[k]].x,t=a[g[k]].y,s=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(s-r)*(y-t)-(u-t)*(v-r))m=!1;else{var K=void 0,x=void 0,D=void 0,E=void 0,A=void 0,B=void 0,F=void 0,R=void 0,H=void 0,C=void 0,H=R=F=w=G=void 0,K=v-s,x=y-u,D=r-v,E=t-y,A=s-r,B=u-t;for(m=0;mk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; -THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cl&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<= -h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; +THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cm&&(g=b[f],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<= +h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bz||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0d?[]:k==d?f?[]:[g]:a<=d?[g,h]: -[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; -d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cO){console.log("Infinite Loop! Holes left:"+ -l.length+", Probably Hole outside Shape!");break}for(q=K;qh;h++)l=k[h].x+":"+k[h].y, -l=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, +THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.xE||E>D)return[];k=n*p-k*q;if(0>k||k>D)return[]}else{if(0d?[]:k==d?f?[]:[g]:a<=d?[g,h]: +[g,n]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; +d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cC){console.log("Infinite Loop! Holes left:"+ +n.length+", Probably Hole outside Shape!");break}for(q=B;qh;h++)n=k[h].x+":"+k[h].y, +n=p[n],void 0!==n&&(k[h]=n);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; -THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)}; -THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b}; +THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype); THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; -THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; +THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);return c}; THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype); -THREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype); -THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); -THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); -THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;b=new THREE.Vector2;b.x=this.aX+this.xRadius*Math.cos(a);b.y=this.aY+this.yRadius*Math.sin(a);return b};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype); +THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return b}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c}); +THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= 0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e= -this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; -THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)* -r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;fn;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0]; -for(t=this.getNextKeyWith(q,f,1);t.timer.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1d;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; +THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;aa.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],r[0],t[0],s[0],e,c,m);d[1]=f(q[1],r[1],t[1],s[1],e,c,m);d[2]=f(q[2],r[2],t[2],s[2],e,c,m);return d},f=function(a,b,c,d,e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+ +(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var h=this.hierarchy.length;fq;q++){var m=this.keyTypes[q],r=n.prevKey[m],t=n.nextKey[m]; +if(0this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.timer.index;)r=t,t=this.getNextKeyWith(m,f,t.index+1);n.prevKey[m]=r;n.nextKey[m]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),u=r[m],v=t[m];0>s&&(s=0);1=this.currentTime?f.interpolate(g,this.currentTime):f.inter THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.isPlaying=!1}; THREE.MorphAnimation.prototype={play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(){var a=0,b=0;return function(c){if(!1!==this.isPlaying){this.currentTime+=c;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]= 0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()}; -THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10e?-1E-10>g&& -(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;gMath.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2; -THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5, -a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;lt&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;lc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); -THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=0.2*a);void 0===c&&(c=0.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)}; +THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,s){var u,v=h.widthSegments,y=h.heightSegments,G=e/2,w=f/2,K=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var x=v+1,D=y+1,E=e/v,A=f/y,B=new THREE.Vector3;B[u]=0=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10d?-1E-10>f&&(a=!0):Math.sign(e)== +Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(P=a.length;0<=--P;){c=P;d=P-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*p,e=0;eMath.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y, +1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5, +a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,n=0,p=a.length;nr&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;nc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); +THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)}; THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype); THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; -d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate= -!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; +d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrix=a.matrixWorld; +this.matrixAutoUpdate=!1};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); -b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; +b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype); -THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array; -f=0;for(p in e)if(g=e[p],void 0===g.face2||0.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype); +THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var n=k.vertices,k=k.faces,p=0,q=0,m=k.length;qt;t++){d[0]=r[g[t]];d[1]=r[g[(t+1)%3]];d.sort(f);var s=d.toString();void 0===e[s]?(e[s]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[s].face2=q}d=new Float32Array(6*p);f=0;for(s in e)if(g=e[s],void 0===g.face2|| +.9999>k[g.face1].normal.dot(k[g.face2].normal))p=n[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=n[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype); THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); +THREE.HemisphereLightHelper=function(a,b,c,d){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];a=new THREE.SphereGeometry(b,4,2);a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(b=0;8>b;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); -THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()}; +THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()}; THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; -THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cp;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;rp;p++)n= -k[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;sp;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(), -void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;rp;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;rp;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}), -THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}; -THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; -THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;as;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(r=p;ms;s++)p= +k[q[2*m+s]],g=6*m+3*s,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;r=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:r.length,index:0,start:0}]);for(var q=new Uint32Array(2*r.length),t=0,v=n.length;ts;s++)d[0]= +g+r[m+s],d[1]=g+r[m+(s+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(r=p;ms;s++)g=6*m+3*s,p=3*q[2*m+s],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,r=q;ms;s++)g=18*m+6*s,q=9*m+3*s,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(s+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d, +3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype); THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype); THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)}; THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;fh.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; @@ -787,41 +812,3 @@ THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.ani THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; -THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]= --1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16, -16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE); -c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");s.renderType=c.getUniformLocation(r,"renderType");s.map=c.getUniformLocation(r,"map");s.occlusionMap=c.getUniformLocation(r,"occlusionMap");s.opacity= -c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=0.5*f,x=0.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r); -c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;NK;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope; -A.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log("Created virtualLight",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z= -y;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;py;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.xn.x&&(n.x=C.x),C.yn.y&&(n.y=C.y),C.zn.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix; -D=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u); -c.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); -u.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,"position");v=u.getAttribLocation(K,"uv");a=u.getUniformLocation(K,"uvOffset");b=u.getUniformLocation(K,"uvScale");c=u.getUniformLocation(K,"rotation");d=u.getUniformLocation(K,"scale");e=u.getUniformLocation(K,"color");f=u.getUniformLocation(K,"map");g=u.getUniformLocation(K,"opacity");h=u.getUniformLocation(K,"modelViewMatrix");k=u.getUniformLocation(K,"projectionMatrix");l= -u.getUniformLocation(K,"fogType");n=u.getUniformLocation(K,"fogDensity");q=u.getUniformLocation(K,"fogNear");r=u.getUniformLocation(K,"fogFar");t=u.getUniformLocation(K,"fogColor");s=u.getUniformLocation(K,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;x=w.getContext("2d");x.fillStyle="white";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K); -u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1), -O=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;JSc¾gDá@E@?ÿ£?f÷d¾)\á@KEBÿª`? ^¾¬‹á@QIGÿa?O@S¾œá@YPOÿ’\þ>¨WJ¾ësá@IDAÿ"lø>×£0¾)\á@>9:ÿýöõ>›æ¾˜Lá@956ÿQkú>ˆô¾M„á@713ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r345 b/resources/pointclouds/lion_takanawa/bin/r345 deleted file mode 100644 index 042fcb0d..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r345 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r346 b/resources/pointclouds/lion_takanawa/bin/r346 deleted file mode 100644 index ffae18c0..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r346 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r347 b/resources/pointclouds/lion_takanawa/bin/r347 deleted file mode 100644 index 8eb270dd..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r347 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r35 b/resources/pointclouds/lion_takanawa/bin/r35 deleted file mode 100644 index 5ac7cd78..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r35 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r350 b/resources/pointclouds/lion_takanawa/bin/r350 deleted file mode 100644 index f2a128d4..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r350 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r351 b/resources/pointclouds/lion_takanawa/bin/r351 deleted file mode 100644 index 5ad4e20c..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r351 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r352 b/resources/pointclouds/lion_takanawa/bin/r352 deleted file mode 100644 index 9b7d088c..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r352 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r353 b/resources/pointclouds/lion_takanawa/bin/r353 deleted file mode 100644 index 32874bac..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r353 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r354 b/resources/pointclouds/lion_takanawa/bin/r354 deleted file mode 100644 index 2954ba24..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r354 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r355 b/resources/pointclouds/lion_takanawa/bin/r355 deleted file mode 100644 index a14dd73a..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r355 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r356 b/resources/pointclouds/lion_takanawa/bin/r356 deleted file mode 100644 index ab9215d3..00000000 --- a/resources/pointclouds/lion_takanawa/bin/r356 +++ /dev/null @@ -1 +0,0 @@ -¢´·=÷uP?ù AY}Hÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r357 b/resources/pointclouds/lion_takanawa/bin/r357 deleted file mode 100644 index 2083e2a0..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r357 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r36 b/resources/pointclouds/lion_takanawa/bin/r36 deleted file mode 100644 index d32c513f..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r36 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r364 b/resources/pointclouds/lion_takanawa/bin/r364 deleted file mode 100644 index eec68132..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r364 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r367 b/resources/pointclouds/lion_takanawa/bin/r367 deleted file mode 100644 index 7295b8de..00000000 --- a/resources/pointclouds/lion_takanawa/bin/r367 +++ /dev/null @@ -1 +0,0 @@ -d;_>� @î@qpnÿÌH>Ð@J î@uupÿÏfU> q@•Ôí@nmiÿ¹�F>åò@гë@qniÿ$¹<>¸@�Sî@kjeÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r37 b/resources/pointclouds/lion_takanawa/bin/r37 deleted file mode 100644 index 05ceb3d4..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r37 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r371 b/resources/pointclouds/lion_takanawa/bin/r371 deleted file mode 100644 index d68ad9ba..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r371 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r375 b/resources/pointclouds/lion_takanawa/bin/r375 deleted file mode 100644 index 288e5bac..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r375 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r4 b/resources/pointclouds/lion_takanawa/bin/r4 deleted file mode 100644 index d8389209..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r4 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r40 b/resources/pointclouds/lion_takanawa/bin/r40 deleted file mode 100644 index 1bf83dcc..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r40 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r401 b/resources/pointclouds/lion_takanawa/bin/r401 deleted file mode 100644 index 7562b5c9..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r401 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r403 b/resources/pointclouds/lion_takanawa/bin/r403 deleted file mode 100644 index 7eee7d71..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r403 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r406 b/resources/pointclouds/lion_takanawa/bin/r406 deleted file mode 100644 index f1247521..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r406 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r407 b/resources/pointclouds/lion_takanawa/bin/r407 deleted file mode 100644 index 957a9632..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r407 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r41 b/resources/pointclouds/lion_takanawa/bin/r41 deleted file mode 100644 index d0f8b85f..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r41 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r410 b/resources/pointclouds/lion_takanawa/bin/r410 deleted file mode 100644 index ef7f0782..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r410 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r412 b/resources/pointclouds/lion_takanawa/bin/r412 deleted file mode 100644 index 5b288176..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r412 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r413 b/resources/pointclouds/lion_takanawa/bin/r413 deleted file mode 100644 index 5c9f7369..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r413 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r414 b/resources/pointclouds/lion_takanawa/bin/r414 deleted file mode 100644 index 5b351b12..00000000 --- a/resources/pointclouds/lion_takanawa/bin/r414 +++ /dev/null @@ -1 +0,0 @@ - @2ULÀ½R–@[t:ÿ_@øÂLÀš–@by<ÿEG@¯%LÀ†É–@e}?ÿ…|@5^NÀX9”@@<6ÿŸ<@' MÀKY”@FA9ÿ­ú@a2MÀª`”@O\;ÿ¦›@ AMÀ�“@;84ÿV@ΪOÀòÒ“@CC;ÿRI@øÂLÀÕ ”@EE<ÿ©¤@ÞMÀz–@_zEÿzÇ@|òLÀéH”@Qd<ÿê•@.ÿMÀQ”@SjAÿ7‰@TtLÀlx”@]sHÿŒÛ@MLÀåЖ@YwCÿRI@ÿ!MÀð§”@Wb@ÿýö@ñcLÀ€·”@Wo@ÿEG@ÐDLÀñc˜@LW6ÿ_@½ãLÀ¦›˜@Pc9ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r416 b/resources/pointclouds/lion_takanawa/bin/r416 deleted file mode 100644 index 492f64fb..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r416 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r417 b/resources/pointclouds/lion_takanawa/bin/r417 deleted file mode 100644 index e067744a..00000000 --- a/resources/pointclouds/lion_takanawa/bin/r417 +++ /dev/null @@ -1 +0,0 @@ -°ç?±PÀü«@evKÿ;ßç?VŸÀ·Ñª@Œ«YÿmÅæ?…|À­ú¬@A@>ÿ;ßç?±PÀ°rª@‡ªVÿ¢Eæ?à-ÀF”¬@TSOÿÅ è?úíÀ ­@GFBÿÌè?¦›Àªñª@9>0ÿÝ$æ?‰ÒÀ\ «@VURÿ†ï?=Àé&©@B@:ÿåañ?BÏÀ"Ž©@984ÿÐDð?}®ÀY©@A@:ÿÞò?;pÀ�•©@LICÿÞò?î|À^Kª@87.ÿ.ÿñ?I.ÀÚª@KKBÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r42 b/resources/pointclouds/lion_takanawa/bin/r42 deleted file mode 100644 index eb3e69ee..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r42 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r424 b/resources/pointclouds/lion_takanawa/bin/r424 deleted file mode 100644 index f0fa8ff7..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r424 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r425 b/resources/pointclouds/lion_takanawa/bin/r425 deleted file mode 100644 index f42159ab..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r425 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r43 b/resources/pointclouds/lion_takanawa/bin/r43 deleted file mode 100644 index 9104cf5c..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r43 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r430 b/resources/pointclouds/lion_takanawa/bin/r430 deleted file mode 100644 index 890fc689..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r430 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r431 b/resources/pointclouds/lion_takanawa/bin/r431 deleted file mode 100644 index d4dcd690..00000000 --- a/resources/pointclouds/lion_takanawa/bin/r431 +++ /dev/null @@ -1 +0,0 @@ - ·?Ï÷ÀmV©@swxÿò¹?ðÀ A“�–ÿ´È2@-!@_ A’’˜ÿÉå3@±P@Y A˜™žÿu“4@�1@Ê2 A™”›ÿÖV8@—�@@ A’�–ÿ¤p5@ù @x A�Š“ÿ�Â9@Ý$@ìÀ A �¤ÿ' 5@ÊÃ@Nb A�Œ”ÿ².6@äƒ@¿} A�Š“ÿ;p:@Ý$@åÐ A›™¢ÿs/@Ý$@¿} A�Ž“ÿˆc9@�1@ÄB A•’›ÿ+7@F”@¹� A”“›ÿgD9@¼@®Ø A¦¥«ÿio0@ÖÅ@“© A‡†Œÿcî:@S–@ A›š¢ÿ�€:@£@¿} A��•ÿç;@aT@²� A�Ž–ÿ¼–8@a@«> A�œ¢ÿÊT9@ëâ@/n Ažœ¤ÿ±á9@h³@ð… A™–Ÿÿ¼1@9Ö@ìÀ A‘‹‘ÿÅ�5@›æ@åÐ A ž£ÿÓM6@ÖÅ@�ä A›š ÿ{ƒ/@‚s@¥N AЇ�ÿ'10@‚s@5^ A”‘šÿµ78@9Ö@ A˜”œÿO¯0@?5@÷u A•’›ÿ]m1@Ý$@ ‰ A”�—ÿÕç2@S–@ÍÌ A™”›ÿ‹l;@·@Pü A’‘›ÿû6@·@ˆô A’‘™ÿ¸¯?@‰Ò@z¥ A‘�˜ÿ9Ö=@4€@+ AŒ‹“ÿ‚s>@-!@/n A•’šÿ£>@a@ŒJ A™–žÿ‚s>@h³@ìÀ A—•œÿa?@-!@/n A”“›ÿtµ=@äƒ@ßà A˜—ŸÿÁ¨<@Ý$@ÆÜ AЉŽÿ-!?@Ãd@Pü A›™ ÿ§è<@F”@C­ A¥¢©ÿmV=@Mó@ ‰ A……Žÿ†É<@ @Gr A–“™ÿVŸ?@Ý$@+ AŒ‹“ÿaT>@þC@ù Až›¢ÿ?5>@ëâ@š™ AŸœ£ÿ{>@4€@_ AЉ‘ÿj<@ÖÅ@ù A��—ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/bin/r771 b/resources/pointclouds/lion_takanawa/bin/r771 deleted file mode 100644 index 78f0e10a..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r771 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/bin/r772 b/resources/pointclouds/lion_takanawa/bin/r772 deleted file mode 100644 index 5e0c75fa..00000000 Binary files a/resources/pointclouds/lion_takanawa/bin/r772 and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/cloud.js b/resources/pointclouds/lion_takanawa/cloud.js new file mode 100644 index 00000000..da9eb9b8 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/cloud.js @@ -0,0 +1,220 @@ +{ + "version": "1.3", + "octreeDir": "data", + "boundingBox": { + "lx": -2.91016, + "ly": -4.06274, + "lz": 2.63048, + "ux": 4.62238, + "uy": 3.4698, + "uz": 10.163 + }, + "pointAttributes": [ + "POSITION_CARTESIAN", + "COLOR_PACKED" + ], + "spacing": 0.1, + "hierarchy": [ + ["r", 5942], + ["r0", 2174], + ["r1", 450], + ["r2", 3021], + ["r3", 3384], + ["r4", 5667], + ["r5", 857], + ["r6", 4074], + ["r7", 3757], + ["r02", 168], + ["r03", 1923], + ["r05", 628], + ["r07", 5280], + ["r12", 461], + ["r16", 648], + ["r17", 441], + ["r21", 5449], + ["r23", 168], + ["r25", 5898], + ["r27", 107], + ["r30", 4832], + ["r32", 367], + ["r34", 3981], + ["r35", 3131], + ["r36", 22], + ["r40", 3591], + ["r41", 1426], + ["r42", 46], + ["r43", 7635], + ["r44", 374], + ["r45", 1094], + ["r46", 3853], + ["r47", 2986], + ["r50", 74], + ["r51", 1], + ["r52", 2852], + ["r53", 177], + ["r54", 101], + ["r61", 5846], + ["r63", 1221], + ["r64", 2033], + ["r65", 4771], + ["r67", 1662], + ["r70", 6735], + ["r71", 2635], + ["r72", 3326], + ["r73", 650], + ["r76", 1250], + ["r77", 257], + ["r026", 530], + ["r032", 378], + ["r033", 1480], + ["r036", 1889], + ["r037", 3010], + ["r054", 238], + ["r056", 1094], + ["r057", 762], + ["r070", 1843], + ["r071", 1210], + ["r072", 3830], + ["r073", 767], + ["r074", 4861], + ["r075", 106], + ["r076", 5035], + ["r077", 1633], + ["r122", 445], + ["r126", 1023], + ["r162", 373], + ["r163", 36], + ["r164", 1497], + ["r165", 8], + ["r167", 205], + ["r172", 1300], + ["r176", 3], + ["r210", 2788], + ["r211", 633], + ["r212", 838], + ["r213", 4318], + ["r214", 4519], + ["r215", 208], + ["r216", 557], + ["r217", 6047], + ["r231", 155], + ["r235", 440], + ["r250", 4161], + ["r251", 165], + ["r252", 1003], + ["r253", 4764], + ["r254", 1852], + ["r255", 2251], + ["r256", 616], + ["r257", 6818], + ["r275", 381], + ["r300", 2972], + ["r302", 4840], + ["r304", 4053], + ["r306", 5773], + ["r320", 119], + ["r324", 1203], + ["r340", 2357], + ["r341", 2434], + ["r342", 4117], + ["r344", 1997], + ["r345", 2555], + ["r346", 1507], + ["r350", 2269], + ["r352", 3534], + ["r353", 470], + ["r354", 1113], + ["r355", 54], + ["r356", 999], + ["r357", 688], + ["r364", 62], + ["r365", 7], + ["r401", 1424], + ["r403", 2506], + ["r406", 947], + ["r407", 5338], + ["r410", 738], + ["r412", 2277], + ["r413", 564], + ["r414", 77], + ["r416", 922], + ["r417", 45], + ["r424", 29], + ["r425", 104], + ["r430", 4705], + ["r431", 114], + ["r432", 5396], + ["r433", 8405], + ["r434", 4563], + ["r435", 83], + ["r436", 4626], + ["r437", 173], + ["r442", 36], + ["r443", 1068], + ["r447", 18], + ["r452", 998], + ["r453", 2631], + ["r461", 2438], + ["r463", 985], + ["r464", 281], + ["r465", 3004], + ["r466", 1995], + ["r467", 3950], + ["r470", 4351], + ["r471", 9], + ["r472", 5238], + ["r476", 1333], + ["r503", 188], + ["r520", 3417], + ["r521", 681], + ["r522", 5061], + ["r523", 982], + ["r530", 180], + ["r536", 381], + ["r542", 337], + ["r611", 4508], + ["r613", 7480], + ["r614", 1922], + ["r615", 3107], + ["r617", 4582], + ["r631", 2907], + ["r635", 1597], + ["r644", 1899], + ["r645", 3530], + ["r647", 1084], + ["r650", 4204], + ["r651", 1936], + ["r652", 1547], + ["r653", 4255], + ["r654", 3044], + ["r656", 1801], + ["r657", 522], + ["r671", 4687], + ["r673", 177], + ["r674", 220], + ["r675", 950], + ["r700", 5633], + ["r701", 5210], + ["r702", 5704], + ["r703", 5499], + ["r707", 3858], + ["r710", 106], + ["r712", 1416], + ["r714", 1921], + ["r715", 219], + ["r716", 4007], + ["r717", 1460], + ["r720", 3114], + ["r721", 130], + ["r724", 5409], + ["r725", 4051], + ["r734", 2341], + ["r735", 17], + ["r760", 2962], + ["r761", 319], + ["r762", 1073], + ["r763", 2], + ["r770", 824], + ["r771", 27] + ] +} diff --git a/resources/pointclouds/lion_takanawa/cloud_bin.js b/resources/pointclouds/lion_takanawa/cloud_bin.js deleted file mode 100644 index 713768ff..00000000 --- a/resources/pointclouds/lion_takanawa/cloud_bin.js +++ /dev/null @@ -1,235 +0,0 @@ -{ - "version": "1.1", - "octreeDir": "bin", - "boundingBox": { - "lx": -2.91016, - "ly": -4.06274, - "lz": 2.63048, - "ux": 4.62238, - "uy": 2.93155, - "uz": 9.7029 - }, - "pointAttributes": [ - "POSITION_CARTESIAN", - "COLOR_PACKED" - ], - "spacing": 0.075, - "hierarchy": [ - ["r",10452], - ["r0", 2212], - ["r1", 211], - ["r2", 3897], - ["r3", 5105], - ["r4", 6221], - ["r5", 1185], - ["r6", 5263], - ["r7", 5897], - ["r40", 3368], - ["r41", 1773], - ["r42", 192], - ["r43", 8166], - ["r44", 230], - ["r45", 1013], - ["r46", 3262], - ["r47", 3751], - ["r02", 196], - ["r03", 1408], - ["r05", 445], - ["r07", 5992], - ["r12", 153], - ["r16", 550], - ["r17", 23], - ["r52", 3676], - ["r53", 384], - ["r54", 282], - ["r21", 5823], - ["r23", 1138], - ["r25", 7114], - ["r27", 371], - ["r30", 4773], - ["r32", 3023], - ["r34", 5945], - ["r35", 3337], - ["r36", 381], - ["r37", 679], - ["r61", 5986], - ["r63", 1789], - ["r64", 2798], - ["r65", 5754], - ["r67", 2846], - ["r70", 6361], - ["r71", 3398], - ["r72", 7515], - ["r73", 2870], - ["r76", 2052], - ["r77", 317], - ["r401", 1139], - ["r403", 2068], - ["r406", 588], - ["r407", 4803], - ["r424", 85], - ["r425", 422], - ["r410", 882], - ["r412", 908], - ["r413", 1833], - ["r414", 18], - ["r416", 1558], - ["r417", 14], - ["r430", 5802], - ["r431", 9], - ["r432", 6088], - ["r433", 7255], - ["r434", 4254], - ["r435", 305], - ["r436", 5099], - ["r437", 180], - ["r460", 34], - ["r461", 1670], - ["r463", 979], - ["r464", 52], - ["r465", 2132], - ["r466", 1049], - ["r467", 3768], - ["r443", 677], - ["r452", 950], - ["r453", 2186], - ["r470", 4914], - ["r471", 451], - ["r472", 6367], - ["r476", 1684], - ["r026", 489], - ["r033", 804], - ["r037", 3850], - ["r054", 244], - ["r056", 25], - ["r057", 1071], - ["r070", 641], - ["r071", 1745], - ["r072", 2695], - ["r073", 2571], - ["r074", 4818], - ["r075", 1002], - ["r076", 5922], - ["r077", 1651], - ["r122", 33], - ["r126", 388], - ["r162", 23], - ["r163", 22], - ["r164", 1665], - ["r165", 58], - ["r166", 21], - ["r172", 42], - ["r174", 8], - ["r520", 1900], - ["r521", 186], - ["r522", 7834], - ["r523", 2085], - ["r542", 1007], - ["r530", 875], - ["r536", 37], - ["r537", 40], - ["r210", 1327], - ["r211", 2457], - ["r212", 911], - ["r213", 3600], - ["r214", 4148], - ["r215", 1289], - ["r216", 1087], - ["r217", 5700], - ["r231", 2310], - ["r235", 1950], - ["r250", 3354], - ["r251", 1202], - ["r252", 1537], - ["r253", 6186], - ["r254", 400], - ["r255", 4505], - ["r256", 698], - ["r257", 7027], - ["r275", 1313], - ["r300", 2160], - ["r301", 127], - ["r302", 2702], - ["r303", 1979], - ["r304", 2608], - ["r305", 1389], - ["r306", 3511], - ["r307", 2213], - ["r320", 4208], - ["r321", 12], - ["r324", 6112], - ["r325", 596], - ["r340", 10], - ["r341", 3990], - ["r342", 6053], - ["r343", 2556], - ["r344", 8], - ["r345", 5254], - ["r346", 2757], - ["r347", 441], - ["r364", 1267], - ["r367", 7], - ["r350", 3097], - ["r351", 90], - ["r352", 1061], - ["r353", 2328], - ["r354", 865], - ["r355", 10], - ["r356", 1], - ["r357", 1529], - ["r371", 1100], - ["r375", 461], - ["r610", 251], - ["r611", 3535], - ["r613", 6719], - ["r614", 1441], - ["r615", 4298], - ["r617", 5252], - ["r631", 4688], - ["r635", 1561], - ["r644", 2372], - ["r645", 2990], - ["r646", 112], - ["r647", 2348], - ["r650", 4412], - ["r651", 2690], - ["r652", 1870], - ["r653", 4781], - ["r654", 3891], - ["r656", 2585], - ["r657", 240], - ["r671", 5630], - ["r673", 1439], - ["r674", 708], - ["r675", 1971], - ["r677", 144], - ["r700", 5132], - ["r701", 6013], - ["r702", 6140], - ["r703", 6533], - ["r720", 8234], - ["r721", 3888], - ["r722", 62], - ["r724", 7581], - ["r725", 6507], - ["r726", 222], - ["r727", 966], - ["r760", 1859], - ["r761", 610], - ["r762", 3545], - ["r763", 1022], - ["r710", 285], - ["r712", 4409], - ["r714", 811], - ["r715", 1424], - ["r716", 2125], - ["r717", 2556], - ["r730", 1010], - ["r734", 5436], - ["r735", 2319], - ["r736", 1180], - ["r770", 77], - ["r771", 544], - ["r772", 335] - ] -} diff --git a/resources/pointclouds/lion_takanawa/cloud_las.js b/resources/pointclouds/lion_takanawa/cloud_las.js deleted file mode 100644 index 2e1a2715..00000000 --- a/resources/pointclouds/lion_takanawa/cloud_las.js +++ /dev/null @@ -1,231 +0,0 @@ -{ - "version": "1.3", - "octreeDir": "las", - "boundingBox": { - "lx": -2.91016, - "ly": -4.06274, - "lz": 2.63048, - "ux": 4.62238, - "uy": 2.93155, - "uz": 9.7029 - }, - "pointAttributes": "LAS", - "spacing": 0.15, - "hierarchy": [ - ["r", 2675], - ["r0", 834], - ["r1", 99], - ["r2", 1379], - ["r3", 1886], - ["r4", 2239], - ["r5", 419], - ["r6", 1844], - ["r7", 2006], - ["r02", 78], - ["r03", 562], - ["r05", 183], - ["r07", 2270], - ["r12", 83], - ["r16", 218], - ["r17", 14], - ["r21", 2166], - ["r23", 421], - ["r25", 2630], - ["r27", 140], - ["r30", 1815], - ["r32", 1112], - ["r34", 2185], - ["r35", 1533], - ["r36", 137], - ["r37", 307], - ["r40", 1519], - ["r41", 781], - ["r42", 88], - ["r43", 2954], - ["r44", 103], - ["r45", 428], - ["r46", 1331], - ["r47", 1377], - ["r52", 1303], - ["r53", 192], - ["r54", 108], - ["r61", 2166], - ["r63", 647], - ["r64", 1118], - ["r65", 2140], - ["r67", 1068], - ["r70", 2200], - ["r71", 1276], - ["r72", 2562], - ["r73", 1061], - ["r76", 772], - ["r77", 132], - ["r026", 277], - ["r033", 373], - ["r037", 1595], - ["r054", 133], - ["r056", 11], - ["r057", 459], - ["r070", 246], - ["r071", 735], - ["r072", 1117], - ["r073", 1036], - ["r074", 1864], - ["r075", 420], - ["r076", 2308], - ["r077", 669], - ["r122", 23], - ["r126", 209], - ["r162", 16], - ["r163", 16], - ["r164", 686], - ["r165", 39], - ["r166", 14], - ["r172", 31], - ["r174", 5], - ["r210", 536], - ["r211", 1081], - ["r212", 369], - ["r213", 1432], - ["r214", 1604], - ["r215", 533], - ["r216", 410], - ["r217", 2164], - ["r231", 862], - ["r235", 698], - ["r250", 1370], - ["r251", 501], - ["r252", 614], - ["r253", 2334], - ["r254", 171], - ["r255", 1809], - ["r256", 285], - ["r257", 2780], - ["r275", 503], - ["r300", 935], - ["r301", 66], - ["r302", 1090], - ["r303", 798], - ["r304", 1108], - ["r305", 598], - ["r306", 1373], - ["r307", 888], - ["r320", 1578], - ["r321", 9], - ["r324", 2334], - ["r325", 241], - ["r340", 6], - ["r341", 1547], - ["r342", 2303], - ["r343", 993], - ["r344", 6], - ["r345", 2005], - ["r346", 1111], - ["r347", 175], - ["r350", 1544], - ["r351", 60], - ["r352", 547], - ["r353", 1305], - ["r354", 465], - ["r355", 9], - ["r357", 856], - ["r364", 487], - ["r367", 4], - ["r371", 666], - ["r375", 270], - ["r401", 625], - ["r403", 1268], - ["r406", 330], - ["r407", 2564], - ["r410", 456], - ["r412", 524], - ["r413", 792], - ["r414", 12], - ["r416", 773], - ["r417", 10], - ["r424", 49], - ["r425", 223], - ["r430", 2187], - ["r431", 6], - ["r432", 2307], - ["r433", 2810], - ["r434", 1644], - ["r435", 125], - ["r436", 1972], - ["r437", 81], - ["r443", 325], - ["r452", 488], - ["r453", 934], - ["r460", 23], - ["r461", 778], - ["r463", 410], - ["r464", 33], - ["r465", 1057], - ["r466", 630], - ["r467", 1710], - ["r470", 1936], - ["r471", 219], - ["r472", 2378], - ["r476", 671], - ["r520", 828], - ["r521", 114], - ["r522", 3048], - ["r523", 968], - ["r530", 527], - ["r536", 23], - ["r537", 19], - ["r542", 395], - ["r610", 106], - ["r611", 1257], - ["r613", 2573], - ["r614", 568], - ["r615", 1649], - ["r617", 2030], - ["r631", 1788], - ["r635", 628], - ["r644", 1226], - ["r645", 1545], - ["r646", 58], - ["r647", 1096], - ["r650", 1688], - ["r651", 996], - ["r652", 742], - ["r653", 1788], - ["r654", 1580], - ["r656", 1092], - ["r657", 110], - ["r671", 2125], - ["r673", 624], - ["r674", 305], - ["r675", 838], - ["r677", 65], - ["r700", 1634], - ["r701", 2265], - ["r702", 2401], - ["r703", 2239], - ["r710", 137], - ["r712", 1575], - ["r714", 331], - ["r715", 593], - ["r716", 914], - ["r717", 1116], - ["r720", 2956], - ["r721", 1348], - ["r722", 25], - ["r724", 2775], - ["r725", 2540], - ["r726", 97], - ["r727", 384], - ["r730", 364], - ["r734", 2154], - ["r735", 946], - ["r736", 471], - ["r760", 720], - ["r761", 237], - ["r762", 1466], - ["r763", 461], - ["r770", 37], - ["r771", 251], - ["r772", 156] - ] -} diff --git a/resources/pointclouds/lion_takanawa/cloud_laz.js b/resources/pointclouds/lion_takanawa/cloud_laz.js deleted file mode 100644 index b652c233..00000000 --- a/resources/pointclouds/lion_takanawa/cloud_laz.js +++ /dev/null @@ -1,231 +0,0 @@ -{ - "version": "1.3", - "octreeDir": "laz", - "boundingBox": { - "lx": -2.91016, - "ly": -4.06274, - "lz": 2.63048, - "ux": 4.62238, - "uy": 2.93155, - "uz": 9.7029 - }, - "pointAttributes": "LAZ", - "spacing": 0.15, - "hierarchy": [ - ["r", 2675], - ["r0", 834], - ["r1", 99], - ["r2", 1379], - ["r3", 1886], - ["r4", 2239], - ["r5", 419], - ["r6", 1844], - ["r7", 2006], - ["r02", 78], - ["r03", 562], - ["r05", 183], - ["r07", 2270], - ["r12", 83], - ["r16", 218], - ["r17", 14], - ["r21", 2166], - ["r23", 421], - ["r25", 2630], - ["r27", 140], - ["r30", 1815], - ["r32", 1112], - ["r34", 2185], - ["r35", 1533], - ["r36", 137], - ["r37", 307], - ["r40", 1519], - ["r41", 781], - ["r42", 88], - ["r43", 2954], - ["r44", 103], - ["r45", 428], - ["r46", 1331], - ["r47", 1377], - ["r52", 1303], - ["r53", 192], - ["r54", 108], - ["r61", 2166], - ["r63", 647], - ["r64", 1118], - ["r65", 2140], - ["r67", 1068], - ["r70", 2200], - ["r71", 1276], - ["r72", 2562], - ["r73", 1061], - ["r76", 772], - ["r77", 132], - ["r026", 277], - ["r033", 373], - ["r037", 1595], - ["r054", 133], - ["r056", 11], - ["r057", 459], - ["r070", 246], - ["r071", 735], - ["r072", 1117], - ["r073", 1036], - ["r074", 1864], - ["r075", 420], - ["r076", 2308], - ["r077", 669], - ["r122", 23], - ["r126", 209], - ["r162", 16], - ["r163", 16], - ["r164", 686], - ["r165", 39], - ["r166", 14], - ["r172", 31], - ["r174", 5], - ["r210", 536], - ["r211", 1081], - ["r212", 369], - ["r213", 1432], - ["r214", 1604], - ["r215", 533], - ["r216", 410], - ["r217", 2164], - ["r231", 862], - ["r235", 698], - ["r250", 1370], - ["r251", 501], - ["r252", 614], - ["r253", 2334], - ["r254", 171], - ["r255", 1809], - ["r256", 285], - ["r257", 2780], - ["r275", 503], - ["r300", 935], - ["r301", 66], - ["r302", 1090], - ["r303", 798], - ["r304", 1108], - ["r305", 598], - ["r306", 1373], - ["r307", 888], - ["r320", 1578], - ["r321", 9], - ["r324", 2334], - ["r325", 241], - ["r340", 6], - ["r341", 1547], - ["r342", 2303], - ["r343", 993], - ["r344", 6], - ["r345", 2005], - ["r346", 1111], - ["r347", 175], - ["r350", 1544], - ["r351", 60], - ["r352", 547], - ["r353", 1305], - ["r354", 465], - ["r355", 9], - ["r357", 856], - ["r364", 487], - ["r367", 4], - ["r371", 666], - ["r375", 270], - ["r401", 625], - ["r403", 1268], - ["r406", 330], - ["r407", 2564], - ["r410", 456], - ["r412", 524], - ["r413", 792], - ["r414", 12], - ["r416", 773], - ["r417", 10], - ["r424", 49], - ["r425", 223], - ["r430", 2187], - ["r431", 6], - ["r432", 2307], - ["r433", 2810], - ["r434", 1644], - ["r435", 125], - ["r436", 1972], - ["r437", 81], - ["r443", 325], - ["r452", 488], - ["r453", 934], - ["r460", 23], - ["r461", 778], - ["r463", 410], - ["r464", 33], - ["r465", 1057], - ["r466", 630], - ["r467", 1710], - ["r470", 1936], - ["r471", 219], - ["r472", 2378], - ["r476", 671], - ["r520", 828], - ["r521", 114], - ["r522", 3048], - ["r523", 968], - ["r530", 527], - ["r536", 23], - ["r537", 19], - ["r542", 395], - ["r610", 106], - ["r611", 1257], - ["r613", 2573], - ["r614", 568], - ["r615", 1649], - ["r617", 2030], - ["r631", 1788], - ["r635", 628], - ["r644", 1226], - ["r645", 1545], - ["r646", 58], - ["r647", 1096], - ["r650", 1688], - ["r651", 996], - ["r652", 742], - ["r653", 1788], - ["r654", 1580], - ["r656", 1092], - ["r657", 110], - ["r671", 2125], - ["r673", 624], - ["r674", 305], - ["r675", 838], - ["r677", 65], - ["r700", 1634], - ["r701", 2265], - ["r702", 2401], - ["r703", 2239], - ["r710", 137], - ["r712", 1575], - ["r714", 331], - ["r715", 593], - ["r716", 914], - ["r717", 1116], - ["r720", 2956], - ["r721", 1348], - ["r722", 25], - ["r724", 2775], - ["r725", 2540], - ["r726", 97], - ["r727", 384], - ["r730", 364], - ["r734", 2154], - ["r735", 946], - ["r736", 471], - ["r760", 720], - ["r761", 237], - ["r762", 1466], - ["r763", 461], - ["r770", 37], - ["r771", 251], - ["r772", 156] - ] -} diff --git a/resources/pointclouds/lion_takanawa/data/r b/resources/pointclouds/lion_takanawa/data/r new file mode 100644 index 00000000..6e26f55b Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r differ diff --git a/resources/pointclouds/lion_takanawa/data/r0 b/resources/pointclouds/lion_takanawa/data/r0 new file mode 100644 index 00000000..8bd8a5c7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r0 differ diff --git a/resources/pointclouds/lion_takanawa/data/r02 b/resources/pointclouds/lion_takanawa/data/r02 new file mode 100644 index 00000000..d2d3664f Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r02 differ diff --git a/resources/pointclouds/lion_takanawa/data/r026 b/resources/pointclouds/lion_takanawa/data/r026 new file mode 100644 index 00000000..939e3417 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r026 differ diff --git a/resources/pointclouds/lion_takanawa/data/r03 b/resources/pointclouds/lion_takanawa/data/r03 new file mode 100644 index 00000000..cfe83e7f Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r03 differ diff --git a/resources/pointclouds/lion_takanawa/data/r032 b/resources/pointclouds/lion_takanawa/data/r032 new file mode 100644 index 00000000..1cd2a0f2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r032 differ diff --git a/resources/pointclouds/lion_takanawa/data/r033 b/resources/pointclouds/lion_takanawa/data/r033 new file mode 100644 index 00000000..d8f594b0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r033 differ diff --git a/resources/pointclouds/lion_takanawa/data/r036 b/resources/pointclouds/lion_takanawa/data/r036 new file mode 100644 index 00000000..4afde054 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r036 differ diff --git a/resources/pointclouds/lion_takanawa/data/r037 b/resources/pointclouds/lion_takanawa/data/r037 new file mode 100644 index 00000000..cef270f9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r037 differ diff --git a/resources/pointclouds/lion_takanawa/data/r05 b/resources/pointclouds/lion_takanawa/data/r05 new file mode 100644 index 00000000..f519454e Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r05 differ diff --git a/resources/pointclouds/lion_takanawa/data/r054 b/resources/pointclouds/lion_takanawa/data/r054 new file mode 100644 index 00000000..ac682565 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r054 differ diff --git a/resources/pointclouds/lion_takanawa/data/r056 b/resources/pointclouds/lion_takanawa/data/r056 new file mode 100644 index 00000000..4889f763 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r056 differ diff --git a/resources/pointclouds/lion_takanawa/data/r057 b/resources/pointclouds/lion_takanawa/data/r057 new file mode 100644 index 00000000..29ccdfb0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r057 differ diff --git a/resources/pointclouds/lion_takanawa/data/r07 b/resources/pointclouds/lion_takanawa/data/r07 new file mode 100644 index 00000000..d10d8950 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r07 differ diff --git a/resources/pointclouds/lion_takanawa/data/r070 b/resources/pointclouds/lion_takanawa/data/r070 new file mode 100644 index 00000000..2f18dc82 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r070 differ diff --git a/resources/pointclouds/lion_takanawa/data/r071 b/resources/pointclouds/lion_takanawa/data/r071 new file mode 100644 index 00000000..b1b7089b Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r071 differ diff --git a/resources/pointclouds/lion_takanawa/data/r072 b/resources/pointclouds/lion_takanawa/data/r072 new file mode 100644 index 00000000..4a4112c5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r072 differ diff --git a/resources/pointclouds/lion_takanawa/data/r073 b/resources/pointclouds/lion_takanawa/data/r073 new file mode 100644 index 00000000..07447361 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r073 differ diff --git a/resources/pointclouds/lion_takanawa/data/r074 b/resources/pointclouds/lion_takanawa/data/r074 new file mode 100644 index 00000000..d78f1dc9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r074 differ diff --git a/resources/pointclouds/lion_takanawa/data/r075 b/resources/pointclouds/lion_takanawa/data/r075 new file mode 100644 index 00000000..8bf99548 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r075 differ diff --git a/resources/pointclouds/lion_takanawa/data/r076 b/resources/pointclouds/lion_takanawa/data/r076 new file mode 100644 index 00000000..f03895f6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r076 differ diff --git a/resources/pointclouds/lion_takanawa/data/r077 b/resources/pointclouds/lion_takanawa/data/r077 new file mode 100644 index 00000000..458339bf Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r077 differ diff --git a/resources/pointclouds/lion_takanawa/data/r1 b/resources/pointclouds/lion_takanawa/data/r1 new file mode 100644 index 00000000..d250115a Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r1 differ diff --git a/resources/pointclouds/lion_takanawa/data/r12 b/resources/pointclouds/lion_takanawa/data/r12 new file mode 100644 index 00000000..4eedeaf0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r12 differ diff --git a/resources/pointclouds/lion_takanawa/data/r122 b/resources/pointclouds/lion_takanawa/data/r122 new file mode 100644 index 00000000..5cd73fb4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r122 differ diff --git a/resources/pointclouds/lion_takanawa/data/r126 b/resources/pointclouds/lion_takanawa/data/r126 new file mode 100644 index 00000000..1fd09791 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r126 differ diff --git a/resources/pointclouds/lion_takanawa/data/r16 b/resources/pointclouds/lion_takanawa/data/r16 new file mode 100644 index 00000000..8d172dc7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r16 differ diff --git a/resources/pointclouds/lion_takanawa/data/r162 b/resources/pointclouds/lion_takanawa/data/r162 new file mode 100644 index 00000000..67013055 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r162 differ diff --git a/resources/pointclouds/lion_takanawa/data/r163 b/resources/pointclouds/lion_takanawa/data/r163 new file mode 100644 index 00000000..64f7a766 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r163 differ diff --git a/resources/pointclouds/lion_takanawa/data/r164 b/resources/pointclouds/lion_takanawa/data/r164 new file mode 100644 index 00000000..c4fc12ab Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r164 differ diff --git a/resources/pointclouds/lion_takanawa/data/r165 b/resources/pointclouds/lion_takanawa/data/r165 new file mode 100644 index 00000000..6a00f0f7 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r165 @@ -0,0 +1 @@ +ŒJZ?GrÀŒÛA 'ÿYW?ˆcÀ¤ßA‘²xÿgÕW?NÑÀ A‡°qÿš[?U0À×A)HÿŒZ?ŸÍÀtFAn›JÿKYV?ÜhÀtFA•¹…ÿ~ŒY?€·ÀTRA…¯pÿŒJZ?¯”À5^A†¯sÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r167 b/resources/pointclouds/lion_takanawa/data/r167 new file mode 100644 index 00000000..d33d827a Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r167 differ diff --git a/resources/pointclouds/lion_takanawa/data/r17 b/resources/pointclouds/lion_takanawa/data/r17 new file mode 100644 index 00000000..316156d7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r17 differ diff --git a/resources/pointclouds/lion_takanawa/data/r172 b/resources/pointclouds/lion_takanawa/data/r172 new file mode 100644 index 00000000..a1676b52 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r172 differ diff --git a/resources/pointclouds/lion_takanawa/data/r176 b/resources/pointclouds/lion_takanawa/data/r176 new file mode 100644 index 00000000..80aee7df --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r176 @@ -0,0 +1 @@ +•eˆ=uš¾:’ALH,ÿçû)=p_§¾µ7AVa7ÿ“©=÷䡾^KAetUÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r2 b/resources/pointclouds/lion_takanawa/data/r2 new file mode 100644 index 00000000..15e67f8a Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r2 differ diff --git a/resources/pointclouds/lion_takanawa/data/r21 b/resources/pointclouds/lion_takanawa/data/r21 new file mode 100644 index 00000000..4da7f742 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r21 differ diff --git a/resources/pointclouds/lion_takanawa/data/r210 b/resources/pointclouds/lion_takanawa/data/r210 new file mode 100644 index 00000000..f49e227a Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r210 differ diff --git a/resources/pointclouds/lion_takanawa/data/r211 b/resources/pointclouds/lion_takanawa/data/r211 new file mode 100644 index 00000000..10a126d8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r211 differ diff --git a/resources/pointclouds/lion_takanawa/data/r212 b/resources/pointclouds/lion_takanawa/data/r212 new file mode 100644 index 00000000..8e330e1c Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r212 differ diff --git a/resources/pointclouds/lion_takanawa/data/r213 b/resources/pointclouds/lion_takanawa/data/r213 new file mode 100644 index 00000000..87196835 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r213 differ diff --git a/resources/pointclouds/lion_takanawa/data/r214 b/resources/pointclouds/lion_takanawa/data/r214 new file mode 100644 index 00000000..6aed6a61 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r214 differ diff --git a/resources/pointclouds/lion_takanawa/data/r215 b/resources/pointclouds/lion_takanawa/data/r215 new file mode 100644 index 00000000..96ccfb78 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r215 differ diff --git a/resources/pointclouds/lion_takanawa/data/r216 b/resources/pointclouds/lion_takanawa/data/r216 new file mode 100644 index 00000000..cc355b87 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r216 differ diff --git a/resources/pointclouds/lion_takanawa/data/r217 b/resources/pointclouds/lion_takanawa/data/r217 new file mode 100644 index 00000000..311466c3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r217 differ diff --git a/resources/pointclouds/lion_takanawa/data/r23 b/resources/pointclouds/lion_takanawa/data/r23 new file mode 100644 index 00000000..7fc18025 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r23 differ diff --git a/resources/pointclouds/lion_takanawa/data/r231 b/resources/pointclouds/lion_takanawa/data/r231 new file mode 100644 index 00000000..8de7c9d1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r231 differ diff --git a/resources/pointclouds/lion_takanawa/data/r235 b/resources/pointclouds/lion_takanawa/data/r235 new file mode 100644 index 00000000..48744f98 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r235 differ diff --git a/resources/pointclouds/lion_takanawa/data/r25 b/resources/pointclouds/lion_takanawa/data/r25 new file mode 100644 index 00000000..13d43dce Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r25 differ diff --git a/resources/pointclouds/lion_takanawa/data/r250 b/resources/pointclouds/lion_takanawa/data/r250 new file mode 100644 index 00000000..e6fada31 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r250 differ diff --git a/resources/pointclouds/lion_takanawa/data/r251 b/resources/pointclouds/lion_takanawa/data/r251 new file mode 100644 index 00000000..cd7b3433 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r251 differ diff --git a/resources/pointclouds/lion_takanawa/data/r252 b/resources/pointclouds/lion_takanawa/data/r252 new file mode 100644 index 00000000..18f40210 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r252 differ diff --git a/resources/pointclouds/lion_takanawa/data/r253 b/resources/pointclouds/lion_takanawa/data/r253 new file mode 100644 index 00000000..bf9706af Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r253 differ diff --git a/resources/pointclouds/lion_takanawa/data/r254 b/resources/pointclouds/lion_takanawa/data/r254 new file mode 100644 index 00000000..1a32db9e Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r254 differ diff --git a/resources/pointclouds/lion_takanawa/data/r255 b/resources/pointclouds/lion_takanawa/data/r255 new file mode 100644 index 00000000..90f68062 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r255 differ diff --git a/resources/pointclouds/lion_takanawa/data/r256 b/resources/pointclouds/lion_takanawa/data/r256 new file mode 100644 index 00000000..bdea43c8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r256 differ diff --git a/resources/pointclouds/lion_takanawa/data/r257 b/resources/pointclouds/lion_takanawa/data/r257 new file mode 100644 index 00000000..5e6d628f Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r257 differ diff --git a/resources/pointclouds/lion_takanawa/data/r27 b/resources/pointclouds/lion_takanawa/data/r27 new file mode 100644 index 00000000..bc48c7c2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r27 differ diff --git a/resources/pointclouds/lion_takanawa/data/r275 b/resources/pointclouds/lion_takanawa/data/r275 new file mode 100644 index 00000000..27a89625 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r275 differ diff --git a/resources/pointclouds/lion_takanawa/data/r3 b/resources/pointclouds/lion_takanawa/data/r3 new file mode 100644 index 00000000..5a522d28 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r3 differ diff --git a/resources/pointclouds/lion_takanawa/data/r30 b/resources/pointclouds/lion_takanawa/data/r30 new file mode 100644 index 00000000..4fb39306 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r30 differ diff --git a/resources/pointclouds/lion_takanawa/data/r300 b/resources/pointclouds/lion_takanawa/data/r300 new file mode 100644 index 00000000..1f87cfd4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r300 differ diff --git a/resources/pointclouds/lion_takanawa/data/r302 b/resources/pointclouds/lion_takanawa/data/r302 new file mode 100644 index 00000000..7f4ffda5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r302 differ diff --git a/resources/pointclouds/lion_takanawa/data/r304 b/resources/pointclouds/lion_takanawa/data/r304 new file mode 100644 index 00000000..4367f013 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r304 differ diff --git a/resources/pointclouds/lion_takanawa/data/r306 b/resources/pointclouds/lion_takanawa/data/r306 new file mode 100644 index 00000000..45522202 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r306 differ diff --git a/resources/pointclouds/lion_takanawa/data/r32 b/resources/pointclouds/lion_takanawa/data/r32 new file mode 100644 index 00000000..f18bdc85 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r32 differ diff --git a/resources/pointclouds/lion_takanawa/data/r320 b/resources/pointclouds/lion_takanawa/data/r320 new file mode 100644 index 00000000..c5c3ec35 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r320 differ diff --git a/resources/pointclouds/lion_takanawa/data/r324 b/resources/pointclouds/lion_takanawa/data/r324 new file mode 100644 index 00000000..1164797c Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r324 differ diff --git a/resources/pointclouds/lion_takanawa/data/r34 b/resources/pointclouds/lion_takanawa/data/r34 new file mode 100644 index 00000000..ec37279b Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r34 differ diff --git a/resources/pointclouds/lion_takanawa/data/r340 b/resources/pointclouds/lion_takanawa/data/r340 new file mode 100644 index 00000000..913eb016 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r340 differ diff --git a/resources/pointclouds/lion_takanawa/data/r341 b/resources/pointclouds/lion_takanawa/data/r341 new file mode 100644 index 00000000..3e3def99 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r341 differ diff --git a/resources/pointclouds/lion_takanawa/data/r342 b/resources/pointclouds/lion_takanawa/data/r342 new file mode 100644 index 00000000..f4d8fde1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r342 differ diff --git a/resources/pointclouds/lion_takanawa/data/r344 b/resources/pointclouds/lion_takanawa/data/r344 new file mode 100644 index 00000000..60fbfeaf Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r344 differ diff --git a/resources/pointclouds/lion_takanawa/data/r345 b/resources/pointclouds/lion_takanawa/data/r345 new file mode 100644 index 00000000..a6d10ac6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r345 differ diff --git a/resources/pointclouds/lion_takanawa/data/r346 b/resources/pointclouds/lion_takanawa/data/r346 new file mode 100644 index 00000000..3c5f691d Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r346 differ diff --git a/resources/pointclouds/lion_takanawa/data/r35 b/resources/pointclouds/lion_takanawa/data/r35 new file mode 100644 index 00000000..e82232ac Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r35 differ diff --git a/resources/pointclouds/lion_takanawa/data/r350 b/resources/pointclouds/lion_takanawa/data/r350 new file mode 100644 index 00000000..99c13253 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r350 differ diff --git a/resources/pointclouds/lion_takanawa/data/r352 b/resources/pointclouds/lion_takanawa/data/r352 new file mode 100644 index 00000000..d0d1fde8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r352 differ diff --git a/resources/pointclouds/lion_takanawa/data/r353 b/resources/pointclouds/lion_takanawa/data/r353 new file mode 100644 index 00000000..136f3061 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r353 differ diff --git a/resources/pointclouds/lion_takanawa/data/r354 b/resources/pointclouds/lion_takanawa/data/r354 new file mode 100644 index 00000000..79d28a6c Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r354 differ diff --git a/resources/pointclouds/lion_takanawa/data/r355 b/resources/pointclouds/lion_takanawa/data/r355 new file mode 100644 index 00000000..e9abdfe9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r355 differ diff --git a/resources/pointclouds/lion_takanawa/data/r356 b/resources/pointclouds/lion_takanawa/data/r356 new file mode 100644 index 00000000..49ba9e62 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r356 differ diff --git a/resources/pointclouds/lion_takanawa/data/r357 b/resources/pointclouds/lion_takanawa/data/r357 new file mode 100644 index 00000000..f33780ce Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r357 differ diff --git a/resources/pointclouds/lion_takanawa/data/r36 b/resources/pointclouds/lion_takanawa/data/r36 new file mode 100644 index 00000000..45ba0d49 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r36 @@ -0,0 +1 @@ +§y7?]þË?¾Ì@Ÿ¦¯ÿd;_>� @î@qpnÿjÞ1>}?@îZî@mlhÿxK>ž^@ cî@rqmÿ¹�F>åò@гë@qniÿú~J?d]Ì?ª`Î@‹’˜ÿé&Q?]þË?�€Î@uz~ÿÜ×A?ÚÌ?‚âÍ@�‡�ÿKYV?~ŒÑ?£Î@˜ «ÿôL?&Ó?)\Í@stÿúí;?˜ÝË?øSÍ@¥«´ÿgÕW?ï8Í?KYÎ@fjnÿìÀI?±¿Ô??ÆÌ@y{ƒÿgDI?sÏ?X9Î@w}‚ÿ˜LE?Ç)Ò?n£Í@�—¡ÿ;ß??L¦Ò?t$Í@�“Ÿÿ c>?‰ÒÎ?n£Í@ª±ºÿг9?[±Ï?¾Ì@ª°»ÿMóN?îëÐ?£Î@bhoÿ/ÝT?o�Ô?Í@‡‰‘ÿ‘Z?-CÔ?�ÂÍ@Š‹�ÿ‘Z?¿}Õ?ݵÌ@}€Žÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r364 b/resources/pointclouds/lion_takanawa/data/r364 new file mode 100644 index 00000000..cf778e64 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r364 @@ -0,0 +1,2 @@ +0»7?´YÍ?¾Ì@ §²ÿ¹ü7?‘~Ë?ÐÕÌ@¡¨²ÿ>y8?Ï?ݵÌ@–�©ÿ¶óM?ázÌ?lxÎ@kpvÿü©Q?]þË?ý‡Î@{�…ÿ¹�F?ÚÌ?eÎ@{€†ÿgDI?ÚÌ?KYÎ@}ƒ‰ÿWìO?ÕçÒ?ºkÍ@ž¡¬ÿNb@?2wÍ?ÁÊÍ@‘˜ ÿàœA?‰ÒÎ?Î@˜ž¦ÿú~J?�1Ï?ª`Î@„‰‘ÿ-²M?Ï?;pÎ@}�ˆÿ¸U?»¸Í?ª`Î@ejnÿŒJZ?èÙÌ?KYÎ@‚‡‹ÿ¸U?¬­Ð?eÎ@imwÿu“X?…ëÑ?£Î@„ˆ�ÿîëP?‰ÒÎ?ª`Î@nsyÿîZB?SÓ?×4Í@‚�ÿvq;?˜ÝË?6<Í@ ¨±ÿ›æ=?ázÌ?ësÍ@ƒŠ’ÿÐD?9ÖÍ?X9Î@“™ ÿ¹�F?ã¥Ó?˜LÍ@tt�ÿ©¤>?sÏ?ΪÍ@¤«µÿûJ?pÎÐ?eÎ@œŸ¨ÿ˜LE?h"Ô?ÐÕÌ@}€‰ÿcI?ã¥Ó?‘íÌ@‚ƒŒÿvq;?w-Ñ?¾Ì@™ «ÿ›æ=?ü©Ñ?Í@�‘�ÿcî:?�1Ï?äÍ@‘˜¢ÿîZB?…ëÑ?{ƒÍ@˜�§ÿ0LF?ü©Ñ?�ÂÍ@}‚‹ÿìÀI?…ëÑ?�ÂÍ@v|„ÿ¶óM?ü©Ñ?òÒÍ@fksÿîëP?w-Ñ?òÍ@bipÿŒZ?ioÐ?Ç)Î@€ƒ‰ÿ-!??³ Ñ?ësÍ@¢¨²ÿœ¢S?SÓ?¬‹Í@—�¤ÿYW?SÓ?ÿ²Í@ƒ‡�ÿs×B?¦›Ì?DúÍ@‚†�ÿ= +G?ioÐ?Õ Î@�•ŸÿÅ @?VŸË?ΪÍ@jqxÿš[?…Ó?‚âÍ@—›£ÿ¸U?˜ÝË?lxÎ@gkoÿ?5N?ª`Ô?ÐÕÌ@ss~ÿøSC?çŒÐ?‚âÍ@‹�˜ÿðX?‰ÒÎ?X9Î@}�‡ÿW[A?&äÓ?ݵÌ@¤©´ÿÞ“W?±¿Ô?gDÍ@šŸ©ÿ=›U?;Õ??ÆÌ@}}‰ÿ÷äQ?4¢Ô?¾Ì@‚‚�ÿÐD?ŠË?òÒÍ@uz€ÿ2æ>?ÇÒ?ݵÌ@¢§²ÿ~ŒY?B`Õ?ÐÕÌ@€�ÿKÈG?VÎ?QÎ@ƒ‰�ÿŒZ?¸Õ?J{Í@––žÿª`T?êÔ?6<Í@�“ŸÿŒJZ?O@Ë?ª`Î@bilÿ$¹L?ÇÒ?ˆcÍ@wx}ÿuJ?;Õ?ݵÌ@ŒŽ˜ÿZõ9?ï8Í?³ Í@ÄÌ×ÿƒ/Ð@ˆôí@srnÿ¼tS>Ð@J î@usoÿœ3b> q@Wìí@trqÿ‰A`>¸@œ3î@nljÿjÞ1>ù@Í;î@dc_ÿ¦›D>åò@’Ëë@olgÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r4 b/resources/pointclouds/lion_takanawa/data/r4 new file mode 100644 index 00000000..d850c845 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r4 differ diff --git a/resources/pointclouds/lion_takanawa/data/r40 b/resources/pointclouds/lion_takanawa/data/r40 new file mode 100644 index 00000000..c2ee4db0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r40 differ diff --git a/resources/pointclouds/lion_takanawa/data/r401 b/resources/pointclouds/lion_takanawa/data/r401 new file mode 100644 index 00000000..a62f3104 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r401 differ diff --git a/resources/pointclouds/lion_takanawa/data/r403 b/resources/pointclouds/lion_takanawa/data/r403 new file mode 100644 index 00000000..1839ceb3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r403 differ diff --git a/resources/pointclouds/lion_takanawa/data/r406 b/resources/pointclouds/lion_takanawa/data/r406 new file mode 100644 index 00000000..bc11c5aa Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r406 differ diff --git a/resources/pointclouds/lion_takanawa/data/r407 b/resources/pointclouds/lion_takanawa/data/r407 new file mode 100644 index 00000000..a49cbef0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r407 differ diff --git a/resources/pointclouds/lion_takanawa/data/r41 b/resources/pointclouds/lion_takanawa/data/r41 new file mode 100644 index 00000000..175dd1d4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r41 differ diff --git a/resources/pointclouds/lion_takanawa/data/r410 b/resources/pointclouds/lion_takanawa/data/r410 new file mode 100644 index 00000000..84113bb9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r410 differ diff --git a/resources/pointclouds/lion_takanawa/data/r412 b/resources/pointclouds/lion_takanawa/data/r412 new file mode 100644 index 00000000..49b6616e Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r412 differ diff --git a/resources/pointclouds/lion_takanawa/data/r413 b/resources/pointclouds/lion_takanawa/data/r413 new file mode 100644 index 00000000..9f67d2b0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r413 differ diff --git a/resources/pointclouds/lion_takanawa/data/r414 b/resources/pointclouds/lion_takanawa/data/r414 new file mode 100644 index 00000000..8776a16c --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r414 @@ -0,0 +1 @@ +D‹@ÙJÀ]m•@auAÿ"l@rŠJÀdÌ•@c{AÿRI@rŠJÀõÛ•@Yr9ÿ[±@»'KÀj–@]r;ÿÕx@xKÀ+—@[w?ÿÉv@†KÀ�(—@Sh4ÿ33@üKÀ8—@e„Mÿ_@øÂLÀš–@by<ÿã6@rŠJÀÞ’@Rd>ÿ~@»'KÀÑ‘–@XsBÿ­ú@2ULÀš–@Us>ÿ@XÊJÀUÁ–@bv;ÿˆ…@†KÀ$¹–@a|?ÿRI@½ãLÀk+–@Xs@ÿ µ@@MÀŒJ–@Yu<ÿ�ä@¯%LÀ½R–@^yAÿǺ@«ÏMÀù1”@LN@ÿö—@üKÀ¨W’@Pe9ÿã6@“©JÀ˜L“@N]:ÿßà@rŠJÀp_—@ay9ÿzÇ@ÙJÀc—@Xg<ÿ µ@üKÀóŽ—@;K'ÿ»¸@šKÀŸ«“@M]Aÿ¦›@ AMÀ�“@;84ÿV@ΪOÀòÒ“@CC;ÿã6@oðMÀQÚ“@KY<ÿRI@øÂLÀÕ ”@EE<ÿýö@ŽLÀ7”@\qJÿýö@õ¹JÀ–!”@Nb9ÿ~@ AMÀΈ”@;92ÿ @åaMÀ_˜”@WbAÿ7‰@TtLÀlx”@]sHÿV@¤pMÀΈ”@Vn@ÿýö@üKÀ±¿”@So<ÿ“:@rŠJÀ5ï”@Wo>ÿ»¸@?WKÀ¾’@Uj?ÿ"l@½ãLÀ5ï”@UYFÿ®@àœIÀ…•@`rBÿ°@¥½IÀ+‡’@K`5ÿ Ò@]mIÀ¼–’@H[1ÿ¾@ìQHÀ}®’@H]2ÿHP@vàHÀ$(’@Rh<ÿ_@)íIÀŸ«“@PU>ÿ©¤@¸IÀŸ«“@?@7ÿñô@çûIÀ‘í’@YoBÿœ¢@ÿHP@.�HÀä“@M]9ÿ–C@.�HÀ‚â“@CJ=ÿ33@ÆÜIÀ$¹–@bv;ÿŠŽ@ìQHÀû�@B97ÿb@ìQHÀÉ‘@Vh<ÿýö@.�HÀu”@EJ7ÿEG@îZJÀ¨W’@Mb7ÿs@—ÿHÀºk“@7<-ÿ£@‚âGÀ|“@GR9ÿ:#@åòGÀ-C–@CH:ÿ0*@Í;JÀ¡g—@b{@ÿt$@)íIÀ¶ó•@Mb1ÿio@‚âGÀ†Z‘@>?0ÿ µ@HÀX9”@AC6ÿØ�@HÀ‰A”@ZhBÿ Ò@aÃGÀ³ê“@QaAÿEG@‚âGÀð§”@KP7ÿÂ@ÐHÀBÏ”@cuGÿ:’@h"HÀÌ]•@cyCÿio@¿}IÀàœ•@`yBÿôý@ìQHÀ®Ø‘@Qc:ÿ#Û@'1HÀé‘@O`:ÿû\@HÀ°‘@F?:ÿÙ=@aÃGÀ_’@Sh<ÿ1™@åòGÀV}�@Se?ÿ�&@ AMÀTt˜@Rl=ÿEG@ÐDLÀñc˜@LW6ÿÂ@rŠJÀ0L˜@?C4ÿñô@zJÀúí—@00(ÿßà@ÙJÀúí—@n„VÿÂ@zJÀ˜Ý—@CK9ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r416 b/resources/pointclouds/lion_takanawa/data/r416 new file mode 100644 index 00000000..c7f4cdb9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r416 differ diff --git a/resources/pointclouds/lion_takanawa/data/r417 b/resources/pointclouds/lion_takanawa/data/r417 new file mode 100644 index 00000000..aed6d958 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r417 differ diff --git a/resources/pointclouds/lion_takanawa/data/r42 b/resources/pointclouds/lion_takanawa/data/r42 new file mode 100644 index 00000000..50e2803d Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r42 differ diff --git a/resources/pointclouds/lion_takanawa/data/r424 b/resources/pointclouds/lion_takanawa/data/r424 new file mode 100644 index 00000000..8138add4 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r424 @@ -0,0 +1,16 @@ +£#%@–C À×b@›¹dÿ&S%@s ÀWìc@›·dÿû:(@7‰ Àázd@p{IÿEØ(@%u +À¤ßb@K_#ÿ}®&@X¨ À®c@š³nÿŽu)@V +ÀÀ[d@dm=ÿ-²%@ê• +À|ab@˜´aÿ‹l'@ö— ÀÚd@‹�dÿÝ$*@mÅ +Àû:d@[m7ÿ4%@ê• +ÀõÛc@ ÁpÿÝ$*@©¤ +ÀÅþb@Ub3ÿ„ '@ +ÀÊTa@´ÑyÿºI(@¬ÀTãa@³Îxÿä%@ ÀI.c@ Ãpÿ='@EG +Àb¡b@k„8ÿgD%@X¨ ÀWìc@¡Âpÿ±á%@0* Àû:d@¨Çtÿ�Â%@,Ô +Àšd@“³]ÿû:(@EG +ÀQb@�™IÿQ&@ê• +À,ea@³Ñvÿ+)@ýö Àù1b@ФSÿþC*@©¤ +À×b@cz6ÿªñ*@t$ Àòa@bt9ÿU0&@_ +ÀÅþb@†¨RÿL7)@ À[Bb@‘®Xÿ_˜(@ +ÀõÛc@Wd5ÿ³ê'@ã6 +À«>c@L^)ÿà¾&@0* Àázd@«Â}ÿõÛ'@X¨ À¨5a@µÓÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r425 b/resources/pointclouds/lion_takanawa/data/r425 new file mode 100644 index 00000000..5d25efe3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r425 differ diff --git a/resources/pointclouds/lion_takanawa/data/r43 b/resources/pointclouds/lion_takanawa/data/r43 new file mode 100644 index 00000000..d51a2724 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r43 differ diff --git a/resources/pointclouds/lion_takanawa/data/r430 b/resources/pointclouds/lion_takanawa/data/r430 new file mode 100644 index 00000000..083e9272 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r430 differ diff --git a/resources/pointclouds/lion_takanawa/data/r431 b/resources/pointclouds/lion_takanawa/data/r431 new file mode 100644 index 00000000..4cc1ff1c Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r431 differ diff --git a/resources/pointclouds/lion_takanawa/data/r432 b/resources/pointclouds/lion_takanawa/data/r432 new file mode 100644 index 00000000..05d6a07f Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r432 differ diff --git a/resources/pointclouds/lion_takanawa/data/r433 b/resources/pointclouds/lion_takanawa/data/r433 new file mode 100644 index 00000000..05994280 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r433 differ diff --git a/resources/pointclouds/lion_takanawa/data/r434 b/resources/pointclouds/lion_takanawa/data/r434 new file mode 100644 index 00000000..00bb314d Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r434 differ diff --git a/resources/pointclouds/lion_takanawa/data/r435 b/resources/pointclouds/lion_takanawa/data/r435 new file mode 100644 index 00000000..ecc2bc35 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r435 @@ -0,0 +1,9 @@ +~,@˜ÝÀ/Ý®@UQPÿ*@EØÀ<½®@B9<ÿð…)@)\ÀW[¯@;57ÿmV)@¥,À µ®@935ÿS–)@ý‡ÀÇK¯@.%&ÿHá*@A‚À–C¯@E??ÿA‚*@þCÀI�®@LFFÿ;ß+@…|ÀW[¯@TPOÿœ3*@ð…À4¯@E;?ÿçŒ,@0* ÀW[¯@WSPÿ¥)@³êÀþÔ®@:25ÿa+@p_Àá ¯@KEEÿ‰Ò*@s ÀjM±@A:=ÿÙÎ+@s À%±@D@?ÿ…|,@øS Àྰ@FA@ÿÏf)@·b À#Û±@824ÿÝ$*@øS Àœ±@>8:ÿ c*@®Àpΰ@914ÿ¸¯+@VŸÀœ¢¯@MGGÿı*@óŽÀ;p°@:45ÿË+@‘~À4°@?9:ÿ‚s*@HáÀ¸@°@4-.ÿtµ)@tµÀ¼t±@.%*ÿS–)@ð…À¡Ö°@4+.ÿ;ß+@V +À¡Ö°@A=<ÿúí+@Õx À¸@°@EA@ÿ„ '@ËÀO¯°@1(,ÿ¥)@ÒoÀ~Œ±@5,1ÿð…)@mVÀ¸@°@5,.ÿ{*@'ÂÀÓÞ°@2),ÿ¬‹'@¯”ÀjM±@.%*ÿj(@ö— À”ö°@5/1ÿË+@HáÀ-²¯@HBCÿO@+@ýö À„ ±@>99ÿ>y(@ÏfÀî|±@' "ÿÖÅ)@ö— À¡Ö°@A;>ÿÁ¨(@>yÀ®¶°@.&'ÿZ(@ cÀ‹l±@1(-ÿ¾Ÿ&@¶óÀF%±@.%*ÿ_˜(@ÙÎÀ9E±@+%%ÿ-!+@MÀHP°@E??ÿÒo+@…|ÀAñ¯@:55ÿtµ)@é&À-²¯@914ÿA‚*@,Ô +À2æ°@@:<ÿ’Ë'@Î ÀM„±@:76ÿœ'@QÚÀ̰@3,3ÿÈ)@™*ÀHP°@.&'ÿ$¹(@©¤ +Àç±@5.1ÿ¥)@ µ +ÀjM±@935ÿœ3*@{À†8°@@79ÿA‚*@¶óÀ Ò¯@:24ÿ™*(@~À@¤±@6-2ÿmV)@]þÀ„ ±@6-0ÿÈ)@ZÀÙ¯@+"#ÿ"l,@ã6 +ÀH°@FBAÿ +@KêÀྰ@F@BÿM,@Î À Ò¯@PLKÿ‚s*@>è À%±@>99ÿ÷ä)@D‹Àǰ@0**ÿû'@…|À=±@,$'ÿ„ '@€·À%±@,&,ÿL7)@Î Àôý°@+%%ÿNÑ%@'ÂÀ®¶°@.&+ÿ0»'@ªñÀµ±@,$)ÿû'@EØÀw-±@1).ÿZõ)@åÐÀ9E±@/&)ÿŽu)@:#À̰@7.1ÿ„ '@VŸÀôý°@3*.ÿ®G)@>è Àç±@<68ÿÈ)@ıÀ@¤±@2)-ÿ÷ä)@'ÂÀ¼±@1(-ÿ¬,@¦›Àñô®@PLJÿÉv.@ã6 +ÀW[¯@jfeÿ»¸-@»¸ ÀI�®@d`_ÿÕx-@»¸ À&S¯@_[Yÿq-@´Y À�¯@XTRÿ -@­úÀI�®@YUTÿff.@·b À¸@°@NKIÿ�ä.@·b ÀÙ¯@iedÿõJ-@–C À̰@D@?ÿ»¸-@ˆ… +À±á¯@KIGÿˆ….@©¤ +À¾Á¯@POMÿ)Ë,@zÇ Àü©¯@UQPÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r436 b/resources/pointclouds/lion_takanawa/data/r436 new file mode 100644 index 00000000..45239565 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r436 differ diff --git a/resources/pointclouds/lion_takanawa/data/r437 b/resources/pointclouds/lion_takanawa/data/r437 new file mode 100644 index 00000000..e94d432f Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r437 differ diff --git a/resources/pointclouds/lion_takanawa/data/r44 b/resources/pointclouds/lion_takanawa/data/r44 new file mode 100644 index 00000000..bf9b7129 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r44 differ diff --git a/resources/pointclouds/lion_takanawa/data/r442 b/resources/pointclouds/lion_takanawa/data/r442 new file mode 100644 index 00000000..4e44b0c4 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r442 @@ -0,0 +1 @@ +¾Á/@ØðÀò°X@°Èÿ¼1@ßOÀÐX@™¯oÿ·b/@ñcÀw@³ª¯ÿ•†@O¯ À®w@°§¬ÿ©¤†@R¸À®w@±§¯ÿÆm†@û\ ÀŸè@ÂÎ?u“A¢Ÿ¦ÿ @TRÏ?·A©¤¨ÿ @¥NÐ?KêA£ ¥ÿ @$¹Ì?�€A¥ ¤ÿKê@2wÍ?¡ÖA¥ ¤ÿEG@ÚÌ?=›A¢�£ÿRI@ü©Ñ?n£A±¬®ÿŒÛ@d]Ì?¬‹A¢Ÿ¦ÿ)Ë@Ï?9EAŸ�¢ÿj@ã¥Ó?O¯Až˜œÿÎ@ŠË?™»A™—œÿ0*@…ëÑ?jÞAž™Ÿÿ�&@Ó¼Ë?ºÚA«¦«ÿÕx@žïÏ?\�A«¦ªÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r76 b/resources/pointclouds/lion_takanawa/data/r76 new file mode 100644 index 00000000..2c9c1807 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r76 differ diff --git a/resources/pointclouds/lion_takanawa/data/r760 b/resources/pointclouds/lion_takanawa/data/r760 new file mode 100644 index 00000000..b54e119b Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r760 differ diff --git a/resources/pointclouds/lion_takanawa/data/r761 b/resources/pointclouds/lion_takanawa/data/r761 new file mode 100644 index 00000000..a8e94d1e Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r761 differ diff --git a/resources/pointclouds/lion_takanawa/data/r762 b/resources/pointclouds/lion_takanawa/data/r762 new file mode 100644 index 00000000..d90cdd42 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r762 differ diff --git a/resources/pointclouds/lion_takanawa/data/r763 b/resources/pointclouds/lion_takanawa/data/r763 new file mode 100644 index 00000000..f8c84ab8 --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r763 @@ -0,0 +1 @@ +àœ1@ F%@¡Öê@®®°ÿ1™2@˜Ý'@¡Öê@³±³ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/data/r77 b/resources/pointclouds/lion_takanawa/data/r77 new file mode 100644 index 00000000..b5028e92 Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r77 differ diff --git a/resources/pointclouds/lion_takanawa/data/r770 b/resources/pointclouds/lion_takanawa/data/r770 new file mode 100644 index 00000000..f3fc7fad Binary files /dev/null and b/resources/pointclouds/lion_takanawa/data/r770 differ diff --git a/resources/pointclouds/lion_takanawa/data/r771 b/resources/pointclouds/lion_takanawa/data/r771 new file mode 100644 index 00000000..d843a02c --- /dev/null +++ b/resources/pointclouds/lion_takanawa/data/r771 @@ -0,0 +1,4 @@ +ÞI@Á9ë?¯%A��‹ÿ«ÏI@•ì?ÎA~}‚ÿ¤pI@ôì?VŸA��’ÿ².J@4î?ôýAunuÿ$—G@' é?9EA™—�ÿ»'G@� è?F”Aމ�ÿ¡gG@üë?ºÚAƒƒŒÿn4H@õ¹ê?+öA��˜ÿêH@ $è?é·A™˜žÿâH@ž^é?œA‡…‹ÿ1™F@xœê?cîA„„ŽÿzF@ +×ë?§Aš˜œÿÆÜE@.ÿé?9EA€€…ÿõ¹F@cé?aAŒŠ‘ÿÉåG@\ é?¼tA£¢§ÿâH@.ÿé?ÜhA„ƒŠÿ¤pI@ +×ë?aAuowÿÿ!I@xë?KêA‘Š‘ÿüG@Åç?«ÏA‚‚‡ÿêH@9Eç?ëA‹‹�ÿ‘J@a2í?à¾A‚{€ÿ`vG@ +×ë?n£A‡…ŠÿÐDH@Șë?ǺA”�“ÿ8øF@¥½é?çA‚‚Šÿ¼E@UÁè?fˆA€|‚ÿ–²H@Gè?s×A›šŸÿTtH@¬ê?�1A“— ÿ \ No newline at end of file diff --git a/resources/pointclouds/lion_takanawa/las/r.las b/resources/pointclouds/lion_takanawa/las/r.las deleted file mode 100644 index efd98cbe..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r0.las b/resources/pointclouds/lion_takanawa/las/r0.las deleted file mode 100644 index 2bcd261a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r0.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r02.las b/resources/pointclouds/lion_takanawa/las/r02.las deleted file mode 100644 index 7e913e4c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r02.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r026.las b/resources/pointclouds/lion_takanawa/las/r026.las deleted file mode 100644 index 772783f6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r026.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r03.las b/resources/pointclouds/lion_takanawa/las/r03.las deleted file mode 100644 index e8b5ab66..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r03.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r033.las b/resources/pointclouds/lion_takanawa/las/r033.las deleted file mode 100644 index 74ff65ca..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r033.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r037.las b/resources/pointclouds/lion_takanawa/las/r037.las deleted file mode 100644 index 3bde7fbe..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r037.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r05.las b/resources/pointclouds/lion_takanawa/las/r05.las deleted file mode 100644 index 7f9047d0..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r05.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r054.las b/resources/pointclouds/lion_takanawa/las/r054.las deleted file mode 100644 index 7f478650..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r054.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r056.las b/resources/pointclouds/lion_takanawa/las/r056.las deleted file mode 100644 index 1a8b0dce..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r056.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r057.las b/resources/pointclouds/lion_takanawa/las/r057.las deleted file mode 100644 index e271f804..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r057.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r07.las b/resources/pointclouds/lion_takanawa/las/r07.las deleted file mode 100644 index 2a1a7c06..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r07.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r070.las b/resources/pointclouds/lion_takanawa/las/r070.las deleted file mode 100644 index ec048587..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r070.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r071.las b/resources/pointclouds/lion_takanawa/las/r071.las deleted file mode 100644 index 4ab2c603..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r071.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r072.las b/resources/pointclouds/lion_takanawa/las/r072.las deleted file mode 100644 index a7364ed4..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r072.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r073.las b/resources/pointclouds/lion_takanawa/las/r073.las deleted file mode 100644 index 7372e94b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r073.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r074.las b/resources/pointclouds/lion_takanawa/las/r074.las deleted file mode 100644 index 92ca40fa..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r074.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r075.las b/resources/pointclouds/lion_takanawa/las/r075.las deleted file mode 100644 index 56584989..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r075.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r076.las b/resources/pointclouds/lion_takanawa/las/r076.las deleted file mode 100644 index aa7f970c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r076.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r077.las b/resources/pointclouds/lion_takanawa/las/r077.las deleted file mode 100644 index 971464c6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r077.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r1.las b/resources/pointclouds/lion_takanawa/las/r1.las deleted file mode 100644 index 8272704d..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r1.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r12.las b/resources/pointclouds/lion_takanawa/las/r12.las deleted file mode 100644 index e9df28d2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r12.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r122.las b/resources/pointclouds/lion_takanawa/las/r122.las deleted file mode 100644 index bd1354f3..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r122.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r126.las b/resources/pointclouds/lion_takanawa/las/r126.las deleted file mode 100644 index 618691d9..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r126.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r16.las b/resources/pointclouds/lion_takanawa/las/r16.las deleted file mode 100644 index 025408a3..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r16.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r162.las b/resources/pointclouds/lion_takanawa/las/r162.las deleted file mode 100644 index 027f22ed..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r162.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r163.las b/resources/pointclouds/lion_takanawa/las/r163.las deleted file mode 100644 index 75564c7b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r163.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r164.las b/resources/pointclouds/lion_takanawa/las/r164.las deleted file mode 100644 index 312b3369..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r164.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r165.las b/resources/pointclouds/lion_takanawa/las/r165.las deleted file mode 100644 index 8efef7a2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r165.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r166.las b/resources/pointclouds/lion_takanawa/las/r166.las deleted file mode 100644 index a8e1933b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r166.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r17.las b/resources/pointclouds/lion_takanawa/las/r17.las deleted file mode 100644 index 376731c5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r17.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r172.las b/resources/pointclouds/lion_takanawa/las/r172.las deleted file mode 100644 index 1bd493cd..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r172.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r174.las b/resources/pointclouds/lion_takanawa/las/r174.las deleted file mode 100644 index 1febc7fd..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r174.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r2.las b/resources/pointclouds/lion_takanawa/las/r2.las deleted file mode 100644 index 97060472..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r2.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r21.las b/resources/pointclouds/lion_takanawa/las/r21.las deleted file mode 100644 index a0a59638..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r21.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r210.las b/resources/pointclouds/lion_takanawa/las/r210.las deleted file mode 100644 index 41a6249c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r210.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r211.las b/resources/pointclouds/lion_takanawa/las/r211.las deleted file mode 100644 index 03ac16f2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r211.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r212.las b/resources/pointclouds/lion_takanawa/las/r212.las deleted file mode 100644 index 00761818..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r212.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r213.las b/resources/pointclouds/lion_takanawa/las/r213.las deleted file mode 100644 index 42c8755c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r213.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r214.las b/resources/pointclouds/lion_takanawa/las/r214.las deleted file mode 100644 index 13bea19f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r214.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r215.las b/resources/pointclouds/lion_takanawa/las/r215.las deleted file mode 100644 index 8d4cf1ce..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r215.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r216.las b/resources/pointclouds/lion_takanawa/las/r216.las deleted file mode 100644 index fbff3aaf..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r216.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r217.las b/resources/pointclouds/lion_takanawa/las/r217.las deleted file mode 100644 index ba26f8a8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r217.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r23.las b/resources/pointclouds/lion_takanawa/las/r23.las deleted file mode 100644 index 01add2ab..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r23.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r231.las b/resources/pointclouds/lion_takanawa/las/r231.las deleted file mode 100644 index 75139eed..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r231.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r235.las b/resources/pointclouds/lion_takanawa/las/r235.las deleted file mode 100644 index c10d092f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r235.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r25.las b/resources/pointclouds/lion_takanawa/las/r25.las deleted file mode 100644 index 313790ee..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r25.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r250.las b/resources/pointclouds/lion_takanawa/las/r250.las deleted file mode 100644 index 0791bee6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r250.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r251.las b/resources/pointclouds/lion_takanawa/las/r251.las deleted file mode 100644 index c99d1cd7..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r251.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r252.las b/resources/pointclouds/lion_takanawa/las/r252.las deleted file mode 100644 index cae47155..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r252.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r253.las b/resources/pointclouds/lion_takanawa/las/r253.las deleted file mode 100644 index 0580f70f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r253.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r254.las b/resources/pointclouds/lion_takanawa/las/r254.las deleted file mode 100644 index 15dabe19..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r254.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r255.las b/resources/pointclouds/lion_takanawa/las/r255.las deleted file mode 100644 index ef2cdc4e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r255.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r256.las b/resources/pointclouds/lion_takanawa/las/r256.las deleted file mode 100644 index edfcdab2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r256.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r257.las b/resources/pointclouds/lion_takanawa/las/r257.las deleted file mode 100644 index 80edf2b4..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r257.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r27.las b/resources/pointclouds/lion_takanawa/las/r27.las deleted file mode 100644 index 5356bd6b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r27.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r275.las b/resources/pointclouds/lion_takanawa/las/r275.las deleted file mode 100644 index b8fa7269..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r275.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r3.las b/resources/pointclouds/lion_takanawa/las/r3.las deleted file mode 100644 index b59ce7f5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r3.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r30.las b/resources/pointclouds/lion_takanawa/las/r30.las deleted file mode 100644 index 8a889970..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r30.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r300.las b/resources/pointclouds/lion_takanawa/las/r300.las deleted file mode 100644 index 256931b6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r300.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r301.las b/resources/pointclouds/lion_takanawa/las/r301.las deleted file mode 100644 index 28f10867..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r301.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r302.las b/resources/pointclouds/lion_takanawa/las/r302.las deleted file mode 100644 index b4abf3be..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r302.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r303.las b/resources/pointclouds/lion_takanawa/las/r303.las deleted file mode 100644 index c04cd8a1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r303.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r304.las b/resources/pointclouds/lion_takanawa/las/r304.las deleted file mode 100644 index feeb51cd..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r304.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r305.las b/resources/pointclouds/lion_takanawa/las/r305.las deleted file mode 100644 index a8ff6333..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r305.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r306.las b/resources/pointclouds/lion_takanawa/las/r306.las deleted file mode 100644 index dcf1a75a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r306.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r307.las b/resources/pointclouds/lion_takanawa/las/r307.las deleted file mode 100644 index 67e67967..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r307.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r32.las b/resources/pointclouds/lion_takanawa/las/r32.las deleted file mode 100644 index 5581f48c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r32.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r320.las b/resources/pointclouds/lion_takanawa/las/r320.las deleted file mode 100644 index 6c825962..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r320.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r321.las b/resources/pointclouds/lion_takanawa/las/r321.las deleted file mode 100644 index 446e4808..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r321.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r324.las b/resources/pointclouds/lion_takanawa/las/r324.las deleted file mode 100644 index e43e999f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r324.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r325.las b/resources/pointclouds/lion_takanawa/las/r325.las deleted file mode 100644 index 48be47bf..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r325.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r34.las b/resources/pointclouds/lion_takanawa/las/r34.las deleted file mode 100644 index 0121cce1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r34.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r340.las b/resources/pointclouds/lion_takanawa/las/r340.las deleted file mode 100644 index d9affa4e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r340.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r341.las b/resources/pointclouds/lion_takanawa/las/r341.las deleted file mode 100644 index 63c31cda..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r341.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r342.las b/resources/pointclouds/lion_takanawa/las/r342.las deleted file mode 100644 index b54ca82e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r342.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r343.las b/resources/pointclouds/lion_takanawa/las/r343.las deleted file mode 100644 index 679acc9d..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r343.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r344.las b/resources/pointclouds/lion_takanawa/las/r344.las deleted file mode 100644 index 7be27272..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r344.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r345.las b/resources/pointclouds/lion_takanawa/las/r345.las deleted file mode 100644 index 49971626..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r345.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r346.las b/resources/pointclouds/lion_takanawa/las/r346.las deleted file mode 100644 index 379e482a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r346.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r347.las b/resources/pointclouds/lion_takanawa/las/r347.las deleted file mode 100644 index 953c647a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r347.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r35.las b/resources/pointclouds/lion_takanawa/las/r35.las deleted file mode 100644 index 4f8917b8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r35.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r350.las b/resources/pointclouds/lion_takanawa/las/r350.las deleted file mode 100644 index 8367ced1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r350.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r351.las b/resources/pointclouds/lion_takanawa/las/r351.las deleted file mode 100644 index 896bbca5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r351.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r352.las b/resources/pointclouds/lion_takanawa/las/r352.las deleted file mode 100644 index 627b3e2f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r352.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r353.las b/resources/pointclouds/lion_takanawa/las/r353.las deleted file mode 100644 index 498c2d95..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r353.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r354.las b/resources/pointclouds/lion_takanawa/las/r354.las deleted file mode 100644 index 43acec9a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r354.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r355.las b/resources/pointclouds/lion_takanawa/las/r355.las deleted file mode 100644 index 8b625846..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r355.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r357.las b/resources/pointclouds/lion_takanawa/las/r357.las deleted file mode 100644 index d170543f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r357.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r36.las b/resources/pointclouds/lion_takanawa/las/r36.las deleted file mode 100644 index 31700073..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r36.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r364.las b/resources/pointclouds/lion_takanawa/las/r364.las deleted file mode 100644 index ffaed6b6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r364.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r367.las b/resources/pointclouds/lion_takanawa/las/r367.las deleted file mode 100644 index f704eea3..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r367.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r37.las b/resources/pointclouds/lion_takanawa/las/r37.las deleted file mode 100644 index 451fe1f2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r37.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r371.las b/resources/pointclouds/lion_takanawa/las/r371.las deleted file mode 100644 index 8ec781c7..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r371.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r375.las b/resources/pointclouds/lion_takanawa/las/r375.las deleted file mode 100644 index bff73688..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r375.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r4.las b/resources/pointclouds/lion_takanawa/las/r4.las deleted file mode 100644 index 3e610132..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r4.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r40.las b/resources/pointclouds/lion_takanawa/las/r40.las deleted file mode 100644 index 24049b64..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r40.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r401.las b/resources/pointclouds/lion_takanawa/las/r401.las deleted file mode 100644 index 990e25e1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r401.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r403.las b/resources/pointclouds/lion_takanawa/las/r403.las deleted file mode 100644 index 74ab3864..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r403.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r406.las b/resources/pointclouds/lion_takanawa/las/r406.las deleted file mode 100644 index 11bae1ff..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r406.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r407.las b/resources/pointclouds/lion_takanawa/las/r407.las deleted file mode 100644 index 93b60eab..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r407.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r41.las b/resources/pointclouds/lion_takanawa/las/r41.las deleted file mode 100644 index 46caca00..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r41.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r410.las b/resources/pointclouds/lion_takanawa/las/r410.las deleted file mode 100644 index 47ca0c6f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r410.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r412.las b/resources/pointclouds/lion_takanawa/las/r412.las deleted file mode 100644 index 0566e2fa..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r412.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r413.las b/resources/pointclouds/lion_takanawa/las/r413.las deleted file mode 100644 index 56dd61e5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r413.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r414.las b/resources/pointclouds/lion_takanawa/las/r414.las deleted file mode 100644 index aff22e68..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r414.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r416.las b/resources/pointclouds/lion_takanawa/las/r416.las deleted file mode 100644 index 38de875a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r416.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r417.las b/resources/pointclouds/lion_takanawa/las/r417.las deleted file mode 100644 index 810b2e64..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r417.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r42.las b/resources/pointclouds/lion_takanawa/las/r42.las deleted file mode 100644 index 8062d795..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r42.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r424.las b/resources/pointclouds/lion_takanawa/las/r424.las deleted file mode 100644 index 4abacc55..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r424.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r425.las b/resources/pointclouds/lion_takanawa/las/r425.las deleted file mode 100644 index 5c6a8953..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r425.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r43.las b/resources/pointclouds/lion_takanawa/las/r43.las deleted file mode 100644 index 233dfa64..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r43.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r430.las b/resources/pointclouds/lion_takanawa/las/r430.las deleted file mode 100644 index 9a6ba29f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r430.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r431.las b/resources/pointclouds/lion_takanawa/las/r431.las deleted file mode 100644 index 479f832b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r431.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r432.las b/resources/pointclouds/lion_takanawa/las/r432.las deleted file mode 100644 index f1ebced5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r432.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r433.las b/resources/pointclouds/lion_takanawa/las/r433.las deleted file mode 100644 index 8482f395..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r433.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r434.las b/resources/pointclouds/lion_takanawa/las/r434.las deleted file mode 100644 index b69ae38f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r434.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r435.las b/resources/pointclouds/lion_takanawa/las/r435.las deleted file mode 100644 index 5c0b68f2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r435.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r436.las b/resources/pointclouds/lion_takanawa/las/r436.las deleted file mode 100644 index 8e83ee02..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r436.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r437.las b/resources/pointclouds/lion_takanawa/las/r437.las deleted file mode 100644 index 176bf1ea..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r437.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r44.las b/resources/pointclouds/lion_takanawa/las/r44.las deleted file mode 100644 index 2c8c2c11..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r44.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r443.las b/resources/pointclouds/lion_takanawa/las/r443.las deleted file mode 100644 index aa6b8b56..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r443.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r45.las b/resources/pointclouds/lion_takanawa/las/r45.las deleted file mode 100644 index 5df16149..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r45.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r452.las b/resources/pointclouds/lion_takanawa/las/r452.las deleted file mode 100644 index 3c8cb076..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r452.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r453.las b/resources/pointclouds/lion_takanawa/las/r453.las deleted file mode 100644 index 80adedc6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r453.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r46.las b/resources/pointclouds/lion_takanawa/las/r46.las deleted file mode 100644 index 3f829df6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r46.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r460.las b/resources/pointclouds/lion_takanawa/las/r460.las deleted file mode 100644 index 71cf34b8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r460.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r461.las b/resources/pointclouds/lion_takanawa/las/r461.las deleted file mode 100644 index ab6fd802..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r461.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r463.las b/resources/pointclouds/lion_takanawa/las/r463.las deleted file mode 100644 index 8f23e996..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r463.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r464.las b/resources/pointclouds/lion_takanawa/las/r464.las deleted file mode 100644 index 6e401b64..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r464.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r465.las b/resources/pointclouds/lion_takanawa/las/r465.las deleted file mode 100644 index 35af48cf..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r465.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r466.las b/resources/pointclouds/lion_takanawa/las/r466.las deleted file mode 100644 index 915347bf..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r466.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r467.las b/resources/pointclouds/lion_takanawa/las/r467.las deleted file mode 100644 index e9360185..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r467.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r47.las b/resources/pointclouds/lion_takanawa/las/r47.las deleted file mode 100644 index b6b8c910..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r47.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r470.las b/resources/pointclouds/lion_takanawa/las/r470.las deleted file mode 100644 index 27f03d06..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r470.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r471.las b/resources/pointclouds/lion_takanawa/las/r471.las deleted file mode 100644 index 9a3eb28d..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r471.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r472.las b/resources/pointclouds/lion_takanawa/las/r472.las deleted file mode 100644 index 5c8d9b45..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r472.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r476.las b/resources/pointclouds/lion_takanawa/las/r476.las deleted file mode 100644 index 0ddf9efc..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r476.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r5.las b/resources/pointclouds/lion_takanawa/las/r5.las deleted file mode 100644 index 5be81ced..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r5.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r52.las b/resources/pointclouds/lion_takanawa/las/r52.las deleted file mode 100644 index c5b93be5..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r52.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r520.las b/resources/pointclouds/lion_takanawa/las/r520.las deleted file mode 100644 index 4e8e0eb8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r520.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r521.las b/resources/pointclouds/lion_takanawa/las/r521.las deleted file mode 100644 index 2955ba9c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r521.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r522.las b/resources/pointclouds/lion_takanawa/las/r522.las deleted file mode 100644 index 3ae79a57..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r522.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r523.las b/resources/pointclouds/lion_takanawa/las/r523.las deleted file mode 100644 index cb461071..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r523.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r53.las b/resources/pointclouds/lion_takanawa/las/r53.las deleted file mode 100644 index 2ba2c1d4..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r53.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r530.las b/resources/pointclouds/lion_takanawa/las/r530.las deleted file mode 100644 index 2447b175..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r530.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r536.las b/resources/pointclouds/lion_takanawa/las/r536.las deleted file mode 100644 index c49c354c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r536.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r537.las b/resources/pointclouds/lion_takanawa/las/r537.las deleted file mode 100644 index 1ca30ce1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r537.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r54.las b/resources/pointclouds/lion_takanawa/las/r54.las deleted file mode 100644 index 86c9e4e4..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r54.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r542.las b/resources/pointclouds/lion_takanawa/las/r542.las deleted file mode 100644 index 9a1a196f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r542.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r6.las b/resources/pointclouds/lion_takanawa/las/r6.las deleted file mode 100644 index 54c9346e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r6.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r61.las b/resources/pointclouds/lion_takanawa/las/r61.las deleted file mode 100644 index 079da12d..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r61.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r610.las b/resources/pointclouds/lion_takanawa/las/r610.las deleted file mode 100644 index 0cb802fd..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r610.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r611.las b/resources/pointclouds/lion_takanawa/las/r611.las deleted file mode 100644 index fc0fe98a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r611.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r613.las b/resources/pointclouds/lion_takanawa/las/r613.las deleted file mode 100644 index 0e234be1..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r613.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r614.las b/resources/pointclouds/lion_takanawa/las/r614.las deleted file mode 100644 index 24d053a8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r614.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r615.las b/resources/pointclouds/lion_takanawa/las/r615.las deleted file mode 100644 index 839a7ab9..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r615.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r617.las b/resources/pointclouds/lion_takanawa/las/r617.las deleted file mode 100644 index 7c16bda3..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r617.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r63.las b/resources/pointclouds/lion_takanawa/las/r63.las deleted file mode 100644 index fe8b1d89..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r63.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r631.las b/resources/pointclouds/lion_takanawa/las/r631.las deleted file mode 100644 index e32cc02f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r631.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r635.las b/resources/pointclouds/lion_takanawa/las/r635.las deleted file mode 100644 index 73c2c535..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r635.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r64.las b/resources/pointclouds/lion_takanawa/las/r64.las deleted file mode 100644 index e0fde3f2..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r64.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r644.las b/resources/pointclouds/lion_takanawa/las/r644.las deleted file mode 100644 index d47db4d7..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r644.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r645.las b/resources/pointclouds/lion_takanawa/las/r645.las deleted file mode 100644 index f26a4199..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r645.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r646.las b/resources/pointclouds/lion_takanawa/las/r646.las deleted file mode 100644 index b4c53d4e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r646.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r647.las b/resources/pointclouds/lion_takanawa/las/r647.las deleted file mode 100644 index bf26e3c9..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r647.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r65.las b/resources/pointclouds/lion_takanawa/las/r65.las deleted file mode 100644 index 4a80b728..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r65.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r650.las b/resources/pointclouds/lion_takanawa/las/r650.las deleted file mode 100644 index b97bbbec..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r650.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r651.las b/resources/pointclouds/lion_takanawa/las/r651.las deleted file mode 100644 index a485b76b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r651.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r652.las b/resources/pointclouds/lion_takanawa/las/r652.las deleted file mode 100644 index 94f407fc..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r652.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r653.las b/resources/pointclouds/lion_takanawa/las/r653.las deleted file mode 100644 index ab31ae3f..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r653.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r654.las b/resources/pointclouds/lion_takanawa/las/r654.las deleted file mode 100644 index 47acde5a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r654.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r656.las b/resources/pointclouds/lion_takanawa/las/r656.las deleted file mode 100644 index de18d1fe..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r656.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r657.las b/resources/pointclouds/lion_takanawa/las/r657.las deleted file mode 100644 index fd27e990..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r657.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r67.las b/resources/pointclouds/lion_takanawa/las/r67.las deleted file mode 100644 index 2319c782..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r67.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r671.las b/resources/pointclouds/lion_takanawa/las/r671.las deleted file mode 100644 index 94fa9fc0..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r671.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r673.las b/resources/pointclouds/lion_takanawa/las/r673.las deleted file mode 100644 index 43ea7ee8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r673.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r674.las b/resources/pointclouds/lion_takanawa/las/r674.las deleted file mode 100644 index 4fb00598..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r674.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r675.las b/resources/pointclouds/lion_takanawa/las/r675.las deleted file mode 100644 index 3f3116d8..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r675.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r677.las b/resources/pointclouds/lion_takanawa/las/r677.las deleted file mode 100644 index d31ce16a..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r677.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r7.las b/resources/pointclouds/lion_takanawa/las/r7.las deleted file mode 100644 index 5863fadb..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r7.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r70.las b/resources/pointclouds/lion_takanawa/las/r70.las deleted file mode 100644 index 7ffc932c..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r70.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r700.las b/resources/pointclouds/lion_takanawa/las/r700.las deleted file mode 100644 index 11010947..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r700.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r701.las b/resources/pointclouds/lion_takanawa/las/r701.las deleted file mode 100644 index eb38860e..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r701.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r702.las b/resources/pointclouds/lion_takanawa/las/r702.las deleted file mode 100644 index 19fe843d..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r702.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r703.las b/resources/pointclouds/lion_takanawa/las/r703.las deleted file mode 100644 index 5413a277..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r703.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r71.las b/resources/pointclouds/lion_takanawa/las/r71.las deleted file mode 100644 index 7c99cbe4..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r71.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r710.las b/resources/pointclouds/lion_takanawa/las/r710.las deleted file mode 100644 index d90bf6f6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r710.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r712.las b/resources/pointclouds/lion_takanawa/las/r712.las deleted file mode 100644 index fd9a16db..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r712.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r714.las b/resources/pointclouds/lion_takanawa/las/r714.las deleted file mode 100644 index 83b4a1df..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r714.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r715.las b/resources/pointclouds/lion_takanawa/las/r715.las deleted file mode 100644 index bfa0a299..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r715.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r716.las b/resources/pointclouds/lion_takanawa/las/r716.las deleted file mode 100644 index c8c84c98..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r716.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r717.las b/resources/pointclouds/lion_takanawa/las/r717.las deleted file mode 100644 index 81725f3b..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r717.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r72.las b/resources/pointclouds/lion_takanawa/las/r72.las deleted file mode 100644 index 7b8f9b46..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r72.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r720.las b/resources/pointclouds/lion_takanawa/las/r720.las deleted file mode 100644 index 1b201adf..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r720.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r721.las b/resources/pointclouds/lion_takanawa/las/r721.las deleted file mode 100644 index 8bcdd254..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r721.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r722.las b/resources/pointclouds/lion_takanawa/las/r722.las deleted file mode 100644 index f580ab88..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r722.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r724.las b/resources/pointclouds/lion_takanawa/las/r724.las deleted file mode 100644 index b1c7d8ea..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r724.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r725.las b/resources/pointclouds/lion_takanawa/las/r725.las deleted file mode 100644 index 354bd1d0..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r725.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r726.las b/resources/pointclouds/lion_takanawa/las/r726.las deleted file mode 100644 index 059efcfb..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r726.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r727.las b/resources/pointclouds/lion_takanawa/las/r727.las deleted file mode 100644 index 6f0ce773..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r727.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r73.las b/resources/pointclouds/lion_takanawa/las/r73.las deleted file mode 100644 index 62f74845..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r73.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r730.las b/resources/pointclouds/lion_takanawa/las/r730.las deleted file mode 100644 index 9bb0c150..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r730.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r734.las b/resources/pointclouds/lion_takanawa/las/r734.las deleted file mode 100644 index 487dadb6..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r734.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r735.las b/resources/pointclouds/lion_takanawa/las/r735.las deleted file mode 100644 index ac6d1027..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r735.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r736.las b/resources/pointclouds/lion_takanawa/las/r736.las deleted file mode 100644 index c81f6a11..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r736.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r76.las b/resources/pointclouds/lion_takanawa/las/r76.las deleted file mode 100644 index 231582e3..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r76.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r760.las b/resources/pointclouds/lion_takanawa/las/r760.las deleted file mode 100644 index c18306bd..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r760.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r761.las b/resources/pointclouds/lion_takanawa/las/r761.las deleted file mode 100644 index 35185fec..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r761.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r762.las b/resources/pointclouds/lion_takanawa/las/r762.las deleted file mode 100644 index ac71ceee..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r762.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r763.las b/resources/pointclouds/lion_takanawa/las/r763.las deleted file mode 100644 index 6c600484..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r763.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r77.las b/resources/pointclouds/lion_takanawa/las/r77.las deleted file mode 100644 index bb863953..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r77.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r770.las b/resources/pointclouds/lion_takanawa/las/r770.las deleted file mode 100644 index 07b85f34..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r770.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r771.las b/resources/pointclouds/lion_takanawa/las/r771.las deleted file mode 100644 index b93dea30..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r771.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/las/r772.las b/resources/pointclouds/lion_takanawa/las/r772.las deleted file mode 100644 index 66378048..00000000 Binary files a/resources/pointclouds/lion_takanawa/las/r772.las and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r.laz b/resources/pointclouds/lion_takanawa/laz/r.laz deleted file mode 100644 index 3909899a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r0.laz b/resources/pointclouds/lion_takanawa/laz/r0.laz deleted file mode 100644 index 3d424bd5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r0.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r02.laz b/resources/pointclouds/lion_takanawa/laz/r02.laz deleted file mode 100644 index 92e39f5d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r02.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r026.laz b/resources/pointclouds/lion_takanawa/laz/r026.laz deleted file mode 100644 index 62998583..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r026.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r03.laz b/resources/pointclouds/lion_takanawa/laz/r03.laz deleted file mode 100644 index 5e06eae9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r03.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r033.laz b/resources/pointclouds/lion_takanawa/laz/r033.laz deleted file mode 100644 index 9061a174..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r033.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r037.laz b/resources/pointclouds/lion_takanawa/laz/r037.laz deleted file mode 100644 index 4a2cbd6d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r037.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r05.laz b/resources/pointclouds/lion_takanawa/laz/r05.laz deleted file mode 100644 index 1c90a2d0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r05.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r054.laz b/resources/pointclouds/lion_takanawa/laz/r054.laz deleted file mode 100644 index 53e73b89..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r054.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r056.laz b/resources/pointclouds/lion_takanawa/laz/r056.laz deleted file mode 100644 index 3faafb6b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r056.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r057.laz b/resources/pointclouds/lion_takanawa/laz/r057.laz deleted file mode 100644 index e78ef9c4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r057.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r07.laz b/resources/pointclouds/lion_takanawa/laz/r07.laz deleted file mode 100644 index 1d0dbbae..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r07.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r070.laz b/resources/pointclouds/lion_takanawa/laz/r070.laz deleted file mode 100644 index 63dffb8c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r070.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r071.laz b/resources/pointclouds/lion_takanawa/laz/r071.laz deleted file mode 100644 index 9a7cc831..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r071.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r072.laz b/resources/pointclouds/lion_takanawa/laz/r072.laz deleted file mode 100644 index 1f8fbf06..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r072.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r073.laz b/resources/pointclouds/lion_takanawa/laz/r073.laz deleted file mode 100644 index 12f447ac..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r073.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r074.laz b/resources/pointclouds/lion_takanawa/laz/r074.laz deleted file mode 100644 index 51e200a0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r074.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r075.laz b/resources/pointclouds/lion_takanawa/laz/r075.laz deleted file mode 100644 index 04f5f0c0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r075.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r076.laz b/resources/pointclouds/lion_takanawa/laz/r076.laz deleted file mode 100644 index b3570516..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r076.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r077.laz b/resources/pointclouds/lion_takanawa/laz/r077.laz deleted file mode 100644 index c2a49890..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r077.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r1.laz b/resources/pointclouds/lion_takanawa/laz/r1.laz deleted file mode 100644 index 9b2d7963..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r1.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r12.laz b/resources/pointclouds/lion_takanawa/laz/r12.laz deleted file mode 100644 index ee0807f9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r12.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r122.laz b/resources/pointclouds/lion_takanawa/laz/r122.laz deleted file mode 100644 index 297a4ece..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r122.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r126.laz b/resources/pointclouds/lion_takanawa/laz/r126.laz deleted file mode 100644 index 4ae062fc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r126.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r16.laz b/resources/pointclouds/lion_takanawa/laz/r16.laz deleted file mode 100644 index 2ac2787d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r16.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r162.laz b/resources/pointclouds/lion_takanawa/laz/r162.laz deleted file mode 100644 index 2225d7d0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r162.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r163.laz b/resources/pointclouds/lion_takanawa/laz/r163.laz deleted file mode 100644 index d0946c75..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r163.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r164.laz b/resources/pointclouds/lion_takanawa/laz/r164.laz deleted file mode 100644 index f2ba51d2..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r164.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r165.laz b/resources/pointclouds/lion_takanawa/laz/r165.laz deleted file mode 100644 index 3facc4b5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r165.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r166.laz b/resources/pointclouds/lion_takanawa/laz/r166.laz deleted file mode 100644 index a3bceb0c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r166.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r17.laz b/resources/pointclouds/lion_takanawa/laz/r17.laz deleted file mode 100644 index 48233562..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r17.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r172.laz b/resources/pointclouds/lion_takanawa/laz/r172.laz deleted file mode 100644 index 07ccfe78..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r172.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r174.laz b/resources/pointclouds/lion_takanawa/laz/r174.laz deleted file mode 100644 index 621ce148..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r174.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r2.laz b/resources/pointclouds/lion_takanawa/laz/r2.laz deleted file mode 100644 index b8cfdfdd..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r2.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r21.laz b/resources/pointclouds/lion_takanawa/laz/r21.laz deleted file mode 100644 index 6b7c3dbc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r21.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r210.laz b/resources/pointclouds/lion_takanawa/laz/r210.laz deleted file mode 100644 index f9299882..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r210.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r211.laz b/resources/pointclouds/lion_takanawa/laz/r211.laz deleted file mode 100644 index f3c7e40d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r211.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r212.laz b/resources/pointclouds/lion_takanawa/laz/r212.laz deleted file mode 100644 index 8b40f279..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r212.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r213.laz b/resources/pointclouds/lion_takanawa/laz/r213.laz deleted file mode 100644 index 4f80eb6d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r213.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r214.laz b/resources/pointclouds/lion_takanawa/laz/r214.laz deleted file mode 100644 index 21e39c06..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r214.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r215.laz b/resources/pointclouds/lion_takanawa/laz/r215.laz deleted file mode 100644 index 67839182..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r215.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r216.laz b/resources/pointclouds/lion_takanawa/laz/r216.laz deleted file mode 100644 index 5762e2ae..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r216.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r217.laz b/resources/pointclouds/lion_takanawa/laz/r217.laz deleted file mode 100644 index 6389157e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r217.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r23.laz b/resources/pointclouds/lion_takanawa/laz/r23.laz deleted file mode 100644 index 587963e9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r23.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r231.laz b/resources/pointclouds/lion_takanawa/laz/r231.laz deleted file mode 100644 index e77e6412..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r231.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r235.laz b/resources/pointclouds/lion_takanawa/laz/r235.laz deleted file mode 100644 index 1220c0f5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r235.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r25.laz b/resources/pointclouds/lion_takanawa/laz/r25.laz deleted file mode 100644 index 8499d88a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r25.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r250.laz b/resources/pointclouds/lion_takanawa/laz/r250.laz deleted file mode 100644 index 49d8f8fe..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r250.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r251.laz b/resources/pointclouds/lion_takanawa/laz/r251.laz deleted file mode 100644 index 1dee5d66..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r251.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r252.laz b/resources/pointclouds/lion_takanawa/laz/r252.laz deleted file mode 100644 index 9ccbadde..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r252.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r253.laz b/resources/pointclouds/lion_takanawa/laz/r253.laz deleted file mode 100644 index d9b74ab2..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r253.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r254.laz b/resources/pointclouds/lion_takanawa/laz/r254.laz deleted file mode 100644 index 4f190d9f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r254.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r255.laz b/resources/pointclouds/lion_takanawa/laz/r255.laz deleted file mode 100644 index 32b34d64..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r255.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r256.laz b/resources/pointclouds/lion_takanawa/laz/r256.laz deleted file mode 100644 index fde739e9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r256.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r257.laz b/resources/pointclouds/lion_takanawa/laz/r257.laz deleted file mode 100644 index 75dcb441..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r257.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r27.laz b/resources/pointclouds/lion_takanawa/laz/r27.laz deleted file mode 100644 index 09e061c4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r27.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r275.laz b/resources/pointclouds/lion_takanawa/laz/r275.laz deleted file mode 100644 index 2bdb6467..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r275.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r3.laz b/resources/pointclouds/lion_takanawa/laz/r3.laz deleted file mode 100644 index 4189caeb..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r3.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r30.laz b/resources/pointclouds/lion_takanawa/laz/r30.laz deleted file mode 100644 index 185c6d58..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r30.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r300.laz b/resources/pointclouds/lion_takanawa/laz/r300.laz deleted file mode 100644 index d3c7eacb..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r300.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r301.laz b/resources/pointclouds/lion_takanawa/laz/r301.laz deleted file mode 100644 index 73c1b656..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r301.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r302.laz b/resources/pointclouds/lion_takanawa/laz/r302.laz deleted file mode 100644 index 306afdf1..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r302.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r303.laz b/resources/pointclouds/lion_takanawa/laz/r303.laz deleted file mode 100644 index 40f74078..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r303.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r304.laz b/resources/pointclouds/lion_takanawa/laz/r304.laz deleted file mode 100644 index f9ba4dbf..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r304.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r305.laz b/resources/pointclouds/lion_takanawa/laz/r305.laz deleted file mode 100644 index 16adc3cc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r305.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r306.laz b/resources/pointclouds/lion_takanawa/laz/r306.laz deleted file mode 100644 index 4971645c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r306.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r307.laz b/resources/pointclouds/lion_takanawa/laz/r307.laz deleted file mode 100644 index e5c0e7f3..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r307.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r32.laz b/resources/pointclouds/lion_takanawa/laz/r32.laz deleted file mode 100644 index 0eb246f8..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r32.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r320.laz b/resources/pointclouds/lion_takanawa/laz/r320.laz deleted file mode 100644 index 5a280185..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r320.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r321.laz b/resources/pointclouds/lion_takanawa/laz/r321.laz deleted file mode 100644 index 82b4875c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r321.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r324.laz b/resources/pointclouds/lion_takanawa/laz/r324.laz deleted file mode 100644 index 3a444e85..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r324.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r325.laz b/resources/pointclouds/lion_takanawa/laz/r325.laz deleted file mode 100644 index 4019bacf..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r325.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r34.laz b/resources/pointclouds/lion_takanawa/laz/r34.laz deleted file mode 100644 index 0d47a51b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r34.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r340.laz b/resources/pointclouds/lion_takanawa/laz/r340.laz deleted file mode 100644 index 5bf46087..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r340.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r341.laz b/resources/pointclouds/lion_takanawa/laz/r341.laz deleted file mode 100644 index 86c86767..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r341.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r342.laz b/resources/pointclouds/lion_takanawa/laz/r342.laz deleted file mode 100644 index 194cfb46..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r342.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r343.laz b/resources/pointclouds/lion_takanawa/laz/r343.laz deleted file mode 100644 index 80b4154d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r343.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r344.laz b/resources/pointclouds/lion_takanawa/laz/r344.laz deleted file mode 100644 index 72dbcb9f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r344.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r345.laz b/resources/pointclouds/lion_takanawa/laz/r345.laz deleted file mode 100644 index 6aed6971..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r345.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r346.laz b/resources/pointclouds/lion_takanawa/laz/r346.laz deleted file mode 100644 index 0a6fe83c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r346.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r347.laz b/resources/pointclouds/lion_takanawa/laz/r347.laz deleted file mode 100644 index 91b3b093..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r347.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r35.laz b/resources/pointclouds/lion_takanawa/laz/r35.laz deleted file mode 100644 index baa4f106..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r35.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r350.laz b/resources/pointclouds/lion_takanawa/laz/r350.laz deleted file mode 100644 index 72242bc5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r350.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r351.laz b/resources/pointclouds/lion_takanawa/laz/r351.laz deleted file mode 100644 index d46944d7..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r351.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r352.laz b/resources/pointclouds/lion_takanawa/laz/r352.laz deleted file mode 100644 index 8c9581ab..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r352.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r353.laz b/resources/pointclouds/lion_takanawa/laz/r353.laz deleted file mode 100644 index d2ab689b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r353.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r354.laz b/resources/pointclouds/lion_takanawa/laz/r354.laz deleted file mode 100644 index ac9c00a1..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r354.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r355.laz b/resources/pointclouds/lion_takanawa/laz/r355.laz deleted file mode 100644 index d73a7b83..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r355.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r357.laz b/resources/pointclouds/lion_takanawa/laz/r357.laz deleted file mode 100644 index 9cbd231f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r357.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r36.laz b/resources/pointclouds/lion_takanawa/laz/r36.laz deleted file mode 100644 index de7dabfc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r36.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r364.laz b/resources/pointclouds/lion_takanawa/laz/r364.laz deleted file mode 100644 index e64c59bd..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r364.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r367.laz b/resources/pointclouds/lion_takanawa/laz/r367.laz deleted file mode 100644 index 832121b5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r367.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r37.laz b/resources/pointclouds/lion_takanawa/laz/r37.laz deleted file mode 100644 index 08da647d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r37.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r371.laz b/resources/pointclouds/lion_takanawa/laz/r371.laz deleted file mode 100644 index 04c1f4e0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r371.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r375.laz b/resources/pointclouds/lion_takanawa/laz/r375.laz deleted file mode 100644 index ec273771..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r375.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r4.laz b/resources/pointclouds/lion_takanawa/laz/r4.laz deleted file mode 100644 index 4e164099..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r4.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r40.laz b/resources/pointclouds/lion_takanawa/laz/r40.laz deleted file mode 100644 index e3ce0146..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r40.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r401.laz b/resources/pointclouds/lion_takanawa/laz/r401.laz deleted file mode 100644 index 3eef2c0c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r401.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r403.laz b/resources/pointclouds/lion_takanawa/laz/r403.laz deleted file mode 100644 index 6bdf7578..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r403.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r406.laz b/resources/pointclouds/lion_takanawa/laz/r406.laz deleted file mode 100644 index d47ef4c4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r406.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r407.laz b/resources/pointclouds/lion_takanawa/laz/r407.laz deleted file mode 100644 index 975948a8..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r407.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r41.laz b/resources/pointclouds/lion_takanawa/laz/r41.laz deleted file mode 100644 index 9404951b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r41.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r410.laz b/resources/pointclouds/lion_takanawa/laz/r410.laz deleted file mode 100644 index 834275fc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r410.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r412.laz b/resources/pointclouds/lion_takanawa/laz/r412.laz deleted file mode 100644 index f5b600f2..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r412.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r413.laz b/resources/pointclouds/lion_takanawa/laz/r413.laz deleted file mode 100644 index 6601158c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r413.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r414.laz b/resources/pointclouds/lion_takanawa/laz/r414.laz deleted file mode 100644 index 7f0be99e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r414.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r416.laz b/resources/pointclouds/lion_takanawa/laz/r416.laz deleted file mode 100644 index e17bb005..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r416.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r417.laz b/resources/pointclouds/lion_takanawa/laz/r417.laz deleted file mode 100644 index b762ce03..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r417.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r42.laz b/resources/pointclouds/lion_takanawa/laz/r42.laz deleted file mode 100644 index a306c106..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r42.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r424.laz b/resources/pointclouds/lion_takanawa/laz/r424.laz deleted file mode 100644 index 54578fbe..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r424.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r425.laz b/resources/pointclouds/lion_takanawa/laz/r425.laz deleted file mode 100644 index a9c0c758..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r425.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r43.laz b/resources/pointclouds/lion_takanawa/laz/r43.laz deleted file mode 100644 index 03c8b34f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r43.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r430.laz b/resources/pointclouds/lion_takanawa/laz/r430.laz deleted file mode 100644 index 0faaccf0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r430.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r431.laz b/resources/pointclouds/lion_takanawa/laz/r431.laz deleted file mode 100644 index 0075c3ce..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r431.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r432.laz b/resources/pointclouds/lion_takanawa/laz/r432.laz deleted file mode 100644 index 0e05be64..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r432.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r433.laz b/resources/pointclouds/lion_takanawa/laz/r433.laz deleted file mode 100644 index 2833e4a6..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r433.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r434.laz b/resources/pointclouds/lion_takanawa/laz/r434.laz deleted file mode 100644 index 685de66b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r434.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r435.laz b/resources/pointclouds/lion_takanawa/laz/r435.laz deleted file mode 100644 index cb854313..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r435.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r436.laz b/resources/pointclouds/lion_takanawa/laz/r436.laz deleted file mode 100644 index cd3c4f3a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r436.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r437.laz b/resources/pointclouds/lion_takanawa/laz/r437.laz deleted file mode 100644 index 739aa885..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r437.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r44.laz b/resources/pointclouds/lion_takanawa/laz/r44.laz deleted file mode 100644 index 0dbd804d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r44.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r443.laz b/resources/pointclouds/lion_takanawa/laz/r443.laz deleted file mode 100644 index 53d20503..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r443.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r45.laz b/resources/pointclouds/lion_takanawa/laz/r45.laz deleted file mode 100644 index df28e4dc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r45.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r452.laz b/resources/pointclouds/lion_takanawa/laz/r452.laz deleted file mode 100644 index 08c7b2f7..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r452.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r453.laz b/resources/pointclouds/lion_takanawa/laz/r453.laz deleted file mode 100644 index a2d11ac9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r453.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r46.laz b/resources/pointclouds/lion_takanawa/laz/r46.laz deleted file mode 100644 index 27065989..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r46.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r460.laz b/resources/pointclouds/lion_takanawa/laz/r460.laz deleted file mode 100644 index 67838f65..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r460.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r461.laz b/resources/pointclouds/lion_takanawa/laz/r461.laz deleted file mode 100644 index 66e1333f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r461.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r463.laz b/resources/pointclouds/lion_takanawa/laz/r463.laz deleted file mode 100644 index 09c827ac..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r463.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r464.laz b/resources/pointclouds/lion_takanawa/laz/r464.laz deleted file mode 100644 index f45d0337..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r464.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r465.laz b/resources/pointclouds/lion_takanawa/laz/r465.laz deleted file mode 100644 index 97012efa..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r465.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r466.laz b/resources/pointclouds/lion_takanawa/laz/r466.laz deleted file mode 100644 index 851dd2e3..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r466.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r467.laz b/resources/pointclouds/lion_takanawa/laz/r467.laz deleted file mode 100644 index 2a7bbc8a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r467.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r47.laz b/resources/pointclouds/lion_takanawa/laz/r47.laz deleted file mode 100644 index 93094942..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r47.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r470.laz b/resources/pointclouds/lion_takanawa/laz/r470.laz deleted file mode 100644 index 3175f7f9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r470.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r471.laz b/resources/pointclouds/lion_takanawa/laz/r471.laz deleted file mode 100644 index d9e0fffa..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r471.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r472.laz b/resources/pointclouds/lion_takanawa/laz/r472.laz deleted file mode 100644 index eeb18576..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r472.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r476.laz b/resources/pointclouds/lion_takanawa/laz/r476.laz deleted file mode 100644 index 2a3acfa9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r476.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r5.laz b/resources/pointclouds/lion_takanawa/laz/r5.laz deleted file mode 100644 index e2f98908..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r5.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r52.laz b/resources/pointclouds/lion_takanawa/laz/r52.laz deleted file mode 100644 index 1c496004..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r52.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r520.laz b/resources/pointclouds/lion_takanawa/laz/r520.laz deleted file mode 100644 index 3bf7474e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r520.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r521.laz b/resources/pointclouds/lion_takanawa/laz/r521.laz deleted file mode 100644 index 7d86a230..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r521.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r522.laz b/resources/pointclouds/lion_takanawa/laz/r522.laz deleted file mode 100644 index f85e7953..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r522.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r523.laz b/resources/pointclouds/lion_takanawa/laz/r523.laz deleted file mode 100644 index 1241c710..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r523.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r53.laz b/resources/pointclouds/lion_takanawa/laz/r53.laz deleted file mode 100644 index 30819e2e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r53.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r530.laz b/resources/pointclouds/lion_takanawa/laz/r530.laz deleted file mode 100644 index 7e93c6ee..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r530.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r536.laz b/resources/pointclouds/lion_takanawa/laz/r536.laz deleted file mode 100644 index 6ad7c6a0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r536.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r537.laz b/resources/pointclouds/lion_takanawa/laz/r537.laz deleted file mode 100644 index 5825256b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r537.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r54.laz b/resources/pointclouds/lion_takanawa/laz/r54.laz deleted file mode 100644 index 5ef2e4f6..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r54.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r542.laz b/resources/pointclouds/lion_takanawa/laz/r542.laz deleted file mode 100644 index 9982782d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r542.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r6.laz b/resources/pointclouds/lion_takanawa/laz/r6.laz deleted file mode 100644 index 0cc47dbc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r6.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r61.laz b/resources/pointclouds/lion_takanawa/laz/r61.laz deleted file mode 100644 index 2769215c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r61.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r610.laz b/resources/pointclouds/lion_takanawa/laz/r610.laz deleted file mode 100644 index 7fcd9b57..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r610.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r611.laz b/resources/pointclouds/lion_takanawa/laz/r611.laz deleted file mode 100644 index c729a131..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r611.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r613.laz b/resources/pointclouds/lion_takanawa/laz/r613.laz deleted file mode 100644 index 1422cc2e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r613.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r614.laz b/resources/pointclouds/lion_takanawa/laz/r614.laz deleted file mode 100644 index 432fcb20..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r614.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r615.laz b/resources/pointclouds/lion_takanawa/laz/r615.laz deleted file mode 100644 index ff646620..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r615.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r617.laz b/resources/pointclouds/lion_takanawa/laz/r617.laz deleted file mode 100644 index 6349ba75..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r617.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r63.laz b/resources/pointclouds/lion_takanawa/laz/r63.laz deleted file mode 100644 index 8b0cb681..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r63.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r631.laz b/resources/pointclouds/lion_takanawa/laz/r631.laz deleted file mode 100644 index fb180c5d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r631.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r635.laz b/resources/pointclouds/lion_takanawa/laz/r635.laz deleted file mode 100644 index 4b27030c..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r635.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r64.laz b/resources/pointclouds/lion_takanawa/laz/r64.laz deleted file mode 100644 index 50351aed..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r64.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r644.laz b/resources/pointclouds/lion_takanawa/laz/r644.laz deleted file mode 100644 index dfec9672..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r644.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r645.laz b/resources/pointclouds/lion_takanawa/laz/r645.laz deleted file mode 100644 index 809aa50f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r645.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r646.laz b/resources/pointclouds/lion_takanawa/laz/r646.laz deleted file mode 100644 index 58c0a021..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r646.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r647.laz b/resources/pointclouds/lion_takanawa/laz/r647.laz deleted file mode 100644 index 8c4e4c86..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r647.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r65.laz b/resources/pointclouds/lion_takanawa/laz/r65.laz deleted file mode 100644 index a350c038..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r65.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r650.laz b/resources/pointclouds/lion_takanawa/laz/r650.laz deleted file mode 100644 index 61c14301..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r650.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r651.laz b/resources/pointclouds/lion_takanawa/laz/r651.laz deleted file mode 100644 index c29676b5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r651.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r652.laz b/resources/pointclouds/lion_takanawa/laz/r652.laz deleted file mode 100644 index d7ea4db7..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r652.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r653.laz b/resources/pointclouds/lion_takanawa/laz/r653.laz deleted file mode 100644 index 6ad783c4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r653.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r654.laz b/resources/pointclouds/lion_takanawa/laz/r654.laz deleted file mode 100644 index 98f8d69d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r654.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r656.laz b/resources/pointclouds/lion_takanawa/laz/r656.laz deleted file mode 100644 index 9d725785..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r656.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r657.laz b/resources/pointclouds/lion_takanawa/laz/r657.laz deleted file mode 100644 index 82ba8bee..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r657.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r67.laz b/resources/pointclouds/lion_takanawa/laz/r67.laz deleted file mode 100644 index 97cfc74e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r67.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r671.laz b/resources/pointclouds/lion_takanawa/laz/r671.laz deleted file mode 100644 index 6c40403a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r671.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r673.laz b/resources/pointclouds/lion_takanawa/laz/r673.laz deleted file mode 100644 index 752d5189..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r673.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r674.laz b/resources/pointclouds/lion_takanawa/laz/r674.laz deleted file mode 100644 index d6b41cfd..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r674.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r675.laz b/resources/pointclouds/lion_takanawa/laz/r675.laz deleted file mode 100644 index b3f12f42..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r675.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r677.laz b/resources/pointclouds/lion_takanawa/laz/r677.laz deleted file mode 100644 index dbcf80c5..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r677.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r7.laz b/resources/pointclouds/lion_takanawa/laz/r7.laz deleted file mode 100644 index 51498a71..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r7.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r70.laz b/resources/pointclouds/lion_takanawa/laz/r70.laz deleted file mode 100644 index cb00a96e..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r70.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r700.laz b/resources/pointclouds/lion_takanawa/laz/r700.laz deleted file mode 100644 index 6f4f76b4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r700.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r701.laz b/resources/pointclouds/lion_takanawa/laz/r701.laz deleted file mode 100644 index c846a3b9..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r701.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r702.laz b/resources/pointclouds/lion_takanawa/laz/r702.laz deleted file mode 100644 index fb2d148a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r702.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r703.laz b/resources/pointclouds/lion_takanawa/laz/r703.laz deleted file mode 100644 index 0fb22f61..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r703.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r71.laz b/resources/pointclouds/lion_takanawa/laz/r71.laz deleted file mode 100644 index 570de93f..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r71.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r710.laz b/resources/pointclouds/lion_takanawa/laz/r710.laz deleted file mode 100644 index e9a78284..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r710.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r712.laz b/resources/pointclouds/lion_takanawa/laz/r712.laz deleted file mode 100644 index ae192cd7..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r712.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r714.laz b/resources/pointclouds/lion_takanawa/laz/r714.laz deleted file mode 100644 index 227f4438..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r714.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r715.laz b/resources/pointclouds/lion_takanawa/laz/r715.laz deleted file mode 100644 index 6b52144b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r715.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r716.laz b/resources/pointclouds/lion_takanawa/laz/r716.laz deleted file mode 100644 index 3c82fd50..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r716.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r717.laz b/resources/pointclouds/lion_takanawa/laz/r717.laz deleted file mode 100644 index 9cd45f92..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r717.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r72.laz b/resources/pointclouds/lion_takanawa/laz/r72.laz deleted file mode 100644 index da5bb2e0..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r72.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r720.laz b/resources/pointclouds/lion_takanawa/laz/r720.laz deleted file mode 100644 index 92350cd2..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r720.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r721.laz b/resources/pointclouds/lion_takanawa/laz/r721.laz deleted file mode 100644 index a768a607..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r721.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r722.laz b/resources/pointclouds/lion_takanawa/laz/r722.laz deleted file mode 100644 index b5e3f143..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r722.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r724.laz b/resources/pointclouds/lion_takanawa/laz/r724.laz deleted file mode 100644 index a0cfa298..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r724.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r725.laz b/resources/pointclouds/lion_takanawa/laz/r725.laz deleted file mode 100644 index 42e69392..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r725.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r726.laz b/resources/pointclouds/lion_takanawa/laz/r726.laz deleted file mode 100644 index 6c77f861..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r726.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r727.laz b/resources/pointclouds/lion_takanawa/laz/r727.laz deleted file mode 100644 index f2b3b9f3..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r727.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r73.laz b/resources/pointclouds/lion_takanawa/laz/r73.laz deleted file mode 100644 index cbbe8017..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r73.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r730.laz b/resources/pointclouds/lion_takanawa/laz/r730.laz deleted file mode 100644 index 68cd47dc..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r730.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r734.laz b/resources/pointclouds/lion_takanawa/laz/r734.laz deleted file mode 100644 index d807eb9d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r734.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r735.laz b/resources/pointclouds/lion_takanawa/laz/r735.laz deleted file mode 100644 index f60e936a..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r735.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r736.laz b/resources/pointclouds/lion_takanawa/laz/r736.laz deleted file mode 100644 index 64057070..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r736.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r76.laz b/resources/pointclouds/lion_takanawa/laz/r76.laz deleted file mode 100644 index 5cd63423..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r76.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r760.laz b/resources/pointclouds/lion_takanawa/laz/r760.laz deleted file mode 100644 index fad219e4..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r760.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r761.laz b/resources/pointclouds/lion_takanawa/laz/r761.laz deleted file mode 100644 index e78d418d..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r761.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r762.laz b/resources/pointclouds/lion_takanawa/laz/r762.laz deleted file mode 100644 index 8fd2ae42..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r762.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r763.laz b/resources/pointclouds/lion_takanawa/laz/r763.laz deleted file mode 100644 index 03e00cb7..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r763.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r77.laz b/resources/pointclouds/lion_takanawa/laz/r77.laz deleted file mode 100644 index ea93f55b..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r77.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r770.laz b/resources/pointclouds/lion_takanawa/laz/r770.laz deleted file mode 100644 index 94860830..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r770.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r771.laz b/resources/pointclouds/lion_takanawa/laz/r771.laz deleted file mode 100644 index 6e36e793..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r771.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa/laz/r772.laz b/resources/pointclouds/lion_takanawa/laz/r772.laz deleted file mode 100644 index 04409b94..00000000 Binary files a/resources/pointclouds/lion_takanawa/laz/r772.laz and /dev/null differ diff --git a/resources/pointclouds/lion_takanawa_las/cloud.js b/resources/pointclouds/lion_takanawa_las/cloud.js new file mode 100644 index 00000000..f4c6668d --- /dev/null +++ b/resources/pointclouds/lion_takanawa_las/cloud.js @@ -0,0 +1,217 @@ +{ + "version": "1.3", + "octreeDir": "data", + "boundingBox": { + "lx": -2.91016, + "ly": -4.06274, + "lz": 2.63048, + "ux": 4.62238, + "uy": 3.4698, + "uz": 10.163 + }, + "pointAttributes": "LAS", + "spacing": 0.1, + "hierarchy": [ + ["r", 5942], + ["r0", 2174], + ["r1", 450], + ["r2", 3021], + ["r3", 3384], + ["r4", 5667], + ["r5", 858], + ["r6", 4074], + ["r7", 3757], + ["r02", 168], + ["r03", 1923], + ["r05", 628], + ["r07", 5280], + ["r12", 461], + ["r16", 648], + ["r17", 441], + ["r21", 5449], + ["r23", 168], + ["r25", 5898], + ["r27", 107], + ["r30", 4832], + ["r32", 367], + ["r34", 3981], + ["r35", 3131], + ["r36", 22], + ["r40", 3590], + ["r41", 1426], + ["r42", 46], + ["r43", 7635], + ["r44", 374], + ["r45", 1094], + ["r46", 3853], + ["r47", 2986], + ["r50", 74], + ["r51", 1], + ["r52", 2853], + ["r53", 177], + ["r54", 101], + ["r61", 5846], + ["r63", 1221], + ["r64", 2033], + ["r65", 4771], + ["r67", 1662], + ["r70", 6735], + ["r71", 2635], + ["r72", 3326], + ["r73", 650], + ["r76", 1250], + ["r77", 257], + ["r026", 530], + ["r032", 378], + ["r033", 1480], + ["r036", 1889], + ["r037", 3010], + ["r054", 238], + ["r056", 1094], + ["r057", 762], + ["r070", 1843], + ["r071", 1210], + ["r072", 3830], + ["r073", 767], + ["r074", 4861], + ["r075", 106], + ["r076", 5035], + ["r077", 1633], + ["r122", 445], + ["r126", 1023], + ["r162", 373], + ["r163", 36], + ["r164", 1497], + ["r165", 8], + ["r167", 205], + ["r172", 1300], + ["r176", 3], + ["r210", 2788], + ["r211", 633], + ["r212", 838], + ["r213", 4318], + ["r214", 4519], + ["r215", 208], + ["r216", 557], + ["r217", 6047], + ["r231", 155], + ["r235", 440], + ["r250", 4161], + ["r251", 165], + ["r252", 1003], + ["r253", 4764], + ["r254", 1852], + ["r255", 2251], + ["r256", 616], + ["r257", 6818], + ["r275", 381], + ["r300", 2972], + ["r302", 4840], + ["r304", 4053], + ["r306", 5773], + ["r320", 119], + ["r324", 1203], + ["r340", 2357], + ["r341", 2434], + ["r342", 4117], + ["r344", 1997], + ["r345", 2557], + ["r346", 1507], + ["r350", 2269], + ["r352", 3534], + ["r353", 470], + ["r354", 1113], + ["r355", 54], + ["r356", 999], + ["r357", 688], + ["r364", 62], + ["r365", 7], + ["r401", 1424], + ["r403", 2506], + ["r406", 948], + ["r407", 5333], + ["r410", 738], + ["r412", 2277], + ["r413", 564], + ["r414", 77], + ["r416", 921], + ["r417", 45], + ["r424", 29], + ["r425", 104], + ["r430", 4705], + ["r431", 114], + ["r432", 5396], + ["r433", 8405], + ["r434", 4567], + ["r435", 84], + ["r436", 4626], + ["r437", 173], + ["r442", 36], + ["r443", 1068], + ["r447", 18], + ["r452", 998], + ["r453", 2631], + ["r461", 2438], + ["r463", 985], + ["r464", 281], + ["r465", 3004], + ["r466", 1995], + ["r467", 3950], + ["r470", 4351], + ["r471", 9], + ["r472", 5238], + ["r476", 1333], + ["r503", 188], + ["r520", 3417], + ["r521", 681], + ["r522", 5058], + ["r523", 980], + ["r530", 180], + ["r536", 381], + ["r542", 337], + ["r611", 4508], + ["r613", 7480], + ["r614", 1922], + ["r615", 3107], + ["r617", 4582], + ["r631", 2907], + ["r635", 1597], + ["r644", 1899], + ["r645", 3530], + ["r647", 1084], + ["r650", 4204], + ["r651", 1936], + ["r652", 1547], + ["r653", 4255], + ["r654", 3044], + ["r656", 1801], + ["r657", 522], + ["r671", 4687], + ["r673", 177], + ["r674", 220], + ["r675", 950], + ["r700", 5633], + ["r701", 5209], + ["r702", 5704], + ["r703", 5499], + ["r707", 3858], + ["r710", 106], + ["r712", 1416], + ["r714", 1921], + ["r715", 219], + ["r716", 4007], + ["r717", 1460], + ["r720", 3114], + ["r721", 130], + ["r724", 5409], + ["r725", 4051], + ["r734", 2341], + ["r735", 17], + ["r760", 2962], + ["r761", 319], + ["r762", 1073], + ["r763", 2], + ["r770", 824], + ["r771", 27] + ] +} diff --git a/resources/pointclouds/lion_takanawa_las/data/r.las b/resources/pointclouds/lion_takanawa_las/data/r.las new file mode 100644 index 00000000..c21c3e1a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r0.las b/resources/pointclouds/lion_takanawa_las/data/r0.las new file mode 100644 index 00000000..22ec8141 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r0.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r02.las b/resources/pointclouds/lion_takanawa_las/data/r02.las new file mode 100644 index 00000000..ee538f3a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r02.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r026.las b/resources/pointclouds/lion_takanawa_las/data/r026.las new file mode 100644 index 00000000..dd5b6c27 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r026.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r03.las b/resources/pointclouds/lion_takanawa_las/data/r03.las new file mode 100644 index 00000000..45a49aec Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r03.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r032.las b/resources/pointclouds/lion_takanawa_las/data/r032.las new file mode 100644 index 00000000..fd8703da Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r032.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r033.las b/resources/pointclouds/lion_takanawa_las/data/r033.las new file mode 100644 index 00000000..b3f60703 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r033.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r036.las b/resources/pointclouds/lion_takanawa_las/data/r036.las new file mode 100644 index 00000000..c7a20614 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r036.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r037.las b/resources/pointclouds/lion_takanawa_las/data/r037.las new file mode 100644 index 00000000..25d10f14 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r037.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r05.las b/resources/pointclouds/lion_takanawa_las/data/r05.las new file mode 100644 index 00000000..e3126c59 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r05.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r054.las b/resources/pointclouds/lion_takanawa_las/data/r054.las new file mode 100644 index 00000000..cfc39814 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r054.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r056.las b/resources/pointclouds/lion_takanawa_las/data/r056.las new file mode 100644 index 00000000..ee680498 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r056.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r057.las b/resources/pointclouds/lion_takanawa_las/data/r057.las new file mode 100644 index 00000000..62830647 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r057.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r07.las b/resources/pointclouds/lion_takanawa_las/data/r07.las new file mode 100644 index 00000000..43df13aa Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r07.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r070.las b/resources/pointclouds/lion_takanawa_las/data/r070.las new file mode 100644 index 00000000..39b572f5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r070.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r071.las b/resources/pointclouds/lion_takanawa_las/data/r071.las new file mode 100644 index 00000000..5868d0c3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r071.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r072.las b/resources/pointclouds/lion_takanawa_las/data/r072.las new file mode 100644 index 00000000..aedc4ce3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r072.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r073.las b/resources/pointclouds/lion_takanawa_las/data/r073.las new file mode 100644 index 00000000..34318e5b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r073.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r074.las b/resources/pointclouds/lion_takanawa_las/data/r074.las new file mode 100644 index 00000000..c3c7e177 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r074.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r075.las b/resources/pointclouds/lion_takanawa_las/data/r075.las new file mode 100644 index 00000000..d0ed2b10 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r075.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r076.las b/resources/pointclouds/lion_takanawa_las/data/r076.las new file mode 100644 index 00000000..1be3d165 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r076.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r077.las b/resources/pointclouds/lion_takanawa_las/data/r077.las new file mode 100644 index 00000000..579884f2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r077.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r1.las b/resources/pointclouds/lion_takanawa_las/data/r1.las new file mode 100644 index 00000000..7e10fb30 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r1.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r12.las b/resources/pointclouds/lion_takanawa_las/data/r12.las new file mode 100644 index 00000000..c905c02f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r12.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r122.las b/resources/pointclouds/lion_takanawa_las/data/r122.las new file mode 100644 index 00000000..60b48427 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r122.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r126.las b/resources/pointclouds/lion_takanawa_las/data/r126.las new file mode 100644 index 00000000..77111396 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r126.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r16.las b/resources/pointclouds/lion_takanawa_las/data/r16.las new file mode 100644 index 00000000..b1f660dc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r16.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r162.las b/resources/pointclouds/lion_takanawa_las/data/r162.las new file mode 100644 index 00000000..5ac3845a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r162.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r163.las b/resources/pointclouds/lion_takanawa_las/data/r163.las new file mode 100644 index 00000000..5237e3a9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r163.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r164.las b/resources/pointclouds/lion_takanawa_las/data/r164.las new file mode 100644 index 00000000..2c93440c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r164.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r165.las b/resources/pointclouds/lion_takanawa_las/data/r165.las new file mode 100644 index 00000000..3f4aed7a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r165.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r167.las b/resources/pointclouds/lion_takanawa_las/data/r167.las new file mode 100644 index 00000000..4cf491ef Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r167.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r17.las b/resources/pointclouds/lion_takanawa_las/data/r17.las new file mode 100644 index 00000000..44ceda7d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r17.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r172.las b/resources/pointclouds/lion_takanawa_las/data/r172.las new file mode 100644 index 00000000..cbddca7c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r172.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r176.las b/resources/pointclouds/lion_takanawa_las/data/r176.las new file mode 100644 index 00000000..788b8cd2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r176.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r2.las b/resources/pointclouds/lion_takanawa_las/data/r2.las new file mode 100644 index 00000000..365b745c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r2.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r21.las b/resources/pointclouds/lion_takanawa_las/data/r21.las new file mode 100644 index 00000000..eab943cd Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r21.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r210.las b/resources/pointclouds/lion_takanawa_las/data/r210.las new file mode 100644 index 00000000..b31245de Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r210.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r211.las b/resources/pointclouds/lion_takanawa_las/data/r211.las new file mode 100644 index 00000000..8f1d9d1f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r211.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r212.las b/resources/pointclouds/lion_takanawa_las/data/r212.las new file mode 100644 index 00000000..22b174e0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r212.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r213.las b/resources/pointclouds/lion_takanawa_las/data/r213.las new file mode 100644 index 00000000..98de6a73 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r213.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r214.las b/resources/pointclouds/lion_takanawa_las/data/r214.las new file mode 100644 index 00000000..eef4d70d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r214.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r215.las b/resources/pointclouds/lion_takanawa_las/data/r215.las new file mode 100644 index 00000000..0cd61988 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r215.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r216.las b/resources/pointclouds/lion_takanawa_las/data/r216.las new file mode 100644 index 00000000..8c39be5e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r216.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r217.las b/resources/pointclouds/lion_takanawa_las/data/r217.las new file mode 100644 index 00000000..304853b1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r217.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r23.las b/resources/pointclouds/lion_takanawa_las/data/r23.las new file mode 100644 index 00000000..929e4410 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r23.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r231.las b/resources/pointclouds/lion_takanawa_las/data/r231.las new file mode 100644 index 00000000..f70c64d4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r231.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r235.las b/resources/pointclouds/lion_takanawa_las/data/r235.las new file mode 100644 index 00000000..d8d51bb5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r235.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r25.las b/resources/pointclouds/lion_takanawa_las/data/r25.las new file mode 100644 index 00000000..23223925 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r25.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r250.las b/resources/pointclouds/lion_takanawa_las/data/r250.las new file mode 100644 index 00000000..b0291d49 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r250.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r251.las b/resources/pointclouds/lion_takanawa_las/data/r251.las new file mode 100644 index 00000000..4e961134 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r251.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r252.las b/resources/pointclouds/lion_takanawa_las/data/r252.las new file mode 100644 index 00000000..27201c40 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r252.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r253.las b/resources/pointclouds/lion_takanawa_las/data/r253.las new file mode 100644 index 00000000..93645896 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r253.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r254.las b/resources/pointclouds/lion_takanawa_las/data/r254.las new file mode 100644 index 00000000..2739f2fc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r254.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r255.las b/resources/pointclouds/lion_takanawa_las/data/r255.las new file mode 100644 index 00000000..6520f631 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r255.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r256.las b/resources/pointclouds/lion_takanawa_las/data/r256.las new file mode 100644 index 00000000..bf1258d0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r256.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r257.las b/resources/pointclouds/lion_takanawa_las/data/r257.las new file mode 100644 index 00000000..bc085259 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r257.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r27.las b/resources/pointclouds/lion_takanawa_las/data/r27.las new file mode 100644 index 00000000..1eed05ea Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r27.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r275.las b/resources/pointclouds/lion_takanawa_las/data/r275.las new file mode 100644 index 00000000..64d80731 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r275.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r3.las b/resources/pointclouds/lion_takanawa_las/data/r3.las new file mode 100644 index 00000000..7d247185 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r3.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r30.las b/resources/pointclouds/lion_takanawa_las/data/r30.las new file mode 100644 index 00000000..8002a9e1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r30.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r300.las b/resources/pointclouds/lion_takanawa_las/data/r300.las new file mode 100644 index 00000000..e0b26ad0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r300.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r302.las b/resources/pointclouds/lion_takanawa_las/data/r302.las new file mode 100644 index 00000000..a5418c23 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r302.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r304.las b/resources/pointclouds/lion_takanawa_las/data/r304.las new file mode 100644 index 00000000..0e2ba0aa Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r304.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r306.las b/resources/pointclouds/lion_takanawa_las/data/r306.las new file mode 100644 index 00000000..535daae2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r306.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r32.las b/resources/pointclouds/lion_takanawa_las/data/r32.las new file mode 100644 index 00000000..acadb297 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r32.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r320.las b/resources/pointclouds/lion_takanawa_las/data/r320.las new file mode 100644 index 00000000..8f50471f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r320.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r324.las b/resources/pointclouds/lion_takanawa_las/data/r324.las new file mode 100644 index 00000000..16bebd08 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r324.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r34.las b/resources/pointclouds/lion_takanawa_las/data/r34.las new file mode 100644 index 00000000..f9602890 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r34.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r340.las b/resources/pointclouds/lion_takanawa_las/data/r340.las new file mode 100644 index 00000000..26d9611c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r340.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r341.las b/resources/pointclouds/lion_takanawa_las/data/r341.las new file mode 100644 index 00000000..a98c40c4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r341.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r342.las b/resources/pointclouds/lion_takanawa_las/data/r342.las new file mode 100644 index 00000000..34a9b1aa Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r342.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r344.las b/resources/pointclouds/lion_takanawa_las/data/r344.las new file mode 100644 index 00000000..29419348 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r344.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r345.las b/resources/pointclouds/lion_takanawa_las/data/r345.las new file mode 100644 index 00000000..400879eb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r345.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r346.las b/resources/pointclouds/lion_takanawa_las/data/r346.las new file mode 100644 index 00000000..eb6cb82d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r346.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r35.las b/resources/pointclouds/lion_takanawa_las/data/r35.las new file mode 100644 index 00000000..f85f2b90 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r35.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r350.las b/resources/pointclouds/lion_takanawa_las/data/r350.las new file mode 100644 index 00000000..8d93c09a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r350.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r352.las b/resources/pointclouds/lion_takanawa_las/data/r352.las new file mode 100644 index 00000000..50f93522 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r352.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r353.las b/resources/pointclouds/lion_takanawa_las/data/r353.las new file mode 100644 index 00000000..5c123290 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r353.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r354.las b/resources/pointclouds/lion_takanawa_las/data/r354.las new file mode 100644 index 00000000..eaac0a8f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r354.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r355.las b/resources/pointclouds/lion_takanawa_las/data/r355.las new file mode 100644 index 00000000..cdddcfd2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r355.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r356.las b/resources/pointclouds/lion_takanawa_las/data/r356.las new file mode 100644 index 00000000..280cf677 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r356.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r357.las b/resources/pointclouds/lion_takanawa_las/data/r357.las new file mode 100644 index 00000000..337a6ac7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r357.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r36.las b/resources/pointclouds/lion_takanawa_las/data/r36.las new file mode 100644 index 00000000..6e0b97b8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r36.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r364.las b/resources/pointclouds/lion_takanawa_las/data/r364.las new file mode 100644 index 00000000..d0bdedbb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r364.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r365.las b/resources/pointclouds/lion_takanawa_las/data/r365.las new file mode 100644 index 00000000..842f6544 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r365.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r4.las b/resources/pointclouds/lion_takanawa_las/data/r4.las new file mode 100644 index 00000000..9e043c73 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r4.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r40.las b/resources/pointclouds/lion_takanawa_las/data/r40.las new file mode 100644 index 00000000..bc393969 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r40.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r401.las b/resources/pointclouds/lion_takanawa_las/data/r401.las new file mode 100644 index 00000000..4c781b8f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r401.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r403.las b/resources/pointclouds/lion_takanawa_las/data/r403.las new file mode 100644 index 00000000..9da51efb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r403.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r406.las b/resources/pointclouds/lion_takanawa_las/data/r406.las new file mode 100644 index 00000000..b83cb172 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r406.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r407.las b/resources/pointclouds/lion_takanawa_las/data/r407.las new file mode 100644 index 00000000..2107b3cc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r407.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r41.las b/resources/pointclouds/lion_takanawa_las/data/r41.las new file mode 100644 index 00000000..ac0da2d7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r41.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r410.las b/resources/pointclouds/lion_takanawa_las/data/r410.las new file mode 100644 index 00000000..a00ed371 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r410.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r412.las b/resources/pointclouds/lion_takanawa_las/data/r412.las new file mode 100644 index 00000000..3c6681b0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r412.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r413.las b/resources/pointclouds/lion_takanawa_las/data/r413.las new file mode 100644 index 00000000..be460a33 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r413.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r414.las b/resources/pointclouds/lion_takanawa_las/data/r414.las new file mode 100644 index 00000000..ac0d681c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r414.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r416.las b/resources/pointclouds/lion_takanawa_las/data/r416.las new file mode 100644 index 00000000..c0b622e4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r416.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r417.las b/resources/pointclouds/lion_takanawa_las/data/r417.las new file mode 100644 index 00000000..a7b6230c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r417.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r42.las b/resources/pointclouds/lion_takanawa_las/data/r42.las new file mode 100644 index 00000000..6b253dba Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r42.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r424.las b/resources/pointclouds/lion_takanawa_las/data/r424.las new file mode 100644 index 00000000..05b14b13 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r424.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r425.las b/resources/pointclouds/lion_takanawa_las/data/r425.las new file mode 100644 index 00000000..0d5b1895 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r425.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r43.las b/resources/pointclouds/lion_takanawa_las/data/r43.las new file mode 100644 index 00000000..f9c51cee Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r43.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r430.las b/resources/pointclouds/lion_takanawa_las/data/r430.las new file mode 100644 index 00000000..7c2d7556 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r430.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r431.las b/resources/pointclouds/lion_takanawa_las/data/r431.las new file mode 100644 index 00000000..b80cbda2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r431.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r432.las b/resources/pointclouds/lion_takanawa_las/data/r432.las new file mode 100644 index 00000000..90c8f755 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r432.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r433.las b/resources/pointclouds/lion_takanawa_las/data/r433.las new file mode 100644 index 00000000..a30b166c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r433.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r434.las b/resources/pointclouds/lion_takanawa_las/data/r434.las new file mode 100644 index 00000000..cc472ae4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r434.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r435.las b/resources/pointclouds/lion_takanawa_las/data/r435.las new file mode 100644 index 00000000..10756454 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r435.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r436.las b/resources/pointclouds/lion_takanawa_las/data/r436.las new file mode 100644 index 00000000..a2d5eb22 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r436.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r437.las b/resources/pointclouds/lion_takanawa_las/data/r437.las new file mode 100644 index 00000000..42f38df1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r437.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r44.las b/resources/pointclouds/lion_takanawa_las/data/r44.las new file mode 100644 index 00000000..73605f50 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r44.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r442.las b/resources/pointclouds/lion_takanawa_las/data/r442.las new file mode 100644 index 00000000..e5124719 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r442.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r443.las b/resources/pointclouds/lion_takanawa_las/data/r443.las new file mode 100644 index 00000000..5b1f743f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r443.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r447.las b/resources/pointclouds/lion_takanawa_las/data/r447.las new file mode 100644 index 00000000..9f1ae125 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r447.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r45.las b/resources/pointclouds/lion_takanawa_las/data/r45.las new file mode 100644 index 00000000..535076c6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r45.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r452.las b/resources/pointclouds/lion_takanawa_las/data/r452.las new file mode 100644 index 00000000..6fb3c69f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r452.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r453.las b/resources/pointclouds/lion_takanawa_las/data/r453.las new file mode 100644 index 00000000..fad185c7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r453.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r46.las b/resources/pointclouds/lion_takanawa_las/data/r46.las new file mode 100644 index 00000000..73aaa198 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r46.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r461.las b/resources/pointclouds/lion_takanawa_las/data/r461.las new file mode 100644 index 00000000..38702962 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r461.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r463.las b/resources/pointclouds/lion_takanawa_las/data/r463.las new file mode 100644 index 00000000..ceba5c7f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r463.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r464.las b/resources/pointclouds/lion_takanawa_las/data/r464.las new file mode 100644 index 00000000..a450d8af Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r464.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r465.las b/resources/pointclouds/lion_takanawa_las/data/r465.las new file mode 100644 index 00000000..2ab01f0c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r465.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r466.las b/resources/pointclouds/lion_takanawa_las/data/r466.las new file mode 100644 index 00000000..73ed8468 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r466.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r467.las b/resources/pointclouds/lion_takanawa_las/data/r467.las new file mode 100644 index 00000000..5a022686 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r467.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r47.las b/resources/pointclouds/lion_takanawa_las/data/r47.las new file mode 100644 index 00000000..ddc3ce04 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r47.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r470.las b/resources/pointclouds/lion_takanawa_las/data/r470.las new file mode 100644 index 00000000..ca3c2cc5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r470.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r471.las b/resources/pointclouds/lion_takanawa_las/data/r471.las new file mode 100644 index 00000000..a4142a8a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r471.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r472.las b/resources/pointclouds/lion_takanawa_las/data/r472.las new file mode 100644 index 00000000..85ea2d5e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r472.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r476.las b/resources/pointclouds/lion_takanawa_las/data/r476.las new file mode 100644 index 00000000..7165f660 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r476.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r5.las b/resources/pointclouds/lion_takanawa_las/data/r5.las new file mode 100644 index 00000000..6b9ae613 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r5.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r50.las b/resources/pointclouds/lion_takanawa_las/data/r50.las new file mode 100644 index 00000000..8a1abfd6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r50.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r503.las b/resources/pointclouds/lion_takanawa_las/data/r503.las new file mode 100644 index 00000000..2991d67e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r503.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r51.las b/resources/pointclouds/lion_takanawa_las/data/r51.las new file mode 100644 index 00000000..1447046d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r51.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r52.las b/resources/pointclouds/lion_takanawa_las/data/r52.las new file mode 100644 index 00000000..303b3cc8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r52.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r520.las b/resources/pointclouds/lion_takanawa_las/data/r520.las new file mode 100644 index 00000000..61d4b981 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r520.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r521.las b/resources/pointclouds/lion_takanawa_las/data/r521.las new file mode 100644 index 00000000..1f3235d9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r521.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r522.las b/resources/pointclouds/lion_takanawa_las/data/r522.las new file mode 100644 index 00000000..a1c7fa83 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r522.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r523.las b/resources/pointclouds/lion_takanawa_las/data/r523.las new file mode 100644 index 00000000..137d844d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r523.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r53.las b/resources/pointclouds/lion_takanawa_las/data/r53.las new file mode 100644 index 00000000..87085869 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r53.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r530.las b/resources/pointclouds/lion_takanawa_las/data/r530.las new file mode 100644 index 00000000..e3010c25 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r530.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r536.las b/resources/pointclouds/lion_takanawa_las/data/r536.las new file mode 100644 index 00000000..3d792173 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r536.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r54.las b/resources/pointclouds/lion_takanawa_las/data/r54.las new file mode 100644 index 00000000..8fa90bd6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r54.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r542.las b/resources/pointclouds/lion_takanawa_las/data/r542.las new file mode 100644 index 00000000..7f44faf8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r542.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r6.las b/resources/pointclouds/lion_takanawa_las/data/r6.las new file mode 100644 index 00000000..5e27b0bb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r6.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r61.las b/resources/pointclouds/lion_takanawa_las/data/r61.las new file mode 100644 index 00000000..90640f61 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r61.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r611.las b/resources/pointclouds/lion_takanawa_las/data/r611.las new file mode 100644 index 00000000..3bfdd8ae Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r611.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r613.las b/resources/pointclouds/lion_takanawa_las/data/r613.las new file mode 100644 index 00000000..5a5d123c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r613.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r614.las b/resources/pointclouds/lion_takanawa_las/data/r614.las new file mode 100644 index 00000000..73788b79 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r614.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r615.las b/resources/pointclouds/lion_takanawa_las/data/r615.las new file mode 100644 index 00000000..61ebecf7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r615.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r617.las b/resources/pointclouds/lion_takanawa_las/data/r617.las new file mode 100644 index 00000000..1b65b970 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r617.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r63.las b/resources/pointclouds/lion_takanawa_las/data/r63.las new file mode 100644 index 00000000..d538e7af Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r63.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r631.las b/resources/pointclouds/lion_takanawa_las/data/r631.las new file mode 100644 index 00000000..539f14cb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r631.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r635.las b/resources/pointclouds/lion_takanawa_las/data/r635.las new file mode 100644 index 00000000..5e93ae94 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r635.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r64.las b/resources/pointclouds/lion_takanawa_las/data/r64.las new file mode 100644 index 00000000..6b68e924 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r64.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r644.las b/resources/pointclouds/lion_takanawa_las/data/r644.las new file mode 100644 index 00000000..8613846d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r644.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r645.las b/resources/pointclouds/lion_takanawa_las/data/r645.las new file mode 100644 index 00000000..4eef6b3b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r645.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r647.las b/resources/pointclouds/lion_takanawa_las/data/r647.las new file mode 100644 index 00000000..30138d6a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r647.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r65.las b/resources/pointclouds/lion_takanawa_las/data/r65.las new file mode 100644 index 00000000..a2f8d97b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r65.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r650.las b/resources/pointclouds/lion_takanawa_las/data/r650.las new file mode 100644 index 00000000..9889c1e5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r650.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r651.las b/resources/pointclouds/lion_takanawa_las/data/r651.las new file mode 100644 index 00000000..c8aa340c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r651.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r652.las b/resources/pointclouds/lion_takanawa_las/data/r652.las new file mode 100644 index 00000000..4cc2e178 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r652.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r653.las b/resources/pointclouds/lion_takanawa_las/data/r653.las new file mode 100644 index 00000000..9ef02636 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r653.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r654.las b/resources/pointclouds/lion_takanawa_las/data/r654.las new file mode 100644 index 00000000..e4b485b9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r654.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r656.las b/resources/pointclouds/lion_takanawa_las/data/r656.las new file mode 100644 index 00000000..d2617d5e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r656.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r657.las b/resources/pointclouds/lion_takanawa_las/data/r657.las new file mode 100644 index 00000000..4983e2fc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r657.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r67.las b/resources/pointclouds/lion_takanawa_las/data/r67.las new file mode 100644 index 00000000..73db5fbb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r67.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r671.las b/resources/pointclouds/lion_takanawa_las/data/r671.las new file mode 100644 index 00000000..85984d41 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r671.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r673.las b/resources/pointclouds/lion_takanawa_las/data/r673.las new file mode 100644 index 00000000..4dd8cfce Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r673.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r674.las b/resources/pointclouds/lion_takanawa_las/data/r674.las new file mode 100644 index 00000000..f4ea14dd Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r674.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r675.las b/resources/pointclouds/lion_takanawa_las/data/r675.las new file mode 100644 index 00000000..fc769b53 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r675.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r7.las b/resources/pointclouds/lion_takanawa_las/data/r7.las new file mode 100644 index 00000000..a8ab350b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r7.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r70.las b/resources/pointclouds/lion_takanawa_las/data/r70.las new file mode 100644 index 00000000..522ca2a7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r70.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r700.las b/resources/pointclouds/lion_takanawa_las/data/r700.las new file mode 100644 index 00000000..982e43fb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r700.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r701.las b/resources/pointclouds/lion_takanawa_las/data/r701.las new file mode 100644 index 00000000..c287ceb1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r701.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r702.las b/resources/pointclouds/lion_takanawa_las/data/r702.las new file mode 100644 index 00000000..f260411c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r702.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r703.las b/resources/pointclouds/lion_takanawa_las/data/r703.las new file mode 100644 index 00000000..511ded85 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r703.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r707.las b/resources/pointclouds/lion_takanawa_las/data/r707.las new file mode 100644 index 00000000..99c33f29 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r707.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r71.las b/resources/pointclouds/lion_takanawa_las/data/r71.las new file mode 100644 index 00000000..a41f1d3c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r71.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r710.las b/resources/pointclouds/lion_takanawa_las/data/r710.las new file mode 100644 index 00000000..e7c81fd7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r710.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r712.las b/resources/pointclouds/lion_takanawa_las/data/r712.las new file mode 100644 index 00000000..abdd2625 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r712.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r714.las b/resources/pointclouds/lion_takanawa_las/data/r714.las new file mode 100644 index 00000000..514793bc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r714.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r715.las b/resources/pointclouds/lion_takanawa_las/data/r715.las new file mode 100644 index 00000000..89ed1cc7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r715.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r716.las b/resources/pointclouds/lion_takanawa_las/data/r716.las new file mode 100644 index 00000000..8ff79243 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r716.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r717.las b/resources/pointclouds/lion_takanawa_las/data/r717.las new file mode 100644 index 00000000..eae834e2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r717.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r72.las b/resources/pointclouds/lion_takanawa_las/data/r72.las new file mode 100644 index 00000000..59126b1a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r72.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r720.las b/resources/pointclouds/lion_takanawa_las/data/r720.las new file mode 100644 index 00000000..bdc98268 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r720.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r721.las b/resources/pointclouds/lion_takanawa_las/data/r721.las new file mode 100644 index 00000000..73ee5862 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r721.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r724.las b/resources/pointclouds/lion_takanawa_las/data/r724.las new file mode 100644 index 00000000..83617803 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r724.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r725.las b/resources/pointclouds/lion_takanawa_las/data/r725.las new file mode 100644 index 00000000..04971416 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r725.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r73.las b/resources/pointclouds/lion_takanawa_las/data/r73.las new file mode 100644 index 00000000..0311025a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r73.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r734.las b/resources/pointclouds/lion_takanawa_las/data/r734.las new file mode 100644 index 00000000..65717661 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r734.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r735.las b/resources/pointclouds/lion_takanawa_las/data/r735.las new file mode 100644 index 00000000..0a1420e5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r735.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r76.las b/resources/pointclouds/lion_takanawa_las/data/r76.las new file mode 100644 index 00000000..f6b54fcc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r76.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r760.las b/resources/pointclouds/lion_takanawa_las/data/r760.las new file mode 100644 index 00000000..a0069d6a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r760.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r761.las b/resources/pointclouds/lion_takanawa_las/data/r761.las new file mode 100644 index 00000000..9fc7de56 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r761.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r762.las b/resources/pointclouds/lion_takanawa_las/data/r762.las new file mode 100644 index 00000000..fe885351 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r762.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r763.las b/resources/pointclouds/lion_takanawa_las/data/r763.las new file mode 100644 index 00000000..f4e6c416 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r763.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r77.las b/resources/pointclouds/lion_takanawa_las/data/r77.las new file mode 100644 index 00000000..b54f1568 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r77.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r770.las b/resources/pointclouds/lion_takanawa_las/data/r770.las new file mode 100644 index 00000000..8a40d0cb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r770.las differ diff --git a/resources/pointclouds/lion_takanawa_las/data/r771.las b/resources/pointclouds/lion_takanawa_las/data/r771.las new file mode 100644 index 00000000..e8189800 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_las/data/r771.las differ diff --git a/resources/pointclouds/lion_takanawa_laz/cloud.js b/resources/pointclouds/lion_takanawa_laz/cloud.js new file mode 100644 index 00000000..53c52bc6 --- /dev/null +++ b/resources/pointclouds/lion_takanawa_laz/cloud.js @@ -0,0 +1,217 @@ +{ + "version": "1.3", + "octreeDir": "data", + "boundingBox": { + "lx": -2.91016, + "ly": -4.06274, + "lz": 2.63048, + "ux": 4.62238, + "uy": 3.4698, + "uz": 10.163 + }, + "pointAttributes": "LAZ", + "spacing": 0.1, + "hierarchy": [ + ["r", 5942], + ["r0", 2174], + ["r1", 450], + ["r2", 3021], + ["r3", 3384], + ["r4", 5667], + ["r5", 858], + ["r6", 4074], + ["r7", 3757], + ["r02", 168], + ["r03", 1923], + ["r05", 628], + ["r07", 5280], + ["r12", 461], + ["r16", 648], + ["r17", 441], + ["r21", 5449], + ["r23", 168], + ["r25", 5898], + ["r27", 107], + ["r30", 4832], + ["r32", 367], + ["r34", 3981], + ["r35", 3131], + ["r36", 22], + ["r40", 3590], + ["r41", 1426], + ["r42", 46], + ["r43", 7635], + ["r44", 374], + ["r45", 1094], + ["r46", 3853], + ["r47", 2986], + ["r50", 74], + ["r51", 1], + ["r52", 2853], + ["r53", 177], + ["r54", 101], + ["r61", 5846], + ["r63", 1221], + ["r64", 2033], + ["r65", 4771], + ["r67", 1662], + ["r70", 6735], + ["r71", 2635], + ["r72", 3326], + ["r73", 650], + ["r76", 1250], + ["r77", 257], + ["r026", 530], + ["r032", 378], + ["r033", 1480], + ["r036", 1889], + ["r037", 3010], + ["r054", 238], + ["r056", 1094], + ["r057", 762], + ["r070", 1843], + ["r071", 1210], + ["r072", 3830], + ["r073", 767], + ["r074", 4861], + ["r075", 106], + ["r076", 5035], + ["r077", 1633], + ["r122", 445], + ["r126", 1023], + ["r162", 373], + ["r163", 36], + ["r164", 1497], + ["r165", 8], + ["r167", 205], + ["r172", 1300], + ["r176", 3], + ["r210", 2788], + ["r211", 633], + ["r212", 838], + ["r213", 4318], + ["r214", 4519], + ["r215", 208], + ["r216", 557], + ["r217", 6047], + ["r231", 155], + ["r235", 440], + ["r250", 4161], + ["r251", 165], + ["r252", 1003], + ["r253", 4764], + ["r254", 1852], + ["r255", 2251], + ["r256", 616], + ["r257", 6818], + ["r275", 381], + ["r300", 2972], + ["r302", 4840], + ["r304", 4053], + ["r306", 5773], + ["r320", 119], + ["r324", 1203], + ["r340", 2357], + ["r341", 2434], + ["r342", 4117], + ["r344", 1997], + ["r345", 2557], + ["r346", 1507], + ["r350", 2269], + ["r352", 3534], + ["r353", 470], + ["r354", 1113], + ["r355", 54], + ["r356", 999], + ["r357", 688], + ["r364", 62], + ["r365", 7], + ["r401", 1424], + ["r403", 2506], + ["r406", 948], + ["r407", 5333], + ["r410", 738], + ["r412", 2277], + ["r413", 564], + ["r414", 77], + ["r416", 921], + ["r417", 45], + ["r424", 29], + ["r425", 104], + ["r430", 4705], + ["r431", 114], + ["r432", 5396], + ["r433", 8405], + ["r434", 4567], + ["r435", 84], + ["r436", 4626], + ["r437", 173], + ["r442", 36], + ["r443", 1068], + ["r447", 18], + ["r452", 998], + ["r453", 2631], + ["r461", 2438], + ["r463", 985], + ["r464", 281], + ["r465", 3004], + ["r466", 1995], + ["r467", 3950], + ["r470", 4351], + ["r471", 9], + ["r472", 5238], + ["r476", 1333], + ["r503", 188], + ["r520", 3417], + ["r521", 681], + ["r522", 5058], + ["r523", 980], + ["r530", 180], + ["r536", 381], + ["r542", 337], + ["r611", 4508], + ["r613", 7480], + ["r614", 1922], + ["r615", 3107], + ["r617", 4582], + ["r631", 2907], + ["r635", 1597], + ["r644", 1899], + ["r645", 3530], + ["r647", 1084], + ["r650", 4204], + ["r651", 1936], + ["r652", 1547], + ["r653", 4255], + ["r654", 3044], + ["r656", 1801], + ["r657", 522], + ["r671", 4687], + ["r673", 177], + ["r674", 220], + ["r675", 950], + ["r700", 5633], + ["r701", 5209], + ["r702", 5704], + ["r703", 5499], + ["r707", 3858], + ["r710", 106], + ["r712", 1416], + ["r714", 1921], + ["r715", 219], + ["r716", 4007], + ["r717", 1460], + ["r720", 3114], + ["r721", 130], + ["r724", 5409], + ["r725", 4051], + ["r734", 2341], + ["r735", 17], + ["r760", 2962], + ["r761", 319], + ["r762", 1073], + ["r763", 2], + ["r770", 824], + ["r771", 27] + ] +} diff --git a/resources/pointclouds/lion_takanawa_laz/data/r.laz b/resources/pointclouds/lion_takanawa_laz/data/r.laz new file mode 100644 index 00000000..ad31e697 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r0.laz b/resources/pointclouds/lion_takanawa_laz/data/r0.laz new file mode 100644 index 00000000..71471398 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r0.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r02.laz b/resources/pointclouds/lion_takanawa_laz/data/r02.laz new file mode 100644 index 00000000..278ce893 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r02.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r026.laz b/resources/pointclouds/lion_takanawa_laz/data/r026.laz new file mode 100644 index 00000000..cdea8507 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r026.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r03.laz b/resources/pointclouds/lion_takanawa_laz/data/r03.laz new file mode 100644 index 00000000..8cddb0fe Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r03.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r032.laz b/resources/pointclouds/lion_takanawa_laz/data/r032.laz new file mode 100644 index 00000000..901fbc45 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r032.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r033.laz b/resources/pointclouds/lion_takanawa_laz/data/r033.laz new file mode 100644 index 00000000..9bb95402 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r033.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r036.laz b/resources/pointclouds/lion_takanawa_laz/data/r036.laz new file mode 100644 index 00000000..fd4e812c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r036.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r037.laz b/resources/pointclouds/lion_takanawa_laz/data/r037.laz new file mode 100644 index 00000000..3b4ec08d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r037.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r05.laz b/resources/pointclouds/lion_takanawa_laz/data/r05.laz new file mode 100644 index 00000000..21e09920 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r05.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r054.laz b/resources/pointclouds/lion_takanawa_laz/data/r054.laz new file mode 100644 index 00000000..f781fe2f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r054.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r056.laz b/resources/pointclouds/lion_takanawa_laz/data/r056.laz new file mode 100644 index 00000000..e62fca61 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r056.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r057.laz b/resources/pointclouds/lion_takanawa_laz/data/r057.laz new file mode 100644 index 00000000..dd7a42b2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r057.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r07.laz b/resources/pointclouds/lion_takanawa_laz/data/r07.laz new file mode 100644 index 00000000..9e39feae Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r07.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r070.laz b/resources/pointclouds/lion_takanawa_laz/data/r070.laz new file mode 100644 index 00000000..db208d26 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r070.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r071.laz b/resources/pointclouds/lion_takanawa_laz/data/r071.laz new file mode 100644 index 00000000..490f928f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r071.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r072.laz b/resources/pointclouds/lion_takanawa_laz/data/r072.laz new file mode 100644 index 00000000..988f5a6b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r072.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r073.laz b/resources/pointclouds/lion_takanawa_laz/data/r073.laz new file mode 100644 index 00000000..dbb31d91 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r073.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r074.laz b/resources/pointclouds/lion_takanawa_laz/data/r074.laz new file mode 100644 index 00000000..1c2a8ab1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r074.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r075.laz b/resources/pointclouds/lion_takanawa_laz/data/r075.laz new file mode 100644 index 00000000..86a15e8b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r075.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r076.laz b/resources/pointclouds/lion_takanawa_laz/data/r076.laz new file mode 100644 index 00000000..aacb96c6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r076.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r077.laz b/resources/pointclouds/lion_takanawa_laz/data/r077.laz new file mode 100644 index 00000000..08c54e83 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r077.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r1.laz b/resources/pointclouds/lion_takanawa_laz/data/r1.laz new file mode 100644 index 00000000..3c56dbc8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r1.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r12.laz b/resources/pointclouds/lion_takanawa_laz/data/r12.laz new file mode 100644 index 00000000..4bb106d8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r12.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r122.laz b/resources/pointclouds/lion_takanawa_laz/data/r122.laz new file mode 100644 index 00000000..6a9286c7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r122.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r126.laz b/resources/pointclouds/lion_takanawa_laz/data/r126.laz new file mode 100644 index 00000000..c507ca5e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r126.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r16.laz b/resources/pointclouds/lion_takanawa_laz/data/r16.laz new file mode 100644 index 00000000..502ea989 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r16.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r162.laz b/resources/pointclouds/lion_takanawa_laz/data/r162.laz new file mode 100644 index 00000000..7fa6bd2c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r162.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r163.laz b/resources/pointclouds/lion_takanawa_laz/data/r163.laz new file mode 100644 index 00000000..d02d0968 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r163.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r164.laz b/resources/pointclouds/lion_takanawa_laz/data/r164.laz new file mode 100644 index 00000000..f8b25c67 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r164.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r165.laz b/resources/pointclouds/lion_takanawa_laz/data/r165.laz new file mode 100644 index 00000000..f7caa169 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r165.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r167.laz b/resources/pointclouds/lion_takanawa_laz/data/r167.laz new file mode 100644 index 00000000..87b78220 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r167.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r17.laz b/resources/pointclouds/lion_takanawa_laz/data/r17.laz new file mode 100644 index 00000000..ae7c738a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r17.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r172.laz b/resources/pointclouds/lion_takanawa_laz/data/r172.laz new file mode 100644 index 00000000..32e95c85 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r172.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r176.laz b/resources/pointclouds/lion_takanawa_laz/data/r176.laz new file mode 100644 index 00000000..9c2a188c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r176.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r2.laz b/resources/pointclouds/lion_takanawa_laz/data/r2.laz new file mode 100644 index 00000000..7f123952 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r2.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r21.laz b/resources/pointclouds/lion_takanawa_laz/data/r21.laz new file mode 100644 index 00000000..1e61bd5d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r21.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r210.laz b/resources/pointclouds/lion_takanawa_laz/data/r210.laz new file mode 100644 index 00000000..06ba8ef5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r210.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r211.laz b/resources/pointclouds/lion_takanawa_laz/data/r211.laz new file mode 100644 index 00000000..c415cae3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r211.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r212.laz b/resources/pointclouds/lion_takanawa_laz/data/r212.laz new file mode 100644 index 00000000..6b2473ce Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r212.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r213.laz b/resources/pointclouds/lion_takanawa_laz/data/r213.laz new file mode 100644 index 00000000..bae133e1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r213.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r214.laz b/resources/pointclouds/lion_takanawa_laz/data/r214.laz new file mode 100644 index 00000000..b37d2fcf Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r214.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r215.laz b/resources/pointclouds/lion_takanawa_laz/data/r215.laz new file mode 100644 index 00000000..507c0dc7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r215.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r216.laz b/resources/pointclouds/lion_takanawa_laz/data/r216.laz new file mode 100644 index 00000000..c3e35d17 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r216.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r217.laz b/resources/pointclouds/lion_takanawa_laz/data/r217.laz new file mode 100644 index 00000000..295c563c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r217.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r23.laz b/resources/pointclouds/lion_takanawa_laz/data/r23.laz new file mode 100644 index 00000000..801724ba Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r23.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r231.laz b/resources/pointclouds/lion_takanawa_laz/data/r231.laz new file mode 100644 index 00000000..9e56bf7b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r231.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r235.laz b/resources/pointclouds/lion_takanawa_laz/data/r235.laz new file mode 100644 index 00000000..7018f994 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r235.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r25.laz b/resources/pointclouds/lion_takanawa_laz/data/r25.laz new file mode 100644 index 00000000..ad07ef73 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r25.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r250.laz b/resources/pointclouds/lion_takanawa_laz/data/r250.laz new file mode 100644 index 00000000..e23f32d6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r250.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r251.laz b/resources/pointclouds/lion_takanawa_laz/data/r251.laz new file mode 100644 index 00000000..91bbaca7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r251.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r252.laz b/resources/pointclouds/lion_takanawa_laz/data/r252.laz new file mode 100644 index 00000000..9ab4455f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r252.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r253.laz b/resources/pointclouds/lion_takanawa_laz/data/r253.laz new file mode 100644 index 00000000..0f4e5ee1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r253.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r254.laz b/resources/pointclouds/lion_takanawa_laz/data/r254.laz new file mode 100644 index 00000000..2746626f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r254.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r255.laz b/resources/pointclouds/lion_takanawa_laz/data/r255.laz new file mode 100644 index 00000000..52c87d82 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r255.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r256.laz b/resources/pointclouds/lion_takanawa_laz/data/r256.laz new file mode 100644 index 00000000..00aeeb99 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r256.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r257.laz b/resources/pointclouds/lion_takanawa_laz/data/r257.laz new file mode 100644 index 00000000..030e4dd9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r257.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r27.laz b/resources/pointclouds/lion_takanawa_laz/data/r27.laz new file mode 100644 index 00000000..7f067515 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r27.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r275.laz b/resources/pointclouds/lion_takanawa_laz/data/r275.laz new file mode 100644 index 00000000..2aef652a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r275.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r3.laz b/resources/pointclouds/lion_takanawa_laz/data/r3.laz new file mode 100644 index 00000000..53ff4ee6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r3.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r30.laz b/resources/pointclouds/lion_takanawa_laz/data/r30.laz new file mode 100644 index 00000000..29a2657f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r30.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r300.laz b/resources/pointclouds/lion_takanawa_laz/data/r300.laz new file mode 100644 index 00000000..9d3452d5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r300.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r302.laz b/resources/pointclouds/lion_takanawa_laz/data/r302.laz new file mode 100644 index 00000000..47599b72 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r302.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r304.laz b/resources/pointclouds/lion_takanawa_laz/data/r304.laz new file mode 100644 index 00000000..3db465c6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r304.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r306.laz b/resources/pointclouds/lion_takanawa_laz/data/r306.laz new file mode 100644 index 00000000..7b081b25 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r306.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r32.laz b/resources/pointclouds/lion_takanawa_laz/data/r32.laz new file mode 100644 index 00000000..b1a536b4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r32.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r320.laz b/resources/pointclouds/lion_takanawa_laz/data/r320.laz new file mode 100644 index 00000000..70342605 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r320.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r324.laz b/resources/pointclouds/lion_takanawa_laz/data/r324.laz new file mode 100644 index 00000000..55933b39 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r324.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r34.laz b/resources/pointclouds/lion_takanawa_laz/data/r34.laz new file mode 100644 index 00000000..3c337d50 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r34.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r340.laz b/resources/pointclouds/lion_takanawa_laz/data/r340.laz new file mode 100644 index 00000000..6256b831 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r340.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r341.laz b/resources/pointclouds/lion_takanawa_laz/data/r341.laz new file mode 100644 index 00000000..8e108dad Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r341.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r342.laz b/resources/pointclouds/lion_takanawa_laz/data/r342.laz new file mode 100644 index 00000000..c5940622 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r342.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r344.laz b/resources/pointclouds/lion_takanawa_laz/data/r344.laz new file mode 100644 index 00000000..80aa37ff Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r344.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r345.laz b/resources/pointclouds/lion_takanawa_laz/data/r345.laz new file mode 100644 index 00000000..78eb3a30 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r345.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r346.laz b/resources/pointclouds/lion_takanawa_laz/data/r346.laz new file mode 100644 index 00000000..840cc55f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r346.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r35.laz b/resources/pointclouds/lion_takanawa_laz/data/r35.laz new file mode 100644 index 00000000..5f88c4bd Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r35.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r350.laz b/resources/pointclouds/lion_takanawa_laz/data/r350.laz new file mode 100644 index 00000000..51d80971 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r350.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r352.laz b/resources/pointclouds/lion_takanawa_laz/data/r352.laz new file mode 100644 index 00000000..89ca59e6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r352.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r353.laz b/resources/pointclouds/lion_takanawa_laz/data/r353.laz new file mode 100644 index 00000000..0398bf9d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r353.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r354.laz b/resources/pointclouds/lion_takanawa_laz/data/r354.laz new file mode 100644 index 00000000..d9f08edc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r354.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r355.laz b/resources/pointclouds/lion_takanawa_laz/data/r355.laz new file mode 100644 index 00000000..4795a83a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r355.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r356.laz b/resources/pointclouds/lion_takanawa_laz/data/r356.laz new file mode 100644 index 00000000..9ae98b62 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r356.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r357.laz b/resources/pointclouds/lion_takanawa_laz/data/r357.laz new file mode 100644 index 00000000..6f2d42d5 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r357.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r36.laz b/resources/pointclouds/lion_takanawa_laz/data/r36.laz new file mode 100644 index 00000000..79f5f7dc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r36.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r364.laz b/resources/pointclouds/lion_takanawa_laz/data/r364.laz new file mode 100644 index 00000000..f045a269 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r364.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r365.laz b/resources/pointclouds/lion_takanawa_laz/data/r365.laz new file mode 100644 index 00000000..16933f78 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r365.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r4.laz b/resources/pointclouds/lion_takanawa_laz/data/r4.laz new file mode 100644 index 00000000..e5c734d9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r4.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r40.laz b/resources/pointclouds/lion_takanawa_laz/data/r40.laz new file mode 100644 index 00000000..98f914d9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r40.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r401.laz b/resources/pointclouds/lion_takanawa_laz/data/r401.laz new file mode 100644 index 00000000..f4fe4c75 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r401.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r403.laz b/resources/pointclouds/lion_takanawa_laz/data/r403.laz new file mode 100644 index 00000000..2957ec1e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r403.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r406.laz b/resources/pointclouds/lion_takanawa_laz/data/r406.laz new file mode 100644 index 00000000..7dc905d3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r406.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r407.laz b/resources/pointclouds/lion_takanawa_laz/data/r407.laz new file mode 100644 index 00000000..9b785efc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r407.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r41.laz b/resources/pointclouds/lion_takanawa_laz/data/r41.laz new file mode 100644 index 00000000..b0a62264 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r41.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r410.laz b/resources/pointclouds/lion_takanawa_laz/data/r410.laz new file mode 100644 index 00000000..314bfa6e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r410.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r412.laz b/resources/pointclouds/lion_takanawa_laz/data/r412.laz new file mode 100644 index 00000000..d7e3d2bb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r412.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r413.laz b/resources/pointclouds/lion_takanawa_laz/data/r413.laz new file mode 100644 index 00000000..f0f2ac0f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r413.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r414.laz b/resources/pointclouds/lion_takanawa_laz/data/r414.laz new file mode 100644 index 00000000..403052c8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r414.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r416.laz b/resources/pointclouds/lion_takanawa_laz/data/r416.laz new file mode 100644 index 00000000..df0b6fdc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r416.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r417.laz b/resources/pointclouds/lion_takanawa_laz/data/r417.laz new file mode 100644 index 00000000..53142455 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r417.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r42.laz b/resources/pointclouds/lion_takanawa_laz/data/r42.laz new file mode 100644 index 00000000..ac102364 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r42.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r424.laz b/resources/pointclouds/lion_takanawa_laz/data/r424.laz new file mode 100644 index 00000000..2b6c7912 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r424.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r425.laz b/resources/pointclouds/lion_takanawa_laz/data/r425.laz new file mode 100644 index 00000000..6b679c79 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r425.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r43.laz b/resources/pointclouds/lion_takanawa_laz/data/r43.laz new file mode 100644 index 00000000..20c8527c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r43.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r430.laz b/resources/pointclouds/lion_takanawa_laz/data/r430.laz new file mode 100644 index 00000000..95488d35 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r430.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r431.laz b/resources/pointclouds/lion_takanawa_laz/data/r431.laz new file mode 100644 index 00000000..a92ded9d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r431.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r432.laz b/resources/pointclouds/lion_takanawa_laz/data/r432.laz new file mode 100644 index 00000000..704e9f6b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r432.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r433.laz b/resources/pointclouds/lion_takanawa_laz/data/r433.laz new file mode 100644 index 00000000..df400275 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r433.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r434.laz b/resources/pointclouds/lion_takanawa_laz/data/r434.laz new file mode 100644 index 00000000..7338c836 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r434.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r435.laz b/resources/pointclouds/lion_takanawa_laz/data/r435.laz new file mode 100644 index 00000000..0d63371d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r435.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r436.laz b/resources/pointclouds/lion_takanawa_laz/data/r436.laz new file mode 100644 index 00000000..cec9fd1b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r436.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r437.laz b/resources/pointclouds/lion_takanawa_laz/data/r437.laz new file mode 100644 index 00000000..b118f27d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r437.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r44.laz b/resources/pointclouds/lion_takanawa_laz/data/r44.laz new file mode 100644 index 00000000..0d6fd90d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r44.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r442.laz b/resources/pointclouds/lion_takanawa_laz/data/r442.laz new file mode 100644 index 00000000..1d5361a2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r442.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r443.laz b/resources/pointclouds/lion_takanawa_laz/data/r443.laz new file mode 100644 index 00000000..ec5abe7f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r443.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r447.laz b/resources/pointclouds/lion_takanawa_laz/data/r447.laz new file mode 100644 index 00000000..6096b90e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r447.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r45.laz b/resources/pointclouds/lion_takanawa_laz/data/r45.laz new file mode 100644 index 00000000..f99a4056 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r45.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r452.laz b/resources/pointclouds/lion_takanawa_laz/data/r452.laz new file mode 100644 index 00000000..fc013974 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r452.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r453.laz b/resources/pointclouds/lion_takanawa_laz/data/r453.laz new file mode 100644 index 00000000..de70c6d6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r453.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r46.laz b/resources/pointclouds/lion_takanawa_laz/data/r46.laz new file mode 100644 index 00000000..1f1043b3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r46.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r461.laz b/resources/pointclouds/lion_takanawa_laz/data/r461.laz new file mode 100644 index 00000000..9a535ca8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r461.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r463.laz b/resources/pointclouds/lion_takanawa_laz/data/r463.laz new file mode 100644 index 00000000..f126d2df Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r463.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r464.laz b/resources/pointclouds/lion_takanawa_laz/data/r464.laz new file mode 100644 index 00000000..52c1ea88 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r464.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r465.laz b/resources/pointclouds/lion_takanawa_laz/data/r465.laz new file mode 100644 index 00000000..62a4b715 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r465.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r466.laz b/resources/pointclouds/lion_takanawa_laz/data/r466.laz new file mode 100644 index 00000000..59e30002 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r466.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r467.laz b/resources/pointclouds/lion_takanawa_laz/data/r467.laz new file mode 100644 index 00000000..1af6ec4b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r467.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r47.laz b/resources/pointclouds/lion_takanawa_laz/data/r47.laz new file mode 100644 index 00000000..4262737a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r47.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r470.laz b/resources/pointclouds/lion_takanawa_laz/data/r470.laz new file mode 100644 index 00000000..f2497561 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r470.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r471.laz b/resources/pointclouds/lion_takanawa_laz/data/r471.laz new file mode 100644 index 00000000..38cfb069 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r471.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r472.laz b/resources/pointclouds/lion_takanawa_laz/data/r472.laz new file mode 100644 index 00000000..985ff8ee Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r472.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r476.laz b/resources/pointclouds/lion_takanawa_laz/data/r476.laz new file mode 100644 index 00000000..62c72281 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r476.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r5.laz b/resources/pointclouds/lion_takanawa_laz/data/r5.laz new file mode 100644 index 00000000..a80e15bf Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r5.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r50.laz b/resources/pointclouds/lion_takanawa_laz/data/r50.laz new file mode 100644 index 00000000..7721e116 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r50.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r503.laz b/resources/pointclouds/lion_takanawa_laz/data/r503.laz new file mode 100644 index 00000000..95db7d2e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r503.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r51.laz b/resources/pointclouds/lion_takanawa_laz/data/r51.laz new file mode 100644 index 00000000..9afaba50 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r51.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r52.laz b/resources/pointclouds/lion_takanawa_laz/data/r52.laz new file mode 100644 index 00000000..ee8031fa Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r52.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r520.laz b/resources/pointclouds/lion_takanawa_laz/data/r520.laz new file mode 100644 index 00000000..2622af4a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r520.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r521.laz b/resources/pointclouds/lion_takanawa_laz/data/r521.laz new file mode 100644 index 00000000..6a881233 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r521.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r522.laz b/resources/pointclouds/lion_takanawa_laz/data/r522.laz new file mode 100644 index 00000000..b26d7eab Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r522.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r523.laz b/resources/pointclouds/lion_takanawa_laz/data/r523.laz new file mode 100644 index 00000000..db95c567 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r523.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r53.laz b/resources/pointclouds/lion_takanawa_laz/data/r53.laz new file mode 100644 index 00000000..2624932d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r53.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r530.laz b/resources/pointclouds/lion_takanawa_laz/data/r530.laz new file mode 100644 index 00000000..63a2b1f7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r530.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r536.laz b/resources/pointclouds/lion_takanawa_laz/data/r536.laz new file mode 100644 index 00000000..ef74fd17 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r536.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r54.laz b/resources/pointclouds/lion_takanawa_laz/data/r54.laz new file mode 100644 index 00000000..f8baec6d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r54.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r542.laz b/resources/pointclouds/lion_takanawa_laz/data/r542.laz new file mode 100644 index 00000000..1dfb60f7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r542.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r6.laz b/resources/pointclouds/lion_takanawa_laz/data/r6.laz new file mode 100644 index 00000000..20619464 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r6.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r61.laz b/resources/pointclouds/lion_takanawa_laz/data/r61.laz new file mode 100644 index 00000000..3c86bb2a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r61.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r611.laz b/resources/pointclouds/lion_takanawa_laz/data/r611.laz new file mode 100644 index 00000000..cdce26bb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r611.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r613.laz b/resources/pointclouds/lion_takanawa_laz/data/r613.laz new file mode 100644 index 00000000..935071c2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r613.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r614.laz b/resources/pointclouds/lion_takanawa_laz/data/r614.laz new file mode 100644 index 00000000..ab4d8bb3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r614.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r615.laz b/resources/pointclouds/lion_takanawa_laz/data/r615.laz new file mode 100644 index 00000000..f75bc3ce Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r615.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r617.laz b/resources/pointclouds/lion_takanawa_laz/data/r617.laz new file mode 100644 index 00000000..aeb96f7e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r617.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r63.laz b/resources/pointclouds/lion_takanawa_laz/data/r63.laz new file mode 100644 index 00000000..35bb64f3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r63.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r631.laz b/resources/pointclouds/lion_takanawa_laz/data/r631.laz new file mode 100644 index 00000000..3bd60ebc Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r631.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r635.laz b/resources/pointclouds/lion_takanawa_laz/data/r635.laz new file mode 100644 index 00000000..c616c76a Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r635.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r64.laz b/resources/pointclouds/lion_takanawa_laz/data/r64.laz new file mode 100644 index 00000000..02feae65 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r64.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r644.laz b/resources/pointclouds/lion_takanawa_laz/data/r644.laz new file mode 100644 index 00000000..53ad0dbb Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r644.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r645.laz b/resources/pointclouds/lion_takanawa_laz/data/r645.laz new file mode 100644 index 00000000..287a39b4 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r645.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r647.laz b/resources/pointclouds/lion_takanawa_laz/data/r647.laz new file mode 100644 index 00000000..df17ace0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r647.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r65.laz b/resources/pointclouds/lion_takanawa_laz/data/r65.laz new file mode 100644 index 00000000..844bd1af Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r65.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r650.laz b/resources/pointclouds/lion_takanawa_laz/data/r650.laz new file mode 100644 index 00000000..889824f2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r650.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r651.laz b/resources/pointclouds/lion_takanawa_laz/data/r651.laz new file mode 100644 index 00000000..8363683f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r651.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r652.laz b/resources/pointclouds/lion_takanawa_laz/data/r652.laz new file mode 100644 index 00000000..dfb78026 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r652.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r653.laz b/resources/pointclouds/lion_takanawa_laz/data/r653.laz new file mode 100644 index 00000000..c13a68cd Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r653.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r654.laz b/resources/pointclouds/lion_takanawa_laz/data/r654.laz new file mode 100644 index 00000000..7f9db71e Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r654.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r656.laz b/resources/pointclouds/lion_takanawa_laz/data/r656.laz new file mode 100644 index 00000000..33f4cb6f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r656.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r657.laz b/resources/pointclouds/lion_takanawa_laz/data/r657.laz new file mode 100644 index 00000000..8719dcd8 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r657.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r67.laz b/resources/pointclouds/lion_takanawa_laz/data/r67.laz new file mode 100644 index 00000000..be163db6 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r67.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r671.laz b/resources/pointclouds/lion_takanawa_laz/data/r671.laz new file mode 100644 index 00000000..c2b02a00 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r671.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r673.laz b/resources/pointclouds/lion_takanawa_laz/data/r673.laz new file mode 100644 index 00000000..5711c686 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r673.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r674.laz b/resources/pointclouds/lion_takanawa_laz/data/r674.laz new file mode 100644 index 00000000..9e3821b3 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r674.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r675.laz b/resources/pointclouds/lion_takanawa_laz/data/r675.laz new file mode 100644 index 00000000..6ce46568 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r675.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r7.laz b/resources/pointclouds/lion_takanawa_laz/data/r7.laz new file mode 100644 index 00000000..335ac9af Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r7.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r70.laz b/resources/pointclouds/lion_takanawa_laz/data/r70.laz new file mode 100644 index 00000000..422dfdf1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r70.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r700.laz b/resources/pointclouds/lion_takanawa_laz/data/r700.laz new file mode 100644 index 00000000..867428d1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r700.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r701.laz b/resources/pointclouds/lion_takanawa_laz/data/r701.laz new file mode 100644 index 00000000..4370ddd9 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r701.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r702.laz b/resources/pointclouds/lion_takanawa_laz/data/r702.laz new file mode 100644 index 00000000..ba7351c1 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r702.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r703.laz b/resources/pointclouds/lion_takanawa_laz/data/r703.laz new file mode 100644 index 00000000..f544625c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r703.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r707.laz b/resources/pointclouds/lion_takanawa_laz/data/r707.laz new file mode 100644 index 00000000..4920927c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r707.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r71.laz b/resources/pointclouds/lion_takanawa_laz/data/r71.laz new file mode 100644 index 00000000..2bc7e964 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r71.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r710.laz b/resources/pointclouds/lion_takanawa_laz/data/r710.laz new file mode 100644 index 00000000..f60b2886 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r710.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r712.laz b/resources/pointclouds/lion_takanawa_laz/data/r712.laz new file mode 100644 index 00000000..48d008d7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r712.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r714.laz b/resources/pointclouds/lion_takanawa_laz/data/r714.laz new file mode 100644 index 00000000..b873b653 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r714.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r715.laz b/resources/pointclouds/lion_takanawa_laz/data/r715.laz new file mode 100644 index 00000000..dc511348 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r715.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r716.laz b/resources/pointclouds/lion_takanawa_laz/data/r716.laz new file mode 100644 index 00000000..cb62e5b7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r716.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r717.laz b/resources/pointclouds/lion_takanawa_laz/data/r717.laz new file mode 100644 index 00000000..23f0066d Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r717.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r72.laz b/resources/pointclouds/lion_takanawa_laz/data/r72.laz new file mode 100644 index 00000000..d3a88176 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r72.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r720.laz b/resources/pointclouds/lion_takanawa_laz/data/r720.laz new file mode 100644 index 00000000..0b083479 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r720.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r721.laz b/resources/pointclouds/lion_takanawa_laz/data/r721.laz new file mode 100644 index 00000000..feb73706 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r721.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r724.laz b/resources/pointclouds/lion_takanawa_laz/data/r724.laz new file mode 100644 index 00000000..5790c0ea Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r724.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r725.laz b/resources/pointclouds/lion_takanawa_laz/data/r725.laz new file mode 100644 index 00000000..7e8f70f0 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r725.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r73.laz b/resources/pointclouds/lion_takanawa_laz/data/r73.laz new file mode 100644 index 00000000..c36f210b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r73.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r734.laz b/resources/pointclouds/lion_takanawa_laz/data/r734.laz new file mode 100644 index 00000000..e82f9152 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r734.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r735.laz b/resources/pointclouds/lion_takanawa_laz/data/r735.laz new file mode 100644 index 00000000..4782e328 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r735.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r76.laz b/resources/pointclouds/lion_takanawa_laz/data/r76.laz new file mode 100644 index 00000000..ff2185aa Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r76.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r760.laz b/resources/pointclouds/lion_takanawa_laz/data/r760.laz new file mode 100644 index 00000000..9ccdba6b Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r760.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r761.laz b/resources/pointclouds/lion_takanawa_laz/data/r761.laz new file mode 100644 index 00000000..0d135eb2 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r761.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r762.laz b/resources/pointclouds/lion_takanawa_laz/data/r762.laz new file mode 100644 index 00000000..fc342c2f Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r762.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r763.laz b/resources/pointclouds/lion_takanawa_laz/data/r763.laz new file mode 100644 index 00000000..d5fa3e37 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r763.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r77.laz b/resources/pointclouds/lion_takanawa_laz/data/r77.laz new file mode 100644 index 00000000..3de4ebb7 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r77.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r770.laz b/resources/pointclouds/lion_takanawa_laz/data/r770.laz new file mode 100644 index 00000000..e4bca123 Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r770.laz differ diff --git a/resources/pointclouds/lion_takanawa_laz/data/r771.laz b/resources/pointclouds/lion_takanawa_laz/data/r771.laz new file mode 100644 index 00000000..f8e79b8c Binary files /dev/null and b/resources/pointclouds/lion_takanawa_laz/data/r771.laz differ diff --git a/src/PointCloudOctree.js b/src/PointCloudOctree.js index f8ce627c..43d8b6d8 100644 --- a/src/PointCloudOctree.js +++ b/src/PointCloudOctree.js @@ -12,6 +12,7 @@ Potree.PointCloudOctreeProxyNode = function(geometryNode){ this.geometryNode = geometryNode; this.boundingBox = geometryNode.boundingBox; + this.boundingSphere = this.boundingBox.getBoundingSphere(); this.name = geometryNode.name; this.level = geometryNode.level; this.numPoints = geometryNode.numPoints; @@ -19,25 +20,67 @@ Potree.PointCloudOctreeProxyNode = function(geometryNode){ Potree.PointCloudOctreeProxyNode.prototype = Object.create(THREE.Object3D.prototype); + + + + + + + +Potree.ProfileRequest = function(start, end, width, depth, callback){ + this.start = start; + this.end = end; + this.width = width; + this.depth = depth; + + //var up = start.clone(); + //up.y += 10; + //this.plane = new THREE.Plane().setFromCoplanarPoints(start, end, up); + this.callback = callback; + this.loadQueue = []; + + var center = new THREE.Vector3().addVectors(end, start).multiplyScalar(0.5); + var length = new THREE.Vector3().subVectors(end, start).length(); + var side = new THREE.Vector3().subVectors(end, start).normalize(); + var up = new THREE.Vector3(0, 1, 0); + var forward = new THREE.Vector3().crossVectors(side, up).normalize(); + var N = forward; + this.plane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); +}; + + + + + + + + Potree.PointCloudOctree = function(geometry, material){ THREE.Object3D.call( this ); Potree.PointCloudOctree.lru = Potree.PointCloudOctree.lru || new LRU(); this.pcoGeometry = geometry; - //this.boundingBox = this.pcoGeometry.boundingBox; this.boundingBox = this.pcoGeometry.root.boundingBox; - this.material = material; - this.maxVisibleNodes = 2000; - this.maxVisiblePoints = 20*1000*1000; + this.boundingSphere = this.boundingBox.getBoundingSphere(); + this.material = material || new Potree.PointCloudMaterial(); + this.visiblePointsTarget = 2*1000*1000; this.level = 0; + this.position.sub(geometry.offset); + this.updateMatrix(); this.LODDistance = 20; this.LODFalloff = 1.3; this.LOD = 4; this.showBoundingBox = false; this.loadQueue = []; - + this.visibleBounds = new THREE.Box3(); + this.profileRequests = []; + this.visibleNodes = []; + this.visibleGeometry = []; + this.pickTarget; + this.pickMaterial; + this.maxLevel = 0; var rootProxy = new Potree.PointCloudOctreeProxyNode(this.pcoGeometry.root); this.add(rootProxy); @@ -46,9 +89,202 @@ Potree.PointCloudOctree = function(geometry, material){ Potree.PointCloudOctree.prototype = Object.create(THREE.Object3D.prototype); Potree.PointCloudOctree.prototype.update = function(camera){ + this.updateMatrixWorld(true); + + this.visibleGeometry = this.getVisibleGeometry(camera); + var visibleGeometryNames = []; + + for(var i = 0; i < this.visibleGeometry.length; i++){ + visibleGeometryNames.push(this.visibleGeometry[i].node.name); + } + + for(var i = 0; i < this.profileRequests.length; i++){ + var profileRequest = this.profileRequests[i]; + profileRequest.loadQueue = []; + } + + this.loadQueue = []; + this.visibleNodes = []; this.numVisibleNodes = 0; this.numVisiblePoints = 0; - this.loadQueue = []; + + this.hideDescendants(this.children[0]); + + var stack = []; + stack.push({node: this.children[0], weight: 1}); //TODO don't do it like that + while(stack.length > 0){ + var element = stack.shift(); + var node = element.node; + var weight = element.weight; + + node.visible = true; + + if (node instanceof Potree.PointCloudOctreeProxyNode) { + var geometryNode = node.geometryNode; + if(geometryNode.loaded === true){ + this.replaceProxy(node); + }else{ + this.loadQueue.push(element); + } + }else if(node instanceof THREE.PointCloud){ + this.numVisibleNodes++; + this.numVisiblePoints += node.numPoints; + node.material = this.material; + this.visibleNodes.push(element); + + if(node.level){ + this.maxLevel = Math.max(node.level, this.maxLevel); + } + + //if(!node.boundingBoxNode){ + // var boxHelper = new THREE.BoxHelper(node); + // scene.add(boxHelper); + // node.boundingBoxNode = boxHelper; + //} + + for(var i = 0; i < node.children.length; i++){ + var child = node.children[i]; + var visible = visibleGeometryNames.indexOf(child.name) >= 0; + if(visible){ + for(var j = 0; j < this.visibleGeometry.length; j++){ + if(this.visibleGeometry[j].node.name === child.name){ + stack.push({node: child, weight: this.visibleGeometry[j].weight}); + } + }; + } + } + } + } + + this.material.octreeLevels = this.maxLevel; + + // check profile cut plane intersections + for(var i = 0; i < this.profileRequests.length; i++){ + var profileRequest = this.profileRequests[i]; + var plane = profileRequest.plane; + var start = profileRequest.start; + var end = profileRequest.end; + var depth = profileRequest.depth; + + var stack = []; + stack.push(this); + while(stack.length > 0){ + var object = stack.shift(); + + if(object instanceof Potree.PointCloudOctreeProxyNode){ + var box = Potree.utils.computeTransformedBoundingBox(object.boundingBox, object.matrixWorld); + + var sphere = box.getBoundingSphere(); + if(Math.abs(plane.distanceToPoint(sphere.center)) < sphere.radius){ + profileRequest.loadQueue.push(object); + } + } + + + if(object.level < depth){ + for(var i = 0; i < object.children.length; i++){ + var child = object.children[i]; + + if(child instanceof Potree.PointCloudOctreeProxyNode || child instanceof THREE.PointCloud){ + stack.push(object.children[i]); + } + } + } + } + + } + + var leafNodes = []; + for(var i = 0; i < this.visibleNodes.length; i++){ + var element = this.visibleNodes[i]; + var node = element.node; + var isLeaf = true; + + for(var j = 0; j < node.children.length; j++){ + var child = node.children[j]; + if(child instanceof THREE.PointCloud){ + isLeaf = isLeaf && !child.visible; + } + } + + if(isLeaf){ + leafNodes.push(node); + } + } + + this.visibleBounds.min = new THREE.Vector3( Infinity, Infinity, Infinity ); + this.visibleBounds.max = new THREE.Vector3( - Infinity, - Infinity, - Infinity ); + for(var i = 0; i < leafNodes.length; i++){ + var node = leafNodes[i]; + + this.visibleBounds.expandByPoint(node.boundingBox.min); + this.visibleBounds.expandByPoint(node.boundingBox.max); + //this.visibleBounds.intersect(node.boundingBox); + } + + // schedule nodes needed for a profile request + var finishedRequests = []; + for(var i = 0; i < this.profileRequests.length; i++){ + var request = this.profileRequests[i]; + + if(request.loadQueue.length > 0){ + var object = request.loadQueue[0]; + var geometryNode = object.geometryNode; + if(geometryNode.loaded === true && object.parent !== undefined){ + var node = this.replaceProxy(object); + node.updateMatrixWorld(); + node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + + //var boxHelper = new THREE.BoxHelper(node); + //scene.add(boxHelper); + }else{ + object.geometryNode.load(); + } + }else{ + var points = this.getProfile(request.start, request.end, request.width, request.depth); + + request.callback({type: "finished", points: points}); + finishedRequests.push(request); + } + } + + for(var i = 0; i < finishedRequests.length; i++){ + var index = this.profileRequests.indexOf(finishedRequests[i]); + if (index > -1) { + this.profileRequests.splice(index, 1); + } + } + + + + if(this.loadQueue.length > 0){ + if(this.loadQueue.length >= 2){ + this.loadQueue.sort(function(a,b){return b.weight - a.weight}); + } + + for(var i = 0; i < Math.min(5, this.loadQueue.length); i++){ + this.loadQueue[i].node.geometryNode.load(); + } + } + + this.hideDescendants(this.children[0]); + for(var i = 0; i < this.visibleNodes.length; i++){ + this.visibleNodes[i].node.visible = true + } + + if(this.material.pointSizeType){ + if(this.material.pointSizeType === Potree.PointSizeType.ADAPTIVE + || this.material.pointColorType === Potree.PointColorType.OCTREE_DEPTH){ + this.updateVisibilityTexture(); + } + } +}; + +Potree.PointCloudOctree.prototype.getVisibleGeometry = function(camera){ + + var visibleGeometry = []; + var geometry = this.pcoGeometry; + // create frustum in object space camera.updateMatrixWorld(); @@ -65,97 +301,208 @@ Potree.PointCloudOctree.prototype.update = function(camera){ var camMatrixObject = new THREE.Matrix4().multiply(worldI).multiply(view); var camObjPos = new THREE.Vector3().setFromMatrixPosition( camMatrixObject ); - var ray = new THREE.Ray(camera.position, new THREE.Vector3( 0, 0, -1 ).applyQuaternion( camera.quaternion ) ); + var sortWeightFunction = function(a, b){return b.weight - a.weight}; - // check visibility + var root = geometry.root; var stack = []; - stack.push(this); + var pointCount = 0; + + var sphere = root.boundingBox.getBoundingSphere(); + var distance = sphere.center.distanceTo(camObjPos); + //var weight = sphere.radius / distance; + var weight = 1 / Math.max(0.1, sphere.center.distanceTo(camObjPos) - sphere.radius); + stack.push({node: root, weight: weight}); + var nodesTested = 0; while(stack.length > 0){ - var object = stack.shift(); + nodesTested++; + var element = stack.shift(); + var node = element.node; - if(object instanceof THREE.Mesh || object instanceof THREE.Line ){ - object.visible = true; - continue; - } + var box = node.boundingBox; + var sphere = node.boundingSphere; + //var insideFrustum = frustum.intersectsSphere(sphere); + var insideFrustum = frustum.intersectsBox(box); + - var box = object.boundingBox; - var distance = box.center().distanceTo(camObjPos); - var radius = box.size().length() * 0.5; - - var visible = true; - visible = visible && frustum.intersectsBox(box); - if(object.level > 0){ - // cull detail nodes based in distance to camera - visible = visible && Math.pow(radius, 0.8) / distance > (1 / this.LOD); - visible = visible && (this.numVisiblePoints + object.numPoints < Potree.pointLoadLimit); - visible = visible && (this.numVisibleNodes <= this.maxVisibleNodes); - visible = visible && (this.numVisiblePoints <= this.maxVisiblePoints); - - } - - // trying to skip higher detail nodes, if parents already cover all holes - //if(this.pcoGeometry !== undefined && this.pcoGeometry.spacing !== undefined){ - // var spacing = this.pcoGeometry.spacing / Math.pow(2, object.level); - // spacing *= 10; - // if(spacing < this.material.size * 1.5){ - // visible = false; - // } - //} - - //if(object.level > 0){ - // visible = parseInt(object.name.charAt(object.name.length-1)) == 0; - //} - - object.visible = visible; + var visible = insideFrustum; // && node.level <= 1; + //visible = visible && "r2".indexOf(node.name) === 0; if(!visible){ - this.hideDescendants(object); continue; - }else if(visible && this.showBoundingBox && object instanceof THREE.PointCloud){ - if(object.boundingBoxNode === undefined && object.boundingBox !== undefined){ - var boxHelper = new THREE.BoxHelper(object); - object.add(boxHelper); - object.boundingBoxNode = boxHelper; - } - }else if(!this.showBoundingBox){ - if(object.boundingBoxNode !== undefined){ - object.remove(object.boundingBoxNode); - object.boundingBoxNode = undefined; - } } - if(object instanceof THREE.PointCloud){ - this.numVisibleNodes++; - this.numVisiblePoints += object.numPoints; - Potree.PointCloudOctree.lru.touch(object); - object.material = this.material; - }else if (object instanceof Potree.PointCloudOctreeProxyNode) { - var geometryNode = object.geometryNode; - if(geometryNode.loaded === true){ - this.replaceProxy(object); + if(pointCount + node.numPoints > this.visiblePointsTarget){ + break; + } + + pointCount += node.numPoints; + visibleGeometry.push(element); + + for(var i in node.children){ + var child = node.children[i]; + + var sphere = child.boundingSphere; + var distance = sphere.center.distanceTo(camObjPos); + var radius = sphere.radius; + var weight = sphere.radius / distance; + //var weight = (1 / Math.max(0.001, distance - radius)) * distance; + + // discarding nodes which are very small when projected onto the screen + // TODO: pr threshold was a value choosen by trial & error. Validate that this is fine. + // see http://stackoverflow.com/questions/21648630/radius-of-projected-sphere-in-screen-space + var fov = camera.fov / 2 * Math.PI / 180.0; + var pr = 1 / Math.tan(fov) * radius / Math.sqrt(distance * distance - radius * radius); + if(pr < 0.1){ + continue; + } + + weight = pr; + if(distance - radius < 0){ + weight = Number.MAX_VALUE; + } + + if(stack.length === 0){ + stack.push({node: child, weight: weight}); }else{ - this.loadQueue.push({node: object, lod: Math.pow(radius, 0.8) / distance}); + var ipos = 0; + + for(var j = 0; j < stack.length; j++){ + if(weight > stack[j].weight){ + var ipos = j; + break; + }else if(j == stack.length -1){ + ipos = stack.length; + break; + } + + + } + + //if(stack.length < 200){ + stack.splice(ipos, 0, {node: child, weight: weight}); + //} + + //console.log(ipos); } + + //stack.push({node: child, weight: weight}); + //} } - for(var i = 0; i < object.children.length; i++){ - stack.push(object.children[i]); - } - - //console.log(object.name); + //stack.sort(sortWeightFunction); + var a = 1; + } + //console.log(nodesTested); + + return visibleGeometry; +}; + +Potree.PointCloudOctree.prototype.updateVisibilityTexture = function(){ + + if(!this.material){ + return; } - if(this.loadQueue.length > 0){ - if(this.loadQueue.length >= 2){ - this.loadQueue.sort(function(a,b){return b.lod - a.lod}); + var texture = this.material.visibleNodesTexture; + var data = texture.image.data; + + var visibleNodes = []; + for(var i = 0; i < this.visibleNodes.length; i++){ + visibleNodes.push(this.visibleNodes[i].node); + } + + + // sort by level and index, e.g. r, r0, r3, r4, r01, r07, r30, ... + var sort = function(a, b){ + var na = a.name; + var nb = b.name; + if(na.length != nb.length) return na.length - nb.length; + if(na < nb) return -1; + if(na > nb) return 1; + return 0; + }; + visibleNodes.sort(sort); + + for(var i = 0; i < visibleNodes.length; i++){ + var node = visibleNodes[i]; + var children = []; + for(var j = 0; j < node.children.length; j++){ + var child = node.children[j]; + if(child instanceof THREE.PointCloud && child.visible){ + children.push(child); + } } + children.sort(function(a, b){ + if(a.name < b.name) return -1; + if(a.name > b.name) return 1; + return 0; + }); - for(var i = 0; i < Math.min(5, this.loadQueue.length); i++){ - this.loadQueue[i].node.geometryNode.load(); + data[i*3 + 0] = 0; + data[i*3 + 1] = 0; + data[i*3 + 2] = 0; + for(var j = 0; j < children.length; j++){ + var child = children[j]; + var index = parseInt(child.name.substr(-1)); + data[i*3 + 0] += Math.pow(2, index); + + if(j === 0){ + var vArrayIndex = visibleNodes.indexOf(child); + data[i*3 + 1] = vArrayIndex - i; + } + } } + + + this.material.uniforms.nodeSize.value = this.boundingBox.size().x; + texture.needsUpdate = true; } +Potree.PointCloudOctree.prototype.nodesOnRay = function(nodes, ray){ + var nodesOnRay = []; + + var _ray = ray.clone(); + for(var i = 0; i < nodes.length; i++){ + var node = nodes[i].node; + var inverseWorld = new THREE.Matrix4().getInverse(node.matrixWorld); + var sphere = node.boundingSphere.clone().applyMatrix4(node.matrixWorld); + + if(_ray.isIntersectionSphere(sphere)){ + nodesOnRay.push(nodes[i]); + //node.visible = true; + }else{ + //node.visible = false; + } + } + + return nodesOnRay; +}; + +Potree.PointCloudOctree.prototype.updateMatrixWorld = function( force ){ + //node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + + if ( this.matrixAutoUpdate === true ) this.updateMatrix(); + + if ( this.matrixWorldNeedsUpdate === true || force === true ) { + + if ( this.parent === undefined ) { + + this.matrixWorld.copy( this.matrix ); + + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + } + + this.matrixWorldNeedsUpdate = false; + + force = true; + + } +}; + Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ @@ -167,11 +514,14 @@ Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ node.level = proxy.level; node.numPoints = proxy.numPoints; node.boundingBox = geometry.boundingBox; + node.boundingSphere = node.boundingBox.getBoundingSphere(); node.pcoGeometry = geometryNode; var parent = proxy.parent; parent.remove(proxy); parent.add(node); + node.matrixWorld.multiplyMatrices( node.parent.matrixWorld, node.matrix ); + for(var i = 0; i < 8; i++){ if(geometryNode.children[i] !== undefined){ var child = geometryNode.children[i]; @@ -179,6 +529,8 @@ Potree.PointCloudOctree.prototype.replaceProxy = function(proxy){ node.add(childProxy); } } + + return node; } } @@ -207,7 +559,7 @@ Potree.PointCloudOctree.prototype.hideDescendants = function(object){ Potree.PointCloudOctree.prototype.moveToOrigin = function(){ this.position.set(0,0,0); - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -215,7 +567,7 @@ Potree.PointCloudOctree.prototype.moveToOrigin = function(){ } Potree.PointCloudOctree.prototype.moveToGroundPlane = function(){ - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -223,7 +575,7 @@ Potree.PointCloudOctree.prototype.moveToGroundPlane = function(){ } Potree.PointCloudOctree.prototype.getBoundingBoxWorld = function(){ - this.updateMatrixWorld(); + this.updateMatrixWorld(true); var box = this.boundingBox; var transform = this.matrixWorld; var tBox = Potree.utils.computeTransformedBoundingBox(box, transform); @@ -231,51 +583,67 @@ Potree.PointCloudOctree.prototype.getBoundingBoxWorld = function(){ return tBox; } -Potree.PointCloudOctree.prototype.getProfile = function(start, end, width, depth){ - var stack = []; - stack.push(this); - - var side = new THREE.Vector3().subVectors(end, start).normalize(); - var up = new THREE.Vector3(0, 1, 0); - var forward = new THREE.Vector3().crossVectors(side, up).normalize(); - var N = forward; - var cutPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); - - var inside = []; - - - while(stack.length > 0){ - var object = stack.shift(); +Potree.PointCloudOctree.prototype.getProfile = function(start, end, width, depth, callback){ + if(callback !== undefined){ + this.profileRequests.push(new Potree.ProfileRequest(start, end, width, depth, callback)); + }else{ + var stack = []; + stack.push(this); - console.log("traversing: " + object.name); + var center = new THREE.Vector3().addVectors(end, start).multiplyScalar(0.5); + var length = new THREE.Vector3().subVectors(end, start).length(); + var side = new THREE.Vector3().subVectors(end, start).normalize(); + var up = new THREE.Vector3(0, 1, 0); + var forward = new THREE.Vector3().crossVectors(side, up).normalize(); + var N = forward; + var cutPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(N, start); + var halfPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(side, center); - if(object instanceof THREE.PointCloud){ - var geometry = object.geometry; - var positions = geometry.attributes.position; - var p = positions.array; - var pointCount = positions.length / positions.itemSize; + var inside = []; + + + while(stack.length > 0){ + var object = stack.shift(); - for(var i = 0; i < pointCount; i++){ - var pos = new THREE.Vector3(p[3*i], p[3*i+1], p[3*i+2]); - pos.applyMatrix4(this.matrixWorld); - var distance = Math.abs(cutPlane.distanceToPoint(pos)); + + var pointsFound = 0; + + if(object instanceof THREE.PointCloud){ + var geometry = object.geometry; + var positions = geometry.attributes.position; + var p = positions.array; + var pointCount = positions.length / positions.itemSize; - if(distance < width/2){ - inside.push(pos); + for(var i = 0; i < pointCount; i++){ + var pos = new THREE.Vector3(p[3*i], p[3*i+1], p[3*i+2]); + pos.applyMatrix4(this.matrixWorld); + var distance = Math.abs(cutPlane.distanceToPoint(pos)); + var centerDistance = Math.abs(halfPlane.distanceToPoint(pos)); + + if(distance < width / 2 && centerDistance < length / 2){ + inside.push(pos); + pointsFound++; + } + } + } + + //console.log("traversing: " + object.name + ", #points found: " + pointsFound); + + if(object == this || object.level < depth){ + for(var i = 0; i < object.children.length; i++){ + var child = object.children[i]; + if(child instanceof THREE.PointCloud){ + var sphere = child.boundingSphere.clone().applyMatrix4(child.matrixWorld); + if(cutPlane.distanceToSphere(sphere) < sphere.radius){ + stack.push(child); + } + } } } } - if(object == this || object.level < depth){ - for(var i = 0; i < object.children.length; i++){ - stack.push(object.children[i]); - } - } + return inside; } - - console.log("points inside: " + inside.length); - - return inside; } /** @@ -332,4 +700,133 @@ Potree.PointCloudOctree.disposeNode = function(node){ "freed": freed, "numDeletedNodes": numDeletedNodes }; +} + +Potree.PointCloudOctree.prototype.getVisibleExtent = function(){ + return this.visibleBounds.applyMatrix4(this.matrixWorld); +}; + +var point = Potree.PointCloudOctree.prototype.pick = function(renderer, camera, ray, params){ + var params = params || {}; + var accuracy = params.accuracy || 0.5; + + var nodes = this.nodesOnRay(this.visibleNodes, ray); + + if(nodes.length === 0){ + return null; + } + + var width = Math.ceil(renderer.domElement.clientWidth * accuracy); + var height = Math.ceil(renderer.domElement.clientHeight * accuracy); + + if(!this.pickTarget){ + this.pickTarget = new THREE.WebGLRenderTarget( + 1, 1, + { minFilter: THREE.LinearFilter, + magFilter: THREE.NearestFilter, + format: THREE.RGBAFormat } + ); + } + + if(!this.pickMaterial){ + //this.pickMaterial = new Potree.PointCloudIndexMaterial({ size: 0.01, minSize: 3}); + this.pickMaterial = new Potree.PointCloudMaterial(); + this.pickMaterial.pointColorType = Potree.PointColorType.POINT_INDEX; + this.pickMaterial.pointSizeType = Potree.PointSizeType.FIXED; + this.pickMaterial.size = accuracy * 5; + } + + // TODO + // Right now point size for picking is fixed + // To work with adaptive size, the pick hierarchy texture must + // be updated to the hierarchy that is rendered during picking + + this.pickTarget.setSize(width, height); + + //this.pickMaterial.size = accuracy * (this.material.size || 0.01); + //this.pickMaterial.minSize = accuracy * (this.material.minSize || 1); + //this.pickMaterial.pointColorType = this.material.pointColorType; + //this.pickMaterial.pointSizeType = this.material.pointSizeType; + //this.pickMaterial.pointShape = this.material.pointShape; + + var _gl = renderer.context; + + var material = this.pickMaterial; + + renderer.setRenderTarget( this.pickTarget ); + + renderer.setDepthTest( material.depthTest ); + renderer.setDepthWrite( material.depthWrite ) + renderer.setBlending( THREE.NoBlending ); + + renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); + + for(var i = 0; i < nodes.length; i++){ + var object = nodes[i].node; + var geometry = object.geometry; + + if(!geometry.attributes.indices.buffer){ + continue; + } + + material.pcIndex = i; + + if(material.program){ + var program = material.program.program; + _gl.useProgram( program ); + //_gl.disable( _gl.BLEND ); + + var attributePointer = _gl.getAttribLocation(program, "indices"); + var attributeSize = 4; + _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.attributes.indices.buffer ); + //if(!bufferSubmitted){ + // _gl.bufferData( _gl.ARRAY_BUFFER, new Uint8Array(geometry.attributes.indices.array), _gl.STATIC_DRAW ); + // bufferSubmitted = true; + //} + _gl.enableVertexAttribArray( attributePointer ); + _gl.vertexAttribPointer( attributePointer, attributeSize, _gl.UNSIGNED_BYTE, true, 0, 0 ); + + _gl.uniform1f(material.program.uniforms.pcIndex, material.pcIndex); + } + + renderer.renderBufferDirect(camera, [], null, material, geometry, object); + } + + + //_gl.bindTexture( _gl.TEXTURE_2D, this.pickTarget.__webglTexture ); + //_gl.generateMipmap( _gl.TEXTURE_2D ); + //_gl.bindTexture( _gl.TEXTURE_2D, null ); + + + var ps = new THREE.Vector3().addVectors(camera.position, ray.direction).project(camera); + ps.addScalar(1).multiplyScalar(0.5); + + var buffer = new ArrayBuffer(4); + var pixels = new Uint8Array(buffer); + var ibuffer = new Uint32Array(buffer); + renderer.context.readPixels( + ps.x * width, ps.y * height, + 1, 1, + renderer.context.RGBA, renderer.context.UNSIGNED_BYTE, pixels); + var pcIndex = pixels[3]; + pixels[3] = 0; + var pIndex = ibuffer[0]; + + //console.log(pcIndex); + // + //return null; + + var pc = nodes[pcIndex].node; + var positionArray = pc.geometry.attributes.position.array; + var x = positionArray[3*pIndex+0]; + var y = positionArray[3*pIndex+1]; + var z = positionArray[3*pIndex+2]; + var position = new THREE.Vector3(x, y, z); + position.applyMatrix4(this.matrixWorld); + + if(pIndex === 0 && pcIndex === 0){ + return null; + } + + return {position: position}; } \ No newline at end of file diff --git a/src/PointCloudOctreeGeometry.js b/src/PointCloudOctreeGeometry.js index e84bac03..797483d7 100644 --- a/src/PointCloudOctreeGeometry.js +++ b/src/PointCloudOctreeGeometry.js @@ -19,6 +19,7 @@ Potree.PointCloudOctreeGeometryNode = function(name, pcoGeometry, boundingBox){ this.index = parseInt(name.charAt(name.length-1)); this.pcoGeometry = pcoGeometry; this.boundingBox = boundingBox; + this.boundingSphere = boundingBox.getBoundingSphere(); this.children = {}; this.numPoints = 0; this.level = null; @@ -142,11 +143,14 @@ Potree.PointCloudOctreeGeometryNode.prototype.load = function(){ var positions = new Float32Array(numPoints*3); var colors = new Float32Array(numPoints*3); + var indices = new ArrayBuffer(numPoints*4); var color = new THREE.Color(); var fView = new Float32Array(buffer); var uiView = new Uint8Array(buffer); + var iIndices = new Uint32Array(indices); + for(var i = 0; i < numPoints; i++){ positions[3*i+0] = fView[4*i+0] + node.pcoGeometry.offset.x; positions[3*i+1] = fView[4*i+1] + node.pcoGeometry.offset.y; @@ -156,10 +160,13 @@ Potree.PointCloudOctreeGeometryNode.prototype.load = function(){ colors[3*i+0] = color.r / 255; colors[3*i+1] = color.g / 255; colors[3*i+2] = color.b / 255; + + iIndices[i] = i; } geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3)); + geometry.addAttribute('indices', new THREE.BufferAttribute(indices, 1)); geometry.boundingBox = node.boundingBox; node.geometry = geometry; node.loaded = true; diff --git a/src/loader/POCLoader.js b/src/loader/POCLoader.js index acfae70d..d76d3400 100644 --- a/src/loader/POCLoader.js +++ b/src/loader/POCLoader.js @@ -17,76 +17,78 @@ function POCLoader(){ * @param url * @param loadingFinishedListener executed after loading the binary has been finished */ -POCLoader.load = function load(url, params) { - var parameters = params || {}; - var toOrigin = parameters.toOrigin || false; - +POCLoader.load = function load(url, callback) { try{ var pco = new Potree.PointCloudOctreeGeometry(); pco.url = url; var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.send(null); - if(xhr.status === 200 || xhr.status === 0){ - var fMno = JSON.parse(xhr.responseText); - if(Potree.utils.pathExists(fMno.octreeDir + "/r")){ - pco.octreeDir = fMno.octreeDir; - }else{ - pco.octreeDir = url + "/../" + fMno.octreeDir; - } - - pco.spacing = fMno.spacing; + xhr.open('GET', url, true); + + xhr.onreadystatechange = function(){ + if(xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)){ + var fMno = JSON.parse(xhr.responseText); + + // assume octreeDir is absolute if it starts with http + if(fMno.octreeDir.indexOf("http") === 0){ + pco.octreeDir = fMno.octreeDir; + }else{ + pco.octreeDir = url + "/../" + fMno.octreeDir; + } + + pco.spacing = fMno.spacing; - pco.pointAttributes = fMno.pointAttributes; - - var min = new THREE.Vector3(fMno.boundingBox.lx, fMno.boundingBox.ly, fMno.boundingBox.lz); - var max = new THREE.Vector3(fMno.boundingBox.ux, fMno.boundingBox.uy, fMno.boundingBox.uz); - var boundingBox = new THREE.Box3(min, max); - var offset = new THREE.Vector3(0,0,0); - - if(toOrigin){ + pco.pointAttributes = fMno.pointAttributes; + + var min = new THREE.Vector3(fMno.boundingBox.lx, fMno.boundingBox.ly, fMno.boundingBox.lz); + var max = new THREE.Vector3(fMno.boundingBox.ux, fMno.boundingBox.uy, fMno.boundingBox.uz); + var boundingBox = new THREE.Box3(min, max); + var offset = new THREE.Vector3(0,0,0); + offset.set(-min.x, -min.y, -min.z); boundingBox.min.add(offset); boundingBox.max.add(offset); - } - pco.boundingBox = boundingBox; - pco.offset = offset; - - var nodes = {}; - - { // load root - var name = "r"; - var root = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); - root.level = 0; - root.numPoints = fMno.hierarchy[0][1]; - pco.root = root; - pco.root.load(); - nodes[name] = root; - } - - // load remaining hierarchy - for( var i = 1; i < fMno.hierarchy.length; i++){ - var name = fMno.hierarchy[i][0]; - var numPoints = fMno.hierarchy[i][1]; - var index = parseInt(name.charAt(name.length-1)); - var parentName = name.substring(0, name.length-1); - var parentNode = nodes[parentName]; - var level = name.length-1; - var boundingBox = POCLoader.createChildAABB(parentNode.boundingBox, index); + pco.boundingBox = boundingBox; + pco.boundingSphere = boundingBox.getBoundingSphere(); + pco.offset = offset; - var node = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); - node.level = level; - node.numPoints = numPoints; - parentNode.addChild(node); - nodes[name] = node; + var nodes = {}; + + { // load root + var name = "r"; + + var root = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); + root.level = 0; + root.numPoints = fMno.hierarchy[0][1]; + pco.root = root; + pco.root.load(); + nodes[name] = root; + } + + // load remaining hierarchy + for( var i = 1; i < fMno.hierarchy.length; i++){ + var name = fMno.hierarchy[i][0]; + var numPoints = fMno.hierarchy[i][1]; + var index = parseInt(name.charAt(name.length-1)); + var parentName = name.substring(0, name.length-1); + var parentNode = nodes[parentName]; + var level = name.length-1; + var boundingBox = POCLoader.createChildAABB(parentNode.boundingBox, index); + + var node = new Potree.PointCloudOctreeGeometryNode(name, pco, boundingBox); + node.level = level; + node.numPoints = numPoints; + parentNode.addChild(node); + nodes[name] = node; + } + + pco.nodes = nodes; + + callback(pco); } - - pco.nodes = nodes; - } - return pco; + xhr.send(null); }catch(e){ console.log("loading failed: '" + url + "'"); console.log(e); diff --git a/src/materials/PointCloudClassificationMaterial.js b/src/materials/PointCloudClassificationMaterial.js deleted file mode 100644 index 3edace74..00000000 --- a/src/materials/PointCloudClassificationMaterial.js +++ /dev/null @@ -1,93 +0,0 @@ - -Potree.PointCloudClassificationMaterial = function(parameters){ - parameters = parameters || {}; - - var size = parameters.size || 1.0; - this.min = parameters.min || 0; - this.max = parameters.max || 1; - - var attributes = { - classification: { type: "f", value: [] } - }; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 1 } - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudClassificationMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudClassificationMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9 - }); -}; - -Potree.PointCloudClassificationMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudClassificationMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Potree.PointCloudClassificationMaterial.vs_points = [ - "attribute float classification; ", - "uniform float size; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " if(classification == 0.0){ ", - " vColor = vec3(0.5, 0.5, 0.5); ", - " }else if(classification == 1.0){ ", - " vColor = vec3(0.5, 0.5, 0.5); ", - " }else if(classification == 2.0){ ", - " vColor = vec3(1.0, 0.0, 0.0); ", - " }else if(classification == 3.0){ ", - " vColor = vec3(0.0, 1.0, 0.0); ", - " }else if(classification == 9.0){ ", - " vColor = vec3(0.0, 0.0, 1.0); ", - " }else{ ", - " vColor = vec3(0.0, 1.0, 0.0); ", - " } ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudClassificationMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/materials/PointCloudColorMaterial.js b/src/materials/PointCloudColorMaterial.js deleted file mode 100644 index d2941bb0..00000000 --- a/src/materials/PointCloudColorMaterial.js +++ /dev/null @@ -1,87 +0,0 @@ - -Potree.PointCloudColorMaterial = function(parameters){ - parameters = parameters || {}; - - var color = parameters.color || new THREE.Color().setRGB(1, 0, 0); - var size = parameters.size || 1.0; - - var attributes = {}; - var uniforms = { - uCol: { type: "c", value: color }, - size: { type: "f", value: 1 } - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudColorMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudColorMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9, - }); -}; - -Potree.PointCloudColorMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudColorMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Object.defineProperty(Potree.PointCloudColorMaterial.prototype, "color", { - get: function(){ - return this.uniforms.uCol.value; - }, - set: function(value){ - this.uniforms.uCol.value.copy(value); - } -}); - -Potree.PointCloudColorMaterial.vs_points = [ - "uniform float size; ", - "uniform vec3 uCol; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = uCol; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudColorMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/materials/PointCloudHeightMaterial.js b/src/materials/PointCloudHeightMaterial.js deleted file mode 100644 index 37270903..00000000 --- a/src/materials/PointCloudHeightMaterial.js +++ /dev/null @@ -1,133 +0,0 @@ - -Potree.PointCloudHeightMaterial = function(parameters){ - parameters = parameters || {}; - - var size = parameters.size || 1.0; - this.min = parameters.min || 0; - this.max = parameters.max || 1; - - var gradientTexture = Potree.PointCloudHeightMaterial.generateGradient(); - - var attributes = {}; - var uniforms = { - uCol: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 1 }, - uMin: { type: "f", value: this.min }, - uMax: { type: "f", value: this.max }, - gradient: {type: "t", value: gradientTexture} - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudHeightMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudHeightMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9, - }); -}; - - -Potree.PointCloudHeightMaterial.generateGradient = function() { - var size = 64; - - // create canvas - canvas = document.createElement( 'canvas' ); - canvas.width = size; - canvas.height = size; - - // get context - var context = canvas.getContext( '2d' ); - - // draw gradient - context.rect( 0, 0, size, size ); - var gradient = context.createLinearGradient( 0, 0, size, size ); - gradient.addColorStop(0, 'blue'); - gradient.addColorStop(1/5, 'aqua'); - gradient.addColorStop(2/5, 'green') - gradient.addColorStop(3/5, 'yellow'); - gradient.addColorStop(4/5, 'orange'); - gradient.addColorStop(1, 'red'); - - - context.fillStyle = gradient; - context.fill(); - - var texture = new THREE.Texture( canvas ); - texture.needsUpdate = true; - textureImage = texture.image; - - return texture; -} - -Potree.PointCloudHeightMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudHeightMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Potree.PointCloudHeightMaterial.prototype.setBoundingBox = function(boundingBox){ - this.min = boundingBox.min.y; - this.max = boundingBox.max.y; - - this.uniforms.uMin.value = this.min; - this.uniforms.uMax.value = this.max; -} - -Potree.PointCloudHeightMaterial.vs_points = [ - "uniform float size; ", - "uniform float uMin; ", - "uniform float uMax; ", - "uniform sampler2D gradient; ", - " ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " vec4 world = modelMatrix * vec4( position, 1.0 ); ", - " float w = (world.y - uMin) / (uMax-uMin); ", - " ", - " vec4 gCol = texture2D(gradient, vec2(w,1.0-w)); ", - " vColor = gCol.rgb; ", - " ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudHeightMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/materials/PointCloudIntensityMaterial.js b/src/materials/PointCloudIntensityMaterial.js deleted file mode 100644 index d140e646..00000000 --- a/src/materials/PointCloudIntensityMaterial.js +++ /dev/null @@ -1,86 +0,0 @@ - -Potree.PointCloudIntensityMaterial = function(parameters){ - parameters = parameters || {}; - - var size = parameters.size || 1.0; - this.min = parameters.min || 0; - this.max = parameters.max || 1; - - var attributes = { - intensity: { type: "f", value: [] } - }; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 1 }, - uMin: { type: "f", value: this.min }, - uMax: { type: "f", value: this.max } - }; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudIntensityMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudIntensityMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: size, - alphaTest: 0.9 - }); -}; - -Potree.PointCloudIntensityMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudIntensityMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Potree.PointCloudIntensityMaterial.vs_points = [ - "attribute float intensity; ", - "uniform float size; ", - "uniform float uMin; ", - "uniform float uMax; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = vec3(1.0, 1.0, 1.0) * (intensity -uMin) / uMax; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " //gl_PointSize = size * 1.0 / length( mvPosition.xyz ); ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudIntensityMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/materials/PointCloudMaterial.js b/src/materials/PointCloudMaterial.js new file mode 100644 index 00000000..26d045f5 --- /dev/null +++ b/src/materials/PointCloudMaterial.js @@ -0,0 +1,524 @@ + +Potree.PointSizeType = { + FIXED: 0, + ATTENUATED: 1, + ADAPTIVE: 2 +}; + +Potree.PointShape = { + SQUARE: 0, + CIRCLE: 1 +}; + +Potree.PointColorType = { + RGB: 0, + COLOR: 1, + DEPTH: 2, + HEIGHT: 3, + INTENSITY: 4, + INTENSITY_GRADIENT: 5, + OCTREE_DEPTH: 6, + POINT_INDEX: 7 +}; + +Potree.PointCloudMaterial = function(parameters){ + parameters = parameters || {}; + + var color = new THREE.Color( 0x000000 ); + var map = THREE.ImageUtils.generateDataTexture( 2048, 1, color ); + map.magFilter = THREE.NearestFilter; + this.visibleNodesTexture = map; + + var pointSize = parameters.size || 1.0; + var minSize = parameters.minSize || 1.0; + var nodeSize = 1.0; + + this._pointSizeType = Potree.PointSizeType.ATTENUATED; + this._pointShape = Potree.PointShape.SQUARE; + this._interpolate = false; + this._pointColorType = Potree.PointColorType.RGB; + this._octreeLevels = 6.0; + + this.gradientTexture = Potree.PointCloudMaterial.generateGradient(); + + var attributes = {}; + var uniforms = { + uColor: { type: "c", value: new THREE.Color( 0xff0000 ) }, + opacity: { type: "f", value: 1.0 }, + size: { type: "f", value: 10 }, + minSize: { type: "f", value: 2 }, + nodeSize: { type: "f", value: nodeSize }, + heightMin: { type: "f", value: 0.0 }, + heightMax: { type: "f", value: 1.0 }, + intensityMin: { type: "f", value: 0.0 }, + intensityMax: { type: "f", value: 1.0 }, + visibleNodes: { type: "t", value: this.visibleNodesTexture }, + pcIndex: { type: "f", value: 0 }, + gradient: {type: "t", value: this.gradientTexture}, + }; + + + + this.setValues({ + uniforms: uniforms, + attributes: attributes, + vertexShader: this.getDefines() + Potree.PointCloudMaterial.vs_points.join("\n"), + fragmentShader: this.getDefines() + Potree.PointCloudMaterial.fs_points_rgb.join("\n"), + vertexColors: THREE.VertexColors, + size: pointSize, + minSize: minSize, + nodeSize: nodeSize, + pcIndex: 0, + alphaTest: 0.9 + }); +}; + +Potree.PointCloudMaterial.prototype = new THREE.RawShaderMaterial(); + +Potree.PointCloudMaterial.prototype.updateShaderSource = function(){ + + var attributes = {}; + if(this.pointColorType === Potree.PointColorType.INTENSITY + || this.pointColorType === Potree.PointColorType.INTENSITY_GRADIENT){ + attributes.intensity = { type: "f", value: [] }; + } + + this.setValues({ + attributes: attributes, + vertexShader: this.getDefines() + Potree.PointCloudMaterial.vs_points.join("\n"), + fragmentShader: this.getDefines() + Potree.PointCloudMaterial.fs_points_rgb.join("\n") + }); + + if(this.opacity === 1.0){ + this.setValues({ + blending: THREE.NoBlending, + transparent: false, + depthTest: true, + depthWrite: true + }); + }else{ + this.setValues({ + blending: THREE.AdditiveBlending, + transparent: true, + depthTest: false, + depthWrite: true + }); + //this.setValues({ + // transparent: true + //}); + } + + this.needsUpdate = true; +}; + +Potree.PointCloudMaterial.prototype.getDefines = function(){ + + var defines = ""; + + if(this.pointSizeType === Potree.PointSizeType.FIXED){ + defines += "#define fixed_point_size\n"; + }else if(this.pointSizeType === Potree.PointSizeType.ATTENUATED){ + defines += "#define attenuated_point_size\n"; + }else if(this.pointSizeType === Potree.PointSizeType.ADAPTIVE){ + defines += "#define adaptive_point_size\n"; + defines += "#define octreeLevels " + Math.max(0, this._octreeLevels - 2).toFixed(1) + "\n"; + } + + if(this.pointShape === Potree.PointShape.SQUARE){ + defines += "#define square_point_shape\n"; + }else if(this.pointShape === Potree.PointShape.CIRCLE){ + defines += "#define circle_point_shape\n"; + } + + if(this._interpolate){ + defines += "#define use_interpolation\n"; + } + + if(this._pointColorType === Potree.PointColorType.RGB){ + defines += "#define color_type_rgb\n"; + }else if(this._pointColorType === Potree.PointColorType.COLOR){ + defines += "#define color_type_color\n"; + }else if(this._pointColorType === Potree.PointColorType.DEPTH){ + defines += "#define color_type_depth\n"; + }else if(this._pointColorType === Potree.PointColorType.HEIGHT){ + defines += "#define color_type_height\n"; + }else if(this._pointColorType === Potree.PointColorType.INTENSITY){ + defines += "#define color_type_intensity\n"; + }else if(this._pointColorType === Potree.PointColorType.INTENSITY_GRADIENT){ + defines += "#define color_type_intensity_gradient\n"; + }else if(this._pointColorType === Potree.PointColorType.OCTREE_DEPTH){ + defines += "#define color_type_octree_depth\n"; + }else if(this._pointColorType === Potree.PointColorType.POINT_INDEX){ + defines += "#define color_type_point_index\n"; + } + + return defines; +}; + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "opacity", { + get: function(){ + return this.uniforms.opacity.value; + }, + set: function(value){ + if(this.uniforms.opacity.value !== value){ + this.uniforms.opacity.value = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "octreeLevels", { + get: function(){ + return this._octreeLevels; + }, + set: function(value){ + if(this._octreeLevels !== value){ + this._octreeLevels = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointColorType", { + get: function(){ + return this._pointColorType; + }, + set: function(value){ + if(this._pointColorType !== value){ + this._pointColorType = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointSizeType", { + get: function(){ + return this._pointSizeType; + }, + set: function(value){ + if(this._pointSizeType !== value){ + this._pointSizeType = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "interpolate", { + get: function(){ + return this._interpolate; + }, + set: function(value){ + if(this._interpolate !== value){ + this._interpolate = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "color", { + get: function(){ + return this.uniforms.uColor.value; + }, + set: function(value){ + if(this.uniforms.uColor.value !== value){ + this.uniforms.uColor.value.copy(value); + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pointShape", { + get: function(){ + return this._pointShape; + }, + set: function(value){ + if(this._pointShape !== value){ + this._pointShape = value; + this.updateShaderSource(); + } + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "size", { + get: function(){ + return this.uniforms.size.value; + }, + set: function(value){ + this.uniforms.size.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "minSize", { + get: function(){ + return this.uniforms.minSize.value; + }, + set: function(value){ + this.uniforms.minSize.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "heightMin", { + get: function(){ + return this.uniforms.heightMin.value; + }, + set: function(value){ + this.uniforms.heightMin.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "heightMax", { + get: function(){ + return this.uniforms.heightMax.value; + }, + set: function(value){ + this.uniforms.heightMax.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "intensityMin", { + get: function(){ + return this.uniforms.intensityMin.value; + }, + set: function(value){ + this.uniforms.intensityMin.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "intensityMax", { + get: function(){ + return this.uniforms.intensityMax.value; + }, + set: function(value){ + this.uniforms.intensityMax.value = value; + } +}); + +Object.defineProperty(Potree.PointCloudMaterial.prototype, "pcIndex", { + get: function(){ + return this.uniforms.pcIndex.value; + }, + set: function(value){ + this.uniforms.pcIndex.value = value; + } +}); + +Potree.PointCloudMaterial.generateGradient = function() { + var size = 64; + + // create canvas + canvas = document.createElement( 'canvas' ); + canvas.width = size; + canvas.height = size; + + // get context + var context = canvas.getContext( '2d' ); + + // draw gradient + context.rect( 0, 0, size, size ); + var gradient = context.createLinearGradient( 0, 0, size, size ); + gradient.addColorStop(0, 'blue'); + gradient.addColorStop(1/5, 'aqua'); + gradient.addColorStop(2/5, 'green') + gradient.addColorStop(3/5, 'yellow'); + gradient.addColorStop(4/5, 'orange'); + gradient.addColorStop(1, 'red'); + + + context.fillStyle = gradient; + context.fill(); + + var texture = new THREE.Texture( canvas ); + texture.needsUpdate = true; + textureImage = texture.image; + + return texture; +} + +Potree.PointCloudMaterial.vs_points = [ + "precision highp float; ", + "precision highp int; ", + " ", + "attribute vec3 position; ", + "attribute vec3 color; ", + "attribute float intensity; ", + "attribute vec4 indices; ", + " ", + "uniform mat4 modelMatrix; ", + "uniform mat4 modelViewMatrix; ", + "uniform mat4 projectionMatrix; ", + "uniform mat4 viewMatrix; ", + "uniform mat3 normalMatrix; ", + "uniform vec3 cameraPosition; ", + " ", + "uniform float heightMin; ", + "uniform float heightMax; ", + "uniform float intensityMin; ", + "uniform float intensityMax; ", + "uniform float size; ", + "uniform float minSize; ", + "uniform float nodeSize; ", + "uniform vec3 uColor; ", + " ", + "uniform sampler2D visibleNodes; ", + "uniform sampler2D gradient; ", + " ", + " ", + "varying vec3 vColor; ", + " ", + " ", + "#if defined(adaptive_point_size) || defined(color_type_octree_depth) ", + "/** ", + " * number of 1-bits up to inclusive index position ", + " * number is treated as if it were an integer in the range 0-255 ", + " * ", + " */ ", + "float numberOfOnes(float number, float index){ ", + " float tmp = mod(number, pow(2.0, index + 1.0)); ", + " float numOnes = 0.0; ", + " for(float i = 0.0; i < 8.0; i++){ ", + " if(mod(tmp, 2.0) != 0.0){ ", + " numOnes++; ", + " } ", + " tmp = floor(tmp / 2.0); ", + " } ", + " return numOnes; ", + "} ", + " ", + " ", + "/** ", + " * checks whether the bit at index is 1 ", + " * number is treated as if it were an integer in the range 0-255 ", + " * ", + " */ ", + "bool isBitSet(float number, float index){ ", + " return mod(floor(number / pow(2.0, index)), 2.0) != 0.0; ", + "} ", + " ", + " ", + "/** ", + " * find the octree depth at the point position ", + " */ ", + "float getOctreeDepth(){ ", + " vec3 offset = vec3(0.0, 0.0, 0.0); ", + " float iOffset = 0.0; ", + " float depth = 0.0; ", + " for(float i = 0.0; i <= octreeLevels + 1.0; i++){ ", + " ", + " float nodeSizeAtLevel = nodeSize / pow(2.0, i); ", + " vec3 index3d = (position - offset) / nodeSizeAtLevel; ", + " index3d = floor(index3d + 0.5); ", + " float index = 4.0*index3d.x + 2.0*index3d.y + index3d.z; ", + " ", + " vec4 value = texture2D(visibleNodes, vec2(iOffset / 2048.0, 0.0)); ", + " float mask = value.r * 255.0; ", + " if(isBitSet(mask, index)){ ", + " // there are more visible child nodes at this position ", + " iOffset = iOffset + value.g * 255.0 + numberOfOnes(mask, index - 1.0); ", + " depth++; ", + " }else{ ", + " // no more visible child nodes at this position ", + " return depth; ", + " } ", + " offset = offset + (vec3(1.0, 1.0, 1.0) * nodeSizeAtLevel * 0.5) * index3d; ", + " } ", + " ", + " return depth; ", + "} ", + " ", + "#endif ", + " ", + " ", + " ", + "void main() { ", + " ", + " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", + " gl_Position = projectionMatrix * mvPosition; ", + " ", + " ", + " // COLOR TYPES ", + " ", + " #ifdef color_type_rgb ", + " vColor = color; ", + " #elif defined color_type_height ", + " vec4 world = modelMatrix * vec4( position, 1.0 ); ", + " float w = (world.y - heightMin) / (heightMax-heightMin); ", + " ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_depth ", + " vColor = vec3(1.0, 1.0, 1.0) * gl_Position.w * 0.0001; ", + " #elif defined color_type_intensity ", + " float w = (intensity - intensityMin) / intensityMax; ", + " vColor = vec3(w, w, w); ", + " //vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_intensity_gradient ", + " float w = (intensity - intensityMin) / intensityMax; ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_color ", + " vColor = uColor; ", + " #elif defined color_type_octree_depth ", + " float depth = getOctreeDepth(); ", + " float w = depth / 10.0; ", + " vColor = texture2D(gradient, vec2(w,1.0-w)).rgb; ", + " #elif defined color_type_point_index ", + " vColor = indices.rgb; ", + " #endif ", + " ", + " ", + " // ", + " // POINT SIZE TYPES ", + " // ", + " #if defined fixed_point_size ", + " gl_PointSize = size; ", + " #elif defined attenuated_point_size ", + " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", + " #elif defined adaptive_point_size ", + " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", + " gl_PointSize = gl_PointSize / pow(1.9, getOctreeDepth()); ", + " #endif ", + " ", + " gl_PointSize = max(minSize, gl_PointSize); ", + " gl_PointSize = min(30.0, gl_PointSize); ", + " ", + " ", + "} "]; + +Potree.PointCloudMaterial.fs_points_rgb = [ + "#if defined use_interpolation ", + " #extension GL_EXT_frag_depth : enable ", + "#endif ", + " ", + "precision highp float; ", + "precision highp int; ", + " ", + "uniform float opacity; ", + "uniform float pcIndex; ", + " ", + "varying vec3 vColor; ", + " ", + " ", + "void main() { ", + " ", + " #if defined(circle_point_shape) || defined(use_interpolation) ", + " float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", + " float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", + " float c = 1.0 - (a + b); ", + " ", + " if(c < 0.0){ ", + " discard; ", + " } ", + " #endif ", + " ", + " #if defined use_interpolation ", + " gl_FragDepthEXT = gl_FragCoord.z + 0.002*(1.0-pow(c, 1.0)) * gl_FragCoord.w; ", + " #endif ", + " ", + " ", + " #if defined color_type_point_index ", + " gl_FragColor = vec4(vColor, pcIndex / 255.0); ", + " #else ", + " gl_FragColor = vec4(vColor, opacity); ", + " #endif ", + " ", + " ", + "} "]; + diff --git a/src/materials/PointCloudRGBInterpolationMaterial.js b/src/materials/PointCloudRGBInterpolationMaterial.js deleted file mode 100644 index edac06c1..00000000 --- a/src/materials/PointCloudRGBInterpolationMaterial.js +++ /dev/null @@ -1,104 +0,0 @@ - -Potree.PointCloudRGBInterpolationMaterial = function(parameters){ - parameters = parameters || {}; - - var attributes = {}; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 10 }, - blendDepth: { type: "f", value: 0.01 } - }; - - var pointSize = parameters.size || 1.0; - - var vs; - var fs; - var frag_depth_ext = renderer.context.getExtension('EXT_frag_depth'); - if(!frag_depth_ext){ - vs = Potree.PointCloudRGBMaterial.vs_points.join("\n"); - fs = Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n"); - }else{ - vs = Potree.PointCloudRGBInterpolationMaterial.vs_points.join("\n"); - fs = Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb.join("\n"); - } - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: vs, - fragmentShader: fs, - vertexColors: THREE.VertexColors, - size: pointSize, - alphaTest: 0.9, - }); -}; - -Potree.PointCloudRGBInterpolationMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Object.defineProperty(Potree.PointCloudRGBInterpolationMaterial.prototype, "blendDepth", { - get: function(){ - return this.uniforms.blendDepth.value; - }, - set: function(value){ - this.uniforms.blendDepth.value = value; - } -}); - -Potree.PointCloudRGBInterpolationMaterial.vs_points = [ - " ", - " ", - " ", - "uniform float size; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = color; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb = [ - "#extension GL_EXT_frag_depth : enable ", - "varying vec3 vColor; ", - "uniform float blendDepth; ", - " ", - " ", - "void main() { ", - " ", - " float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " float c = 1.0 - (a + b); ", - " ", - " if(c < 0.0){ ", - " discard; ", - " } ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - " gl_FragDepthEXT = gl_FragCoord.z + blendDepth*(1.0-pow(c, 1.0)) * gl_FragCoord.w ; ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/materials/PointCloudRGBMaterial.js b/src/materials/PointCloudRGBMaterial.js deleted file mode 100644 index 42b02242..00000000 --- a/src/materials/PointCloudRGBMaterial.js +++ /dev/null @@ -1,76 +0,0 @@ - -Potree.PointCloudRGBMaterial = function(parameters){ - parameters = parameters || {}; - - var attributes = {}; - var uniforms = { - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - size: { type: "f", value: 10 } - }; - - var pointSize = parameters.size || 1.0; - - this.setValues({ - uniforms: uniforms, - attributes: attributes, - vertexShader: Potree.PointCloudRGBMaterial.vs_points.join("\n"), - fragmentShader: Potree.PointCloudRGBMaterial.fs_points_rgb.join("\n"), - vertexColors: THREE.VertexColors, - size: pointSize, - alphaTest: 0.9, - }); -}; - -Potree.PointCloudRGBMaterial.prototype = new THREE.ShaderMaterial(); - -Object.defineProperty(Potree.PointCloudRGBMaterial.prototype, "size", { - get: function(){ - return this.uniforms.size.value; - }, - set: function(value){ - this.uniforms.size.value = value; - } -}); - -Potree.PointCloudRGBMaterial.vs_points = [ - "uniform float size; ", - "varying vec3 vColor; ", - " ", - "void main() { ", - " vColor = color; ", - " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); ", - " ", - " gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) ); ", - " gl_PointSize = max(2.0, gl_PointSize); ", - " gl_Position = projectionMatrix * mvPosition; ", - "} "]; - -Potree.PointCloudRGBMaterial.fs_points_rgb = [ - "varying vec3 vColor; ", - " ", - "void main() { ", - " ", - " //float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0); ", - " //float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0); ", - " //float c = 1.0 - (a + b); ", - " // ", - " //if(c < 0.0){ ", - " // discard; ", - " //} ", - " ", - " gl_FragColor = vec4(vColor, 1.0); ", - "} "]; - - - - - - - - - - - - - - diff --git a/src/utils/MeasuringTool.js b/src/utils/MeasuringTool.js index 3a2987ad..5a545c0f 100644 --- a/src/utils/MeasuringTool.js +++ b/src/utils/MeasuringTool.js @@ -1,13 +1,15 @@ -Potree.MeasuringTool = function(scene, camera, domElement){ +Potree.MeasuringTool = function(scene, camera, renderer){ var scope = this; this.scene = scene; this.camera = camera; - this.domElement = domElement; + this.renderer = renderer; + this.domElement = renderer.domElement; this.mouse = {x: 0, y: 0}; + this.accuracy = 0.5; var STATE = { DEFAULT: 0, @@ -180,12 +182,10 @@ Potree.MeasuringTool = function(scene, camera, domElement){ function getMousePointCloudIntersection(){ var vector = new THREE.Vector3( scope.mouse.x, scope.mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); - - var raycaster = new THREE.Raycaster(); - raycaster.params = {"PointCloud" : {threshold: 1}}; - raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); + vector.unproject(scope.camera); + + var direction = vector.sub(scope.camera.position).normalize(); + var ray = new THREE.Ray(scope.camera.position, direction); var pointClouds = []; scope.scene.traverse(function(object){ @@ -194,15 +194,26 @@ Potree.MeasuringTool = function(scene, camera, domElement){ } }); - var intersects = raycaster.intersectObjects(pointClouds, true); + var closestPoint = null; + var closestPointDistance = null; - if(intersects.length > 0){ - var I = intersects[0]; + for(var i = 0; i < pointClouds.length; i++){ + var pointcloud = pointClouds[i]; + var point = pointcloud.pick(scope.renderer, scope.camera, ray, {accuracy: scope.accuracy}); - return I.point; - }else{ - return undefined; + if(!point){ + continue; + } + + var distance = scope.camera.position.distanceTo(point.position); + + if(!closestPoint || distance < closestPointDistance){ + closestPoint = point; + closestPointDistance = distance; + } } + + return closestPoint ? closestPoint.position : null; } this.domElement.addEventListener("dblclick", onDoubleClick, false); diff --git a/src/utils/ProfileTool.js b/src/utils/ProfileTool.js index 0af56fbc..7bed9692 100644 --- a/src/utils/ProfileTool.js +++ b/src/utils/ProfileTool.js @@ -21,6 +21,14 @@ Potree.ProfileTool = function(width, height, depth){ this.hudElement = new THREE.Mesh(this.hudGeometry, this.hudMaterial); this.hudElement.scale.set(1,1,1); this.hudElement.position.set(0, 0, 0); + + //var lblMax = new Potree.TextSprite("max"); + //lblMax.scale.multiplyScalar(0.05); + //this.hudElement.add(lblMax); + + var start = new THREE.Vector3(0,0,0); + var end = new THREE.Vector3(10,0,0); + this.setCoordinates(start, end); } Potree.ProfileTool.prototype = Object.create( THREE.Object3D.prototype ); @@ -48,6 +56,21 @@ Potree.ProfileTool.prototype.setOrientation = function(forward, side){ this.camera.lookAt(oldPosition); } +Potree.ProfileTool.prototype.setCoordinates = function(start, end){ + var width = start.distanceTo(end); + this.setDimension(width, this.height, this.depth); + + var center = new THREE.Vector3().addVectors(start, end).multiplyScalar(0.5); + var diff = new THREE.Vector3().subVectors(end, start); + var target = new THREE.Vector3(diff.z, 0, -diff.x); + this.position.set(0,0,0); + this.lookAt(target); + this.position.copy(center); + + this.start = start; + this.end = end; +} + Potree.ProfileTool.prototype.render = function(renderer, scene){ this.camera.matrixWorld.copy(this.matrixWorld); @@ -68,12 +91,6 @@ Potree.ProfileTool.prototype.render = function(renderer, scene){ object.material.size = object.material.oldSize; } }); - - //this.hudElement.scale.x = 0.5; - //this.hudElement.scale.y = 0.5 * (renderer.domElement.clientWidth / renderer.domElement.clientHeight) * (this.height / this.width); - //this.hudElement.position.x = 0.7; - //this.hudElement.position.y = -0.7; - } diff --git a/src/utils/TranslationTool.js b/src/utils/TranslationTool.js index 171dfc12..29aee479 100644 --- a/src/utils/TranslationTool.js +++ b/src/utils/TranslationTool.js @@ -114,8 +114,7 @@ Potree.TranslationTool = function(camera) { this.getHoveredObject = function(mouse){ var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); - var projector = new THREE.Projector(); - projector.unprojectVector( vector, scope.camera ); + vector.unproject(scope.camera); var raycaster = new THREE.Raycaster(); raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); @@ -148,9 +147,7 @@ Potree.TranslationTool = function(camera) { var directionDistance = new THREE.Vector3().subVectors(mousePoint, origin).dot(direction); var pointOnLine = direction.clone().multiplyScalar(directionDistance).add(origin); - - var projector = new THREE.Projector(); - projector.unprojectVector(pointOnLine, scope.camera); + pointOnLine.unproject(scope.camera); var diff = pointOnLine.clone().sub(scope.position); scope.position.copy(pointOnLine); @@ -186,11 +183,8 @@ Potree.TranslationTool = function(camera) { lineEnd.z -= 2; } - //lineEnd = scope.position.clone(); - - var projector = new THREE.Projector(); - projector.projectVector( lineStart, scope.camera ); - projector.projectVector( lineEnd, scope.camera ); + lineStart.project(scope.camera); + lineEnd.project(scope.camera); scope.start = { mouse: event.normalizedPosition,