language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/TorusKnotGeometry.tests.js
@@ -0,0 +1,110 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + TorusKnotGeometry, + TorusKnotBufferGeometry +} from '../../../../src/geometries/TorusKnotGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'SphereGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + tube: 20, + tubularSegments: 30, + radialSegments: 10, + p: 3, + q: 2 + }; + + geometries = [ + new TorusKnotGeometry(), + new TorusKnotGeometry( parameters.radius ), + new TorusKnotGeometry( parameters.radius, parameters.tube ), + new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ), + new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ), + new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'TorusKnotBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + tube: 20, + tubularSegments: 30, + radialSegments: 10, + p: 3, + q: 2 + }; + + geometries = [ + new TorusKnotBufferGeometry(), + new TorusKnotBufferGeometry( parameters.radius ), + new TorusKnotBufferGeometry( parameters.radius, parameters.tube ), + new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ), + new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ), + new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/TubeGeometry.tests.js
@@ -0,0 +1,85 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + TubeGeometry, + TubeBufferGeometry +} from '../../../../src/geometries/TubeGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'TubeGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new TubeGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'TubeBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new TubeBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/WireframeGeometry.tests.js
@@ -0,0 +1,46 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { WireframeGeometry } from '../../../../src/geometries/WireframeGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'WireframeGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new WireframeGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/README.MD
@@ -0,0 +1,40 @@ +# THREEJS Benchmark Suite + +### Example: Adding a New Suite + +For adding a new Tests we need two things + - Adding the Test File + - Linking it on the benchmark.html page + +Some example could be like this +```javascript +(function() { + // We want to make sure THREE.JS is loaded for this Benchmark + var THREE + if (Bench.isTHREELoaded()) { + THREE = Bench.THREE; + } else { + Bench.warning("Test Example Benchmark not loaded because THREEJS was not loaded"); + return; + } + + var s = Bench.newSuite("Example Benchmark Distance Calculation"); + + var v2a = new THREE.Vector2(3.0, 3.0); + var v2b = new THREE.Vector2(9.0, -3.0); + + var v3a = new THREE.Vector3(3.0, 3.0, 0.0); + var v3b = new THREE.Vector3(9.0, -3.0, 0.0); + + s.add("Vector3", function() { + v3a.distanceTo(v3b); + }) + + s.add("Vector2", function() { + v2a.distanceTo(v2b); + + }) +})(); +``` + +Remember that THREEJS library is only accesible via `Bench.THREE`
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/benchmark.js
@@ -0,0 +1,79 @@ +var BenchClass = function() { + this.suites = []; + this.THREE = window.THREE ; + window.THREE = undefined; + Benchmark.options.maxTime = 1.0; + return this; +} + +BenchClass.prototype.isTHREELoaded = function() { + return _.isObject(this.THREE); +} + +BenchClass.prototype.newSuite = function(name) { + var s = new Benchmark.Suite(name); + this.suites.push(s); + return s; +} + +BenchClass.prototype.display = function() { + for (x of this.suites) { + var s = new SuiteUI(x); + s.render(); + } +} + +BenchClass.prototype.warning = function(message) { + console.error(message); +} + +var SuiteUI = function(suite) { + this.suite = suite; + this.isRunning = false; + return this; +} + +SuiteUI.prototype.render = function() { + var n = document.importNode(this.suiteTemplate, true); + this.elem = n.querySelector("article"); + this.results = n.querySelector(".results"); + this.title = n.querySelector("h2"); + this.runButton = n.querySelector("h3"); + + this.title.innerText = this.suite.name; + this.runButton.onclick = this.run.bind(this); + + this.section.appendChild(n); +} + +SuiteUI.prototype.run = function() { + this.runButton.click = _.noop; + this.runButton.innerText = "Running..." + this.suite.on("complete", this.complete.bind(this)); + this.suite.run({ + async: true + }); +} + +SuiteUI.prototype.complete = function() { + this.runButton.style.display = "none"; + this.results.style.display = "block"; + var f = _.orderBy(this.suite, ["hz"], ["desc"]); + for (var i = 0; i < f.length; i++) { + var x = f[i]; + var n = document.importNode(this.suiteTestTemplate, true); + n.querySelector(".name").innerText = x.name; + n.querySelector(".ops").innerText = x.hz.toFixed(); + n.querySelector(".desv").innerText = x.stats.rme.toFixed(2); + this.results.appendChild(n); + } +} + +var Bench = new BenchClass(); +window.addEventListener('load', function() { + SuiteUI.prototype.suiteTemplate = document.querySelector("#suite").content; + SuiteUI.prototype.suiteTestTemplate = document.querySelector("#suite-test").content; + SuiteUI.prototype.section = document.querySelector("section"); + + Bench.display(); +})
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/benchmarks.html
@@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>ThreeJS Benchmark Tests - Using Files in /src</title> + <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:700" rel="stylesheet" type="text/css"> + <link href="normalize.css" rel="stylesheet" type="text/css"> + <link href="style.css" rel="stylesheet" type="text/css"> + <script src="../../build/three.min.js"></script> + <script src="vendor/lodash.min.js"></script> + <script src="vendor/benchmark-2.1.0.min.js"></script> + <script src="benchmark.js"></script> + + <script src="core/Vector3Components.js"></script> + <script src="core/Vector3Storage.js"></script> + <script src="core/Vector3Length.js"></script> + <script src="core/Float32Array.js"></script> +</head> +<body> + <header> + <h1>Three JS Benchmarks Suite</h1> + </header> + <section> + </section> + + <template id="suite"> + <article> + <header> + <h2></h2> + <h3>Start</h3> + </header> + <div class="results"> + <div class"head"> + <p class="name">Name</p> + <p class="ops">Ops / Sec</p> + <p class="desv">±</p> + </div> + </div> + </article> + </template> + + <template id="suite-test"> + <div> + <p class="name"></p> + <p class="ops"></p> + <p class="desv"></p> + </div> + </template> + +</body> +</html>
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/core/Float32Array.js
@@ -0,0 +1,82 @@ +(function() { + + var input = new Float32Array(10000 * 3); + var output = new Float32Array(10000 * 3); + + for (var j = 0, jl = input.length; j < jl; j++) { + input[j] = j; + } + + var inputVectors = []; + var outputVectors = []; + + for (var j = 0, jl = input.length / 3; j < jl; j++) { + inputVectors.push(new THREE.Vector3(j * 3, j * 3 + 1, j * 3 + 2)); + outputVectors.push(new THREE.Vector3()); + } + + var s = Bench.newSuite("Float 32 Arrays"); + + s.add('Float32Array-Float32Array', function() { + var value3 = new Float32Array(3); + for (var i = 0, il = input.length / 3; i < il; i += 3) { + value3[0] = input[i + 0]; + value3[1] = input[i + 1]; + value3[2] = input[i + 2]; + value3[0] *= 1.01; + value3[1] *= 1.03; + value3[2] *= 0.98; + output[i + 0] = value3[0]; + output[i + 1] = value3[1]; + output[i + 2] = value3[2]; + } + }); + + s.add('Float32Array-Array', function() { + var value2 = [0, 0, 0]; + for (var i = 0, il = input.length / 3; i < il; i += 3) { + value2[0] = input[i + 0]; + value2[1] = input[i + 1]; + value2[2] = input[i + 2]; + value2[0] *= 1.01; + value2[1] *= 1.03; + value2[2] *= 0.98; + output[i + 0] = value2[0]; + output[i + 1] = value2[1]; + output[i + 2] = value2[2]; + } + }); + + s.add('Float32Array-Literal', function() { + var x, + y, + z; + for (var i = 0, il = input.length / 3; i < il; i += 3) { + x = input[i + 0]; + y = input[i + 1]; + z = input[i + 2]; + x *= 1.01; + y *= 1.03; + z *= 0.98; + output[i + 0] = x; + output[i + 1] = y; + output[i + 2] = z; + } + }); + + s.add('Float32Array-Vector3', function() { + var value = new THREE.Vector3(); + for (var i = 0, il = input.length / 3; i < il; i += 3) { + value.x = input[i + 0]; + value.y = input[i + 1]; + value.z = input[i + 2]; + value.x *= 1.01; + value.y *= 1.03; + value.z *= 0.98; + output[i + 0] = value.x; + output[i + 1] = value.y; + output[i + 2] = value.z; + } + }); + +})();
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/core/Vector3Components.js
@@ -0,0 +1,110 @@ +(function() { + + var s = Bench.newSuite("Vector 3 Components"); + + THREE = {}; + + THREE.Vector3 = function(x, y, z) { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + }; + + THREE.Vector3.prototype = { + constructor: THREE.Vector3, + setComponent: function(index, value) { + this[THREE.Vector3.__indexToName[index]] = value; + }, + + getComponent: function(index) { + return this[THREE.Vector3.__indexToName[index]]; + }, + + setComponent2: function(index, value) { + switch (index) { + case 0: + this.x = value; + break; + case 1: + this.y = value; + break; + case 2: + this.z = value; + break; + default: + throw new Error("index is out of range: " + index); + } + }, + + getComponent2: function(index) { + switch (index) { + case 0: + return this.x; + case 1: + return this.y; + case 2: + return this.z; + default: + throw new Error("index is out of range: " + index); + } + }, + + + getComponent3: function(index) { + if (index === 0) return this.x; + if (index === 1) return this.y; + if (index === 2) return this.z; + throw new Error("index is out of range: " + index); + }, + + getComponent4: function(index) { + if (index === 0) return this.x;else if (index === 1) return this.y;else if (index === 2) return this.z; + else + throw new Error("index is out of range: " + index); + } + }; + + + THREE.Vector3.__indexToName = { + 0: 'x', + 1: 'y', + 2: 'z' + }; + + var a = []; + for (var i = 0; i < 100000; i++) { + a[i] = new THREE.Vector3(i * 0.01, i * 2, i * -1.3); + } + + + + + s.add('IndexToName', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].getComponent(i % 3); + } + }); + + s.add('SwitchStatement', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].getComponent2(i % 3); + } + }); + + s.add('IfAndReturnSeries', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].getComponent3(i % 3); + } + }); + + s.add('IfReturnElseSeries', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].getComponent4(i % 3); + } + }); + +})();
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/core/Vector3Length.js
@@ -0,0 +1,59 @@ +(function() { + + var THREE = {}; + + THREE.Vector3 = function(x, y, z) { + + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + + }; + + THREE.Vector3.prototype = { + constructor: THREE.Vector3, + lengthSq: function() { + return this.x * this.x + this.y * this.y + this.z * this.z; + }, + + length: function() { + return Math.sqrt(this.lengthSq()); + }, + + length2: function() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + + }; + + var a = []; + for (var i = 0; i < 100000; i++) { + a[i] = new THREE.Vector3(i * 0.01, i * 2, i * -1.3); + } + + + var suite = Bench.newSuite("Vector 3 Length"); + + suite.add('NoCallTest', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + var v = a[i]; + result += Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); + } + }); + + suite.add('InlineCallTest', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].length2(); + } + }); + + suite.add('FunctionCallTest', function() { + var result = 0; + for (var i = 0; i < 100000; i++) { + result += a[i].length(); + } + }); + +})();
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/core/Vector3Storage.js
@@ -0,0 +1,113 @@ +(function() { + + THREE = {}; + + THREE.Vector3 = function(x, y, z) { + + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + + }; + + THREE.Vector3.prototype = { + + constructor: THREE.Vector3, + + length: function() { + + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + + } + + }; + + THREE.Vector3X = function(x, y, z) { + + var elements = this.elements = new Float32Array(3); + elements[0] = x || 0; + elements[1] = y || 1; + elements[2] = z || 2; + + }; + + THREE.Vector3X.prototype = { + + constructor: THREE.Vector3X, + + length: function() { + + return Math.sqrt(this.elements[0] * this.elements[0] + this.elements[1] * this.elements[1] + this.elements[2] * this.elements[2]); + + } + + }; + + + THREE.Vector3Y = function(x, y, z) { + + this.elements = [x || 0, y || 1, z || 2]; + + }; + + THREE.Vector3Y.prototype = { + + constructor: THREE.Vector3Y, + + length: function() { + + return Math.sqrt(this.elements[0] * this.elements[0] + this.elements[1] * this.elements[1] + this.elements[2] * this.elements[2]); + + } + + }; + + + var suite = Bench.newSuite("Vector 3 Storage"); + + suite.add('Vector3-Set', function() { + + var array = []; + for (var i = 0; i < 100000; i++) { + var v = new THREE.Vector3(i, i, i); + array.push(v); + } + + var result = 0; + for (var i = 0; i < 100000; i++) { + var v = array[i]; + result += v.length(); + } + }); + + suite.add('Vector3-Float32Array', function() { + + var array = []; + for (var i = 0; i < 100000; i++) { + var v = new THREE.Vector3X(i, i, i); + array.push(v); + } + + var result = 0; + for (var i = 0; i < 100000; i++) { + var v = array[i]; + result += v.length(); + } + }); + + suite.add('Vector3-Array', function() { + + var array = []; + for (var i = 0; i < 100000; i++) { + var v = new THREE.Vector3Y(i, i, i); + array.push(v); + } + + var result = 0; + for (var i = 0; i < 100000; i++) { + var v = array[i]; + result += v.length(); + } + }); + +})();
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/normalize.css
@@ -0,0 +1,419 @@ +/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */ + +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Prevent adjustments of font size after orientation changes in IE and iOS. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + * 2. Add the correct display in IE. + */ + +article, +aside, +details, /* 1 */ +figcaption, +figure, +footer, +header, +main, /* 2 */ +menu, +nav, +section, +summary { /* 1 */ + display: block; +} + +/** + * Add the correct display in IE 9-. + */ + +audio, +canvas, +progress, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Add the correct display in IE 10-. + * 1. Add the correct display in IE. + */ + +template, /* 1 */ +[hidden] { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; /* 1 */ + -webkit-text-decoration-skip: objects; /* 2 */ +} + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ + +a:active, +a:hover { + outline-width: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, +strong { + font-weight: inherit; +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * Add the correct font style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change font properties to `inherit` in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +select, +textarea { + font: inherit; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Restore the font weight unset by the previous rule. + */ + +optgroup { + font-weight: bold; +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { + -webkit-appearance: button; /* 2 */ +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Remove the default vertical scrollbar in IE. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding and cancel buttons in Chrome and Safari on OS X. + */ + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Correct the text style of placeholders in Chrome, Edge, and Safari. + */ + +::-webkit-input-placeholder { + color: inherit; + opacity: 0.54; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +}
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/style.css
@@ -0,0 +1,96 @@ +html{ + background-color: #FFE0F7; +} + +body{ + font-family: 'Source Sans Pro', sans-serif; +} + +header{ + +} +header h1{ + color: #6F0752; + border-bottom: 4px solid #A23183; + margin: 10px; +} + +article{ + border: 2px solid #B8509B; + margin:5px 10px; + border-radius:10px; +} + +article header{ + + display: flex; +} + +article h2{ + color:#6F0752; + font-size:1.2em; + margin:10px; + flex-grow:1; +} + +article h3{ + color:#6F0752; + font-size:1.0em; + margin:7px; + text-align:right; + flex-grow:0; + background:transparent; + border: 1px solid #B8509B; + border-radius:3px; + padding:3px 7px; + cursor:pointer; +} + +article h3:hover{ + color:#6F0752; + font-size:1.0em; + margin:7px; + text-align:right; + flex-grow:0; + background:transparent; + border: 1px solid #B8509B; + border-radius:3px; + padding:3px 7px; +} + +article .results{ + margin:0 10px 10px; + display:none; +} +article .results > div{ + display: flex; +} +article .results > div p{ + color:#6F0752; + flex-grow: 1; + margin: 0 3px; + font-size:0.8em; +} + +.results > div:nth-child(1){ + margin-bottom: 3px; + border-bottom: 1px solid #A23183; +} + +.results > div:nth-child(2){ + background: #6F0752; +} + +.results > div:nth-child(2) p{ + color: #FFE0F7; +} + +.results .name{ + flex-basis:60%; +} +.results .time{ + flex-basis:20%; +} +.results .desv{ + flex-basis:20%; +}
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/vendor/benchmark-2.1.0.min.js
@@ -0,0 +1 @@ +(function(){"use strict";function e(t){function s(e,n,t){var r=this;return r instanceof s?(Y.isPlainObject(e)?t=e:Y.isFunction(e)?(t=n,n=e):Y.isPlainObject(n)?(t=n,n=null,r.name=e):r.name=e,_(r,t),r.id||(r.id=++c),null==r.fn&&(r.fn=n),r.stats=ke(r.stats),void(r.times=ke(r.times))):new s(e,n,t)}function a(e){var n=this;return n instanceof a?(n.benchmark=e,void Q(n)):new a(e)}function l(e){var n=this;return e instanceof l?e:n instanceof l?Y.assign(n,{timeStamp:Y.now()},"string"==typeof e?{type:e}:e):new l(e)}function y(e,n){var t=this;return t instanceof y?(Y.isPlainObject(e)?n=e:t.name=e,void _(t,n)):new y(e,n)}function v(){return v=function(e,n){var t,r=o?o.amd:s,i=$e+"createFunction";return k((o?"define.amd.":"Benchmark.")+i+"=function("+e+"){"+n+"}"),t=r[i],delete r[i],t},v=Ce.browser&&(v("",'return"'+$e+'"')||Y.noop)()==$e?v:ne,v.apply(null,arguments)}function b(e,n){e._timerId=Y.delay(n,1e3*e.delay)}function w(e){Se.appendChild(e),Se.innerHTML=""}function T(e){return!Y.has(e,"toString")&&(/^[\s(]*function[^(]*\(([^\s,)]+)/.exec(e)||0)[1]||""}function S(e){return Y.reduce(e,function(e,n){return e+n})/e.length||0}function $(e){var n="";return C(e)?n=oe(e):Ce.decompilation&&(n=Y.result(/^[^{]+\{([\s\S]*)\}\s*$/.exec(e),1)),n=(n||"").replace(/^\s+|\s+$/g,""),/^(?:\/\*+[\w\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(n)?"":n}function x(e,n){if(null==e)return!1;var t=typeof e[n];return!(f.test(t)||"object"==t&&!e[n])}function C(e){return Y.isString(e)||Y.has(e,"toString")&&Y.isFunction(e.toString)}function j(e){try{var n=i&&u(e)}catch(t){}return n||null}function k(e){var n=o?define.amd:s,t=be.createElement("script"),r=be.getElementsByTagName("script")[0],i=r.parentNode,a=$e+"runScript",u="("+(o?"define.amd.":"Benchmark.")+a+"||function(){})();";try{t.appendChild(be.createTextNode(u+e)),n[a]=function(){w(t)}}catch(c){i=i.cloneNode(!1),r=null,t.text=e}i.insertBefore(t,r),delete n[a]}function _(e,n){n=e.options=Y.assign({},ke(e.constructor.options),ke(n)),Y.forOwn(n,function(n,t){null!=n&&(/^on[A-Z]/.test(t)?Y.each(t.split(" "),function(t){e.on(t.slice(2).toLowerCase(),n)}):Y.has(e,t)||(e[t]=ke(n)))})}function O(){var e=this,n=e.benchmark,r=n._original;r.aborted?(e.teardown(),n.running=!1,V(e)):++e.cycles<n.count?n.compiled.call(e,t,je):(je.stop(e),e.teardown(),b(n,function(){V(e)}))}function A(e,n){if("successful"===n)n=function(e){return e.cycles&&Y.isFinite(e.hz)&&!e.error};else if("fastest"===n||"slowest"===n){var t=A(e,"successful").sort(function(e,t){return e=e.stats,t=t.stats,(e.mean+e.moe>t.mean+t.moe?1:-1)*("fastest"===n?1:-1)});return Y.filter(t,function(e){return 0==t[0].compare(e)})}return Y.filter(e,n)}function E(e){return e=oe(e).split("."),e[0].replace(/(?=(?:\d{3})+$)(?!\b)/g,",")+(e[1]?"."+e[1]:"")}function F(e,t){function r(){var e,r=i(c);return r&&(c.on("complete",o),e=c.events.complete,e.splice(0,0,e.pop())),h[p]=Y.isFunction(c&&c[t])?c[t].apply(c,u):n,!r&&o()}function o(n){var t,s=c,u=i(s);if(u&&(s.off("complete",o),s.emit("complete")),m.type="cycle",m.target=s,t=l(m),d.onCycle.call(e,t),t.aborted||a()===!1)m.type="complete",d.onComplete.call(e,l(m));else if(c=f?e[0]:h[p],i(c))b(c,r);else{if(!u)return!0;for(;r(););}return n?void(n.aborted=!0):!1}function i(e){var n=u[0]&&u[0].async;return"run"==t&&e instanceof s&&((null==n?e.options.async:n)&&Ce.timeout||e.defer)}function a(){return p++,f&&p>0&&de.call(e),(f?e.length:p<h.length)?p:p=!1}var u,c,f,p=-1,m={currentTarget:e},d={onStart:Y.noop,onCycle:Y.noop,onComplete:Y.noop},h=Y.toArray(e);if(Y.isString(t)?u=he.call(arguments,2):(d=Y.assign(d,t),t=d.name,u=Y.isArray(u="args"in d?d.args:[])?u:[u],f=d.queued),a()!==!1)if(c=h[p],m.type="start",m.target=c,d.onStart.call(e,l(m)),"run"==t&&e instanceof y&&e.aborted)m.type="cycle",d.onCycle.call(e,l(m)),m.type="complete",d.onComplete.call(e,l(m));else if(i(c))b(c,r);else for(;r(););return h}function B(e,n,t){var r=[],o=(e=re(e)).length,i=o===o>>>0;return t||(t=": "),Y.each(e,function(e,n){r.push(i?e:n+t+e)}),r.join(n||",")}function z(){var e,n=this,t=xe.resetSuite;return n.running&&(e=l("abort"),n.emit(e),(!e.cancelled||t)&&(xe.abortSuite=!0,n.reset(),delete xe.abortSuite,t||(n.aborted=!0,F(n,"abort")))),n}function q(e,n,t){var r=this,o=new s(e,n,t),i=l({type:"add",target:o});return r.emit(i),i.cancelled||r.push(o),r}function N(e){var n=this,t=new n.constructor(Y.assign({},n.options,e));return Y.forOwn(n,function(e,n){Y.has(t,n)||(t[n]=e&&Y.isFunction(e.clone)?e.clone():ke(e))}),t}function I(e){var n=this,t=new n.constructor(n.options);return t.push.apply(t,A(n,e)),t}function D(){var e,n=this,t=xe.abortSuite;return n.running&&!t?(xe.resetSuite=!0,n.abort(),delete xe.resetSuite):!n.aborted&&!n.running||(n.emit(e=l("reset")),e.cancelled)||(n.aborted=n.running=!1,t||F(n,"reset")),n}function P(e){var n=this;return n.reset(),n.running=!0,e||(e={}),F(n,{name:"run",args:e,queued:e.queued,onStart:function(e){n.emit(e)},onCycle:function(e){var t=e.target;t.error&&n.emit({type:"error",target:t}),n.emit(e),e.aborted=n.aborted},onComplete:function(e){n.running=!1,n.emit(e)}}),n}function M(e){var n,t=this,r=l(e),o=t.events,i=(arguments[0]=r,arguments);return r.currentTarget||(r.currentTarget=t),r.target||(r.target=t),delete r.result,o&&(n=Y.has(o,r.type)&&o[r.type])&&Y.each(n.slice(),function(e){return(r.result=e.apply(t,i))===!1&&(r.cancelled=!0),!r.aborted}),r.result}function R(e){var n=this,t=n.events||(n.events={});return Y.has(t,e)?t[e]:t[e]=[]}function L(e,n){var t=this,r=t.events;return r?(Y.each(e?e.split(" "):r,function(e,t){var o;"string"==typeof e&&(t=e,e=Y.has(r,t)&&r[t]),e&&(n?(o=Y.indexOf(e,n),o>-1&&e.splice(o,1)):e.length=0)}),t):t}function W(e,n){var t=this,r=t.events||(t.events={});return Y.each(e.split(" "),function(e){(Y.has(r,e)?r[e]:r[e]=[]).push(n)}),t}function H(){var e,n=this,t=xe.reset;return n.running&&(e=l("abort"),n.emit(e),(!e.cancelled||t)&&(xe.abort=!0,n.reset(),delete xe.abort,Ce.timeout&&(ue(n._timerId),delete n._timerId),t||(n.aborted=!0,n.running=!1))),n}function Z(e){var n=this,t=new n.constructor(Y.assign({},n,e));return t.options=Y.assign({},ke(n.options),ke(e)),Y.forOwn(n,function(e,n){Y.has(t,n)||(t[n]=ke(e))}),t}function G(e){function n(e,n){return Y.reduce(n,function(n,t){return n+(t>e?0:e>t?1:.5)},0)}function t(e,t){return Y.reduce(e,function(e,r){return e+n(r,t)},0)}function r(e){return(e-c*l/2)/ge(c*l*(c+l+1)/12)}var o=this;if(o==e)return 0;var i,s,a=o.stats.sample,u=e.stats.sample,c=a.length,l=u.length,f=le(c,l),p=fe(c,l),m=t(a,u),d=t(u,a),h=fe(m,d);return c+l>30?(s=r(h),ae(s)>1.96?h==m?1:-1:0):(i=5>f||3>p?0:g[f][p-3],i>=h?h==m?1:-1:0)}function J(){var e=this;if(e.running&&!xe.abort)return xe.reset=!0,e.abort(),delete xe.reset,e;var n,t=0,r=[],o=[],i={destination:e,source:Y.assign({},ke(e.constructor.prototype),ke(e.options))};do Y.forOwn(i.source,function(e,n){var t,s=i.destination,a=s[n];"_"!=n.charAt(0)&&(e&&"object"==typeof e?(Y.isArray(e)?(Y.isArray(a)||(t=a=[]),a.length!=e.length&&(t=a=a.slice(0,e.length),a.length=e.length)):a&&"object"==typeof a||(t=a={}),t&&r.push({destination:s,key:n,value:a}),o.push({destination:a,source:e})):e===a||null==e||Y.isFunction(e)||r.push({destination:s,key:n,value:e}))});while(i=o[t++]);return r.length&&(e.emit(n=l("reset")),!n.cancelled)&&Y.each(r,function(e){e.destination[e.key]=e.value}),e}function K(){var e=this,n=e.error,t=e.hz,r=e.id,o=e.stats,i=o.sample.length,s="±",a=e.name||(Y.isNaN(r)?r:"<Test #"+r+">");return a+=n?": "+B(n):" x "+E(t.toFixed(100>t?2:0))+" ops/sec "+s+o.rme.toFixed(2)+"% ("+i+" run"+(1==i?"":"s")+" sampled)"}function Q(){function e(e,n,t,o){var s=e.fn,a=t?T(s)||"deferred":"";return i.uid=$e+p++,Y.assign(i,{setup:n?$(e.setup):r("m#.setup()"),fn:n?$(s):r("m#.fn("+a+")"),fnArg:a,teardown:n?$(e.teardown):r("m#.teardown()")}),"ns"==je.unit?Y.assign(i,{begin:r("s#=n#()"),end:r("r#=n#(s#);r#=r#[0]+(r#[1]/1e9)")}):"us"==je.unit?je.ns.stop?Y.assign(i,{begin:r("s#=n#.start()"),end:r("r#=n#.microseconds()/1e6")}):Y.assign(i,{begin:r("s#=n#()"),end:r("r#=(n#()-s#)/1e6")}):je.ns.now?Y.assign(i,{begin:r("s#=n#.now()"),end:r("r#=(n#.now()-s#)/1e3")}):Y.assign(i,{begin:r("s#=new n#().getTime()"),end:r("r#=(new n#().getTime()-s#)/1e3")}),je.start=v(r("o#"),r("var n#=this.ns,${begin};o#.elapsed=0;o#.timeStamp=s#")),je.stop=v(r("o#"),r("var n#=this.ns,s#=o#.timeStamp,${end};o#.elapsed=r#")),v(r("window,t#"),"var global = window, clearTimeout = global.clearTimeout, setTimeout = global.setTimeout;\n"+r(o))}function n(e){for(var n,t,r=30,o=1e3,i=je.ns,s=[];r--;){if("us"==e)if(o=1e6,i.stop)for(i.start();!(n=i.microseconds()););else for(t=i();!(n=i()-t););else if("ns"==e){for(o=1e9,t=(t=i())[0]+t[1]/o;!(n=(n=i())[0]+n[1]/o-t););o=1}else if(i.now)for(t=i.now();!(n=i.now()-t););else for(t=(new i).getTime();!(n=(new i).getTime()-t););if(!(n>0)){s.push(1/0);break}s.push(n)}return S(s)/o}function r(e){return Y.template(e.replace(/\#/g,/\d+/.exec(i.uid)))(i)}var o=s.options,i={},u=[{ns:je.ns,res:le(.0015,n("ms")),unit:"ms"}];Q=function(n){var r;n instanceof a&&(r=n,n=r.benchmark);var s=n._original,u=C(s.fn),c=s.count=n.count,l=u||Ce.decompilation&&(n.setup!==Y.noop||n.teardown!==Y.noop),f=s.id,p=s.name||("number"==typeof f?"<Test #"+f+">":f),m=0;n.minTime=s.minTime||(s.minTime=s.options.minTime=o.minTime);var d=r?'var d#=this,${fnArg}=d#,m#=d#.benchmark._original,f#=m#.fn,su#=m#.setup,td#=m#.teardown;if(!d#.cycles){d#.fn=function(){var ${fnArg}=d#;if(typeof f#=="function"){try{${fn}\n}catch(e#){f#(d#)}}else{${fn}\n}};d#.teardown=function(){d#.cycles=0;if(typeof td#=="function"){try{${teardown}\n}catch(e#){td#()}}else{${teardown}\n}};if(typeof su#=="function"){try{${setup}\n}catch(e#){su#()}}else{${setup}\n};t#.start(d#);}d#.fn();return{uid:"${uid}"}':'var r#,s#,m#=this,f#=m#.fn,i#=m#.count,n#=t#.ns;${setup}\n${begin};while(i#--){${fn}\n}${end};${teardown}\nreturn{elapsed:r#,uid:"${uid}"}',h=s.compiled=n.compiled=e(s,l,r,d),g=!(i.fn||u);try{if(g)throw new Error('The test "'+p+'" is empty. This may be the result of dead code removal.');r||(s.count=1,h=l&&(h.call(s,t,je)||{}).uid==i.uid&&h,s.count=c)}catch(y){h=null,n.error=y||new Error(oe(y)),s.count=c}if(!h&&!r&&!g){d=(u||l&&!n.error?"function f#(){${fn}\n}var r#,s#,m#=this,i#=m#.count":"var r#,s#,m#=this,f#=m#.fn,i#=m#.count")+",n#=t#.ns;${setup}\n${begin};m#.f#=f#;while(i#--){m#.f#()}${end};delete m#.f#;${teardown}\nreturn{elapsed:r#}",h=e(s,l,r,d);try{s.count=1,h.call(s,t,je),s.count=c,delete n.error}catch(y){s.count=c,n.error||(n.error=y||new Error(oe(y)))}}return n.error||(h=s.compiled=n.compiled=e(s,l,r,d),m=h.call(r||s,t,je).elapsed),m};try{(je.ns=new(t.chrome||t.chromium).Interval)&&u.push({ns:je.ns,res:n("us"),unit:"us"})}catch(c){}if(Te&&"function"==typeof(je.ns=Te.hrtime)&&u.push({ns:je.ns,res:n("ns"),unit:"ns"}),we&&"function"==typeof(je.ns=we.now)&&u.push({ns:je.ns,res:n("us"),unit:"us"}),je=Y.minBy(u,"res"),je.res==1/0)throw new Error("Benchmark.js was unable to find a working timer.");return o.minTime||(o.minTime=le(je.res/2/.01,.05)),Q.apply(null,arguments)}function U(e,n){function t(){c.push(e.clone({_original:e,events:{abort:[r],cycle:[r],error:[r],start:[r]}}))}function r(n){var t=this,r=n.type;e.running?"start"==r?t.count=e.initCount:("error"==r&&(e.error=t.error),"abort"==r?(e.abort(),e.emit("cycle")):(n.currentTarget=n.target=e,e.emit(n))):e.aborted&&(t.events.abort.length=0,t.abort())}function o(n){var r,o,i,f,p,m,d,g,y=n.target,v=e.aborted,b=Y.now(),w=l.push(y.times.period),T=w>=u&&(s+=b-y.times.timeStamp)/1e3>e.maxTime,$=e.times,x=function(e,n){return e+pe(n-i,2)};(v||y.hz==1/0)&&(T=!(w=l.length=c.length=0)),v||(i=S(l),g=Y.reduce(l,x,0)/(w-1)||0,m=ge(g),d=m/ge(w),o=w-1,r=h[te.round(o)||1]||h.infinity,f=d*r,p=f/i*100||0,Y.assign(e.stats,{deviation:m,mean:i,moe:f,rme:p,sem:d,variance:g}),T&&(e.initCount=a,e.running=!1,v=!0,$.elapsed=(b-$.timeStamp)/1e3),e.hz!=1/0&&(e.hz=1/i,$.cycle=i*e.count,$.period=i)),c.length<2&&!T&&t(),n.aborted=v}n||(n={});var i=n.async,s=0,a=e.initCount,u=e.minSamples,c=[],l=e.stats.sample;t(),F(c,{name:"run",args:{async:i},queued:!0,onCycle:o,onComplete:function(){e.emit("complete")}})}function V(e,n){n||(n={});var r;e instanceof a&&(r=e,e=e.benchmark);var o,i,s,u,c,f,p=n.async,m=e._original,h=e.count,g=e.times;e.running&&(i=++e.cycles,o=r?r.elapsed:Q(e),c=e.minTime,i>m.cycles&&(m.cycles=i),e.error&&(u=l("error"),u.message=e.error,e.emit(u),u.cancelled||e.abort())),e.running&&(m.times.cycle=g.cycle=o,f=m.times.period=g.period=o/h,m.hz=e.hz=1/f,m.initCount=e.initCount=h,e.running=c>o,e.running&&(o||null==(s=d[e.cycles])||(h=ce(4e6/s)),h<=e.count&&(h+=te.ceil((c-o)/f)),e.running=h!=1/0)),u=l("cycle"),e.emit(u),u.aborted&&e.abort(),e.running?(e.count=h,r?e.compiled.call(r,t,je):p?b(e,function(){V(e,n)}):V(e)):(Ce.browser&&k($e+"=1;delete "+$e),e.emit("complete"))}function X(e){var n=this,t=l("start");return n.running=!1,n.reset(),n.running=!0,n.count=n.initCount,n.times.timeStamp=Y.now(),n.emit(t),t.cancelled||(e={async:(null==(e=e&&e.async)?n.async:e)&&Ce.timeout},n._original?n.defer?a(n):V(n,e):U(n,e)),n}var Y=t&&t._||j("lodash")||r._;if(!Y)return s.runInContext=e,s;t=t?Y.defaults(r.Object(),t,Y.pick(r,m)):r;var ee=(t.Array,t.Date),ne=t.Function,te=t.Math,re=t.Object,oe=(t.RegExp,t.String),ie=[],se=re.prototype,ae=te.abs,ue=t.clearTimeout,ce=te.floor,le=(te.log,te.max),fe=te.min,pe=te.pow,me=ie.push,de=(t.setTimeout,ie.shift),he=ie.slice,ge=te.sqrt,ye=(se.toString,ie.unshift),ve=j,be=x(t,"document")&&t.document,we=ve("microtime"),Te=x(t,"process")&&t.process,Se=be&&be.createElement("div"),$e="uid"+Y.now(),xe={},Ce={};!function(){Ce.browser=be&&x(t,"navigator")&&!x(t,"phantom"),Ce.timeout=x(t,"setTimeout")&&x(t,"clearTimeout");try{Ce.decompilation="1"===ne(("return ("+function(e){return{x:""+(1+e),y:0}}+")").replace(/__cov__[^;]+;/g,""))()(0).x}catch(e){Ce.decompilation=!1}}();var je={ns:ee,start:null,stop:null},ke=Y.partial(Y.cloneDeepWith,Y,function(e){return!Y.isObject(e)||Y.isArray(e)||Y.isPlainObject(e)?n:e});return Y.assign(s,{options:{async:!1,defer:!1,delay:.005,id:n,initCount:1,maxTime:5,minSamples:5,minTime:0,name:n,onAbort:n,onComplete:n,onCycle:n,onError:n,onReset:n,onStart:n},platform:t.platform||j("platform")||{description:t.navigator&&t.navigator.userAgent||null,layout:null,product:null,name:null,manufacturer:null,os:null,prerelease:null,version:null,toString:function(){return this.description||""}},version:"2.1.0"}),Y.assign(s,{filter:A,formatNumber:E,invoke:F,join:B,runInContext:e,support:Ce}),Y.each(["each","forEach","forOwn","has","indexOf","map","reduce"],function(e){s[e]=Y[e]}),Y.assign(s.prototype,{count:0,cycles:0,hz:0,compiled:n,error:n,fn:n,aborted:!1,running:!1,setup:Y.noop,teardown:Y.noop,stats:{moe:0,rme:0,sem:0,deviation:0,mean:0,sample:[],variance:0},times:{cycle:0,elapsed:0,period:0,timeStamp:0}}),Y.assign(s.prototype,{abort:H,clone:Z,compare:G,emit:M,listeners:R,off:L,on:W,reset:J,run:X,toString:K}),Y.assign(a.prototype,{benchmark:null,cycles:0,elapsed:0,timeStamp:0}),Y.assign(a.prototype,{resolve:O}),Y.assign(l.prototype,{aborted:!1,cancelled:!1,currentTarget:n,result:n,target:n,timeStamp:0,type:""}),y.options={name:n},Y.assign(y.prototype,{length:0,aborted:!1,running:!1}),Y.assign(y.prototype,{abort:z,add:q,clone:N,emit:M,filter:I,join:ie.join,listeners:R,off:L,on:W,pop:ie.pop,push:me,reset:D,run:P,reverse:ie.reverse,shift:de,slice:he,sort:ie.sort,splice:ie.splice,unshift:ye}),Y.assign(s,{Deferred:a,Event:l,Suite:y}),Y.each(["each","forEach","indexOf","map","reduce"],function(e){var n=Y[e];y.prototype[e]=function(){var e=[this];return me.apply(e,arguments),n.apply(Y,e)}}),Y.each(["pop","shift","splice"],function(e){var n=ie[e];y.prototype[e]=function(){var e=this,t=n.apply(e,arguments);return 0===e.length&&delete e[0],t}}),y.prototype.unshift=function(){var e=this;return ye.apply(e,arguments),e.length},s}var n,t={"function":!0,object:!0},r=t[typeof window]&&window||this,o="function"==typeof define&&"object"==typeof define.amd&&define.amd&&define,i=t[typeof exports]&&exports&&!exports.nodeType&&exports,s=t[typeof module]&&module&&!module.nodeType&&module,a=i&&s&&"object"==typeof global&&global;!a||a.global!==a&&a.window!==a&&a.self!==a||(r=a);var u="function"==typeof require&&require,c=0,l=s&&s.exports===i&&i,f=/^(?:boolean|number|string|undefined)$/,p=0,m=["Array","Date","Function","Math","Object","RegExp","String","_","clearTimeout","chrome","chromium","document","navigator","phantom","platform","process","runtime","setTimeout"],d={1:4096,2:512,3:64,4:8,5:0},h={1:12.706,2:4.303,3:3.182,4:2.776,5:2.571,6:2.447,7:2.365,8:2.306,9:2.262,10:2.228,11:2.201,12:2.179,13:2.16,14:2.145,15:2.131,16:2.12,17:2.11,18:2.101,19:2.093,20:2.086,21:2.08,22:2.074,23:2.069,24:2.064,25:2.06,26:2.056,27:2.052,28:2.048,29:2.045,30:2.042,infinity:1.96},g={5:[0,1,2],6:[1,2,3,5],7:[1,3,5,6,8],8:[2,4,6,8,10,13],9:[2,4,7,10,12,15,17],10:[3,5,8,11,14,17,20,23],11:[3,6,9,13,16,19,23,26,30],12:[4,7,11,14,18,22,26,29,33,37],13:[4,8,12,16,20,24,28,33,37,41,45],14:[5,9,13,17,22,26,31,36,40,45,50,55],15:[5,10,14,19,24,29,34,39,44,49,54,59,64],16:[6,11,15,21,26,31,37,42,47,53,59,64,70,75],17:[6,11,17,22,28,34,39,45,51,57,63,67,75,81,87],18:[7,12,18,24,30,36,42,48,55,61,67,74,80,86,93,99],19:[7,13,19,25,32,38,45,52,58,65,72,78,85,92,99,106,113],20:[8,14,20,27,34,41,48,55,62,69,76,83,90,98,105,112,119,127],21:[8,15,22,29,36,43,50,58,65,73,80,88,96,103,111,119,126,134,142],22:[9,16,23,30,38,45,53,61,69,77,85,93,101,109,117,125,133,141,150,158],23:[9,17,24,32,40,48,56,64,73,81,89,98,106,115,123,132,140,149,157,166,175],24:[10,17,25,33,42,50,59,67,76,85,94,102,111,120,129,138,147,156,165,174,183,192],25:[10,18,27,35,44,53,62,71,80,89,98,107,117,126,135,145,154,163,173,182,192,201,211],26:[11,19,28,37,46,55,64,74,83,93,102,112,122,132,141,151,161,171,181,191,200,210,220,230],27:[11,20,29,38,48,57,67,77,87,97,107,118,125,138,147,158,168,178,188,199,209,219,230,240,250],28:[12,21,30,40,50,60,70,80,90,101,111,122,132,143,154,164,175,186,196,207,218,228,239,250,261,272],29:[13,22,32,42,52,62,73,83,94,105,116,127,138,149,160,171,182,193,204,215,226,238,249,260,271,282,294],30:[13,23,33,43,54,65,76,87,98,109,120,131,143,154,166,177,189,200,212,223,235,247,258,270,282,293,305,317]};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(["lodash","platform"],function(n,t){return e({_:n,platform:t})});else{var y=e();i&&s?(l&&((s.exports=y).Benchmark=y),i.Benchmark=y):r.Benchmark=y}}).call(this); \ No newline at end of file
true
Other
mrdoob
three.js
83fe533cc16ebb78e3ba72a3ae04a603b4bc00b0.json
Reintroduce benchmarks (unchanged)
test/benchmark/vendor/lodash.min.js
@@ -0,0 +1,127 @@ +/** + * @license + * lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + */ +;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t?t.length:0;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t?t.length:0;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=t?t.length:0;r--&&false!==n(t[r],r,t);); +return t}function i(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(!n(t[r],r,t))return false;return true}function f(t,n){for(var r=-1,e=t?t.length:0,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function c(t,n){return!(!t||!t.length)&&-1<d(t,n,0)}function a(t,n,r){for(var e=-1,u=t?t.length:0;++e<u;)if(r(n,t[e]))return true;return false}function l(t,n){for(var r=-1,e=t?t.length:0,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function s(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function h(t,n,r,e){ +var u=-1,o=t?t.length:0;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function p(t,n,r,e){var u=t?t.length:0;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function _(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(n(t[r],r,t))return true;return false}function v(t,n,r){var e;return r(t,function(t,r,u){return n(t,r,u)?(e=r,false):void 0}),e}function g(t,n,r,e){var u=t.length;for(r+=e?1:-1;e?r--:++r<u;)if(n(t[r],r,t))return r;return-1}function d(t,n,r){if(n!==n)return M(t,r);--r;for(var e=t.length;++r<e;)if(t[r]===n)return r; +return-1}function y(t,n,r,e){--r;for(var u=t.length;++r<u;)if(e(t[r],n))return r;return-1}function b(t,n){var r=t?t.length:0;return r?w(t,n)/r:V}function x(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=false,t):n(r,t,u,o)}),r}function j(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].c;return t}function w(t,n){for(var r,e=-1,u=t.length;++e<u;){var o=n(t[e]);o!==T&&(r=r===T?o:r+o)}return r}function m(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function A(t,n){return l(n,function(n){return[n,t[n]]; +})}function O(t){return function(n){return t(n)}}function k(t,n){return l(n,function(n){return t[n]})}function E(t,n){return t.has(n)}function S(t,n){for(var r=-1,e=t.length;++r<e&&-1<d(n,t[r],0););return r}function I(t,n){for(var r=t.length;r--&&-1<d(n,t[r],0););return r}function R(t){return t&&t.Object===Object?t:null}function W(t){return zt[t]}function B(t){return Ut[t]}function L(t){return"\\"+Dt[t]}function M(t,n,r){var e=t.length;for(n+=r?1:-1;r?n--:++n<e;){var u=t[n];if(u!==u)return n}return-1; +}function C(t){var n=false;if(null!=t&&typeof t.toString!="function")try{n=!!(t+"")}catch(r){}return n}function z(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function U(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function $(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];i!==n&&"__lodash_placeholder__"!==i||(t[r]="__lodash_placeholder__",o[u++]=r)}return o}function D(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function F(t){ +var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=[t,t]}),r}function N(t){if(!t||!Wt.test(t))return t.length;for(var n=It.lastIndex=0;It.test(t);)n++;return n}function P(t){return $t[t]}function Z(R){function At(t,n){return R.setTimeout.call(Kt,t,n)}function Ot(t){if(Te(t)&&!yi(t)&&!(t instanceof Ut)){if(t instanceof zt)return t;if(Wu.call(t,"__wrapped__"))return ae(t)}return new zt(t)}function kt(){}function zt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0, +this.__values__=T}function Ut(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function $t(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Dt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Pt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Zt(t){var n=-1,r=t?t.length:0; +for(this.__data__=new Pt;++n<r;)this.add(t[n])}function qt(t){this.__data__=new Dt(t)}function Vt(t,n,r,e){return t===T||Ce(t,ku[r])&&!Wu.call(e,r)?n:t}function Jt(t,n,r){(r===T||Ce(t[n],r))&&(typeof n!="number"||r!==T||n in t)||(t[n]=r)}function Yt(t,n,r){var e=t[n];Wu.call(t,n)&&Ce(e,r)&&(r!==T||n in t)||(t[n]=r)}function Ht(t,n){for(var r=t.length;r--;)if(Ce(t[r][0],n))return r;return-1}function Qt(t,n,r,e){return Ao(t,function(t,u,o){n(e,t,r(t),o)}),e}function Xt(t,n){return t&&sr(n,iu(n),t)} +function tn(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r<u;)o[r]=e?T:uu(t,n[r]);return o}function nn(t,n,r){return t===t&&(r!==T&&(t=r>=t?t:r),n!==T&&(t=t>=n?t:n)),t}function rn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==T)return c;if(!Ze(t))return t;if(o=yi(t)){if(c=Kr(t),!n)return lr(t,c)}else{var a=qr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(bi(t))return or(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=Gr(l?{}:t), +!n)return hr(t,Xt(c,t))}else{if(!Ct[a])return i?t:{};c=Jr(t,a,rn,n)}}if(f||(f=new qt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?gn(t,iu,Tr):iu(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,rn(u,n,r,e,o,t,f))}),c}function en(t){var n=iu(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===T&&!(o in Object(e))||!i(f))return false}return true}}function un(t){return Ze(t)?Tu(t):{}}function on(t,n,r){if(typeof t!="function")throw new Au("Expected a function"); +return At(function(){t.apply(T,r)},n)}function fn(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,O(r))),e?(o=a,i=false):n.length>=200&&(o=E,i=false,n=new Zt(n));t:for(;++u<f;){var p=t[u],_=r?r(p):p,p=e||0!==p?p:0;if(i&&_===_){for(var v=h;v--;)if(n[v]===_)continue t;s.push(p)}else o(n,_,e)||s.push(p)}return s}function cn(t,n){var r=true;return Ao(t,function(t,e,u){return r=!!n(t,e,u)}),r}function an(t,n,r){for(var e=-1,u=t.length;++e<u;){var o=t[e],i=n(o);if(null!=i&&(f===T?i===i&&!Je(i):r(i,f)))var f=i,c=o; +}return c}function ln(t,n){var r=[];return Ao(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function sn(t,n,r,e,u){var o=-1,i=t.length;for(r||(r=Hr),u||(u=[]);++o<i;){var f=t[o];n>0&&r(f)?n>1?sn(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function hn(t,n){return t&&ko(t,n,iu)}function pn(t,n){return t&&Eo(t,n,iu)}function _n(t,n){return f(n,function(n){return Fe(t[n])})}function vn(t,n){n=ne(n,t)?[n]:er(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[fe(n[r++])];return r&&r==e?t:T}function gn(t,n,r){ +return n=n(t),yi(t)?n:s(n,r(t))}function dn(t,n){return t>n}function yn(t,n){return null!=t&&(Wu.call(t,n)||typeof t=="object"&&n in t&&null===Ju(Object(t)))}function bn(t,n){return null!=t&&n in Object(t)}function xn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,O(n))),s=to(p.length,s),f[i]=!r&&(n||u>=120&&p.length>=120)?new Zt(i&&p):T}var p=t[0],_=-1,v=f[0];t:for(;++_<u&&s>h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!E(v,d):!e(h,d,r)){ +for(i=o;--i;){var y=f[i];if(y?!E(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function jn(t,n,r){var e={};return hn(t,function(t,u,o){n(e,r(t),u,o)}),e}function wn(t,n,e){return ne(n,t)||(n=er(n),t=ie(t,n),n=ve(n)),n=null==t?t:t[fe(n)],null==n?T:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Ze(t)&&!Te(n))n=t!==t&&n!==n;else t:{var o=yi(t),i=yi(n),f="[object Array]",c="[object Array]";o||(f=qr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=qr(n), +c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!C(t),i="[object Object]"==c&&!C(n);if((c=f==c)&&!a)u||(u=new qt),n=o||Ye(t)?zr(t,n,mn,r,e,u):Ur(t,n,f,mn,r,e,u);else{if(!(2&e)&&(o=a&&Wu.call(t,"__wrapped__"),f=i&&Wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new qt),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new qt),o=2&e,f=iu(t),i=f.length,c=iu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:yn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{ +c=true,u.set(t,n);for(var s=o;++a<i;){var l=f[a],h=t[l],p=n[l];if(r)var _=o?r(p,h,l,n,t,u):r(h,p,l,t,n,u);if(_===T?h!==p&&!mn(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(r=t.constructor,e=n.constructor,r!=e&&"constructor"in t&&"constructor"in n&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),u["delete"](t),n=c}}else n=false;else n=false}}return n}function An(t,n,r,e){var u=r.length,o=u,i=!e;if(null==t)return!o;for(t=Object(t);u--;){var f=r[u];if(i&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return false; +}for(;++u<o;){var f=r[u],c=f[0],a=t[c],l=f[1];if(i&&f[2]){if(a===T&&!(c in t))return false}else{if(f=new qt,e)var s=e(a,l,c,t,n,f);if(s===T?!mn(l,a,e,3,f):!s)return false}}return true}function On(t){return!Ze(t)||Iu&&Iu in t?false:(Fe(t)||C(t)?zu:yt).test(ce(t))}function kn(t){return typeof t=="function"?t:null==t?pu:typeof t=="object"?yi(t)?Wn(t[0],t[1]):Rn(t):du(t)}function En(t){t=null==t?t:Object(t);var n,r=[];for(n in t)r.push(n);return r}function Sn(t,n){return n>t}function In(t,n){var r=-1,e=Ue(t)?Array(t.length):[]; +return Ao(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function Rn(t){var n=Pr(t);return 1==n.length&&n[0][2]?ue(n[0][0],n[0][1]):function(r){return r===t||An(r,t,n)}}function Wn(t,n){return ne(t)&&n===n&&!Ze(n)?ue(fe(t),n):function(r){var e=uu(r,t);return e===T&&e===n?ou(r,t):mn(n,e,T,3)}}function Bn(t,n,r,e,o){if(t!==n){if(!yi(n)&&!Ye(n))var i=fu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Ze(u)){o||(o=new qt);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Jt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s, +yi(s)||Ye(s)?yi(l)?h=l:$e(l)?h=lr(l):(p=false,h=rn(s,true)):Ve(s)||ze(s)?ze(l)?h=ru(l):!Ze(l)||r&&Fe(l)?(p=false,h=rn(s,true)):h=l:p=false),a.set(s,h),p&&Bn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u),Jt(t,f,c)})}}function Ln(t,n){var r=t.length;return r?(n+=0>n?r:0,Xr(n,r)?t[n]:T):void 0}function Mn(t,n,r){var e=-1;return n=l(n.length?n:[pu],O(Fr())),t=In(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),j(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e<i;){ +var c=fr(u[e],o[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Cn(t,n){return t=Object(t),h(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function zn(t,n){for(var r=-1,e=gn(t,fu,Bo),u=e.length,o={};++r<u;){var i=e[r],f=t[i];n(f,i)&&(o[i]=f)}return o}function Un(t){return function(n){return null==n?T:n[t]}}function $n(t){return function(n){return vn(n,t)}}function Dn(t,n,r,e){var u=e?y:d,o=-1,i=n.length,f=t;for(t===n&&(n=lr(n)),r&&(f=l(t,O(r)));++o<i;)for(var c=0,a=n[o],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==t&&Vu.call(f,c,1), +Vu.call(t,c,1);return t}function Fn(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(r==e||u!==o){var o=u;if(Xr(u))Vu.call(t,u,1);else if(ne(u,t))delete t[fe(u)];else{var u=er(u),i=ie(t,u);null!=i&&delete i[fe(ve(u))]}}}}function Nn(t,n){return t+Gu(ro()*(n-t+1))}function Pn(t,n){var r="";if(!t||1>n||n>9007199254740991)return r;do n%2&&(r+=t),(n=Gu(n/2))&&(t+=t);while(n);return r}function Zn(t,n,r,e){n=ne(n,t)?[n]:er(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){var c=fe(n[u]);if(Ze(f)){ +var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):T;a===T&&(a=null==l?Xr(n[u+1])?[]:{}:l)}Yt(f,c,a)}f=f[c]}return t}function Tn(t,n,r){var e=-1,u=t.length;for(0>n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e<u;)r[e]=t[e+n];return r}function qn(t,n){var r;return Ao(t,function(t,e,u){return r=n(t,e,u),!r}),!!r}function Vn(t,n,r){var e=0,u=t?t.length:e;if(typeof n=="number"&&n===n&&2147483647>=u){for(;u>e;){var o=e+u>>>1,i=t[o];null!==i&&!Je(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u} +return Kn(t,n,pu,r)}function Kn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Je(n),a=n===T;o>u;){var l=Gu((u+o)/2),s=r(t[l]),h=s!==T,p=null===s,_=s===s,v=Je(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l}return to(o,4294967294)}function Gn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r],f=n?n(i):i;if(!r||!Ce(f,c)){var c=f;o[u++]=0===i?0:i}}return o}function Jn(t){return typeof t=="number"?t:Je(t)?V:+t}function Yn(t){if(typeof t=="string")return t; +if(Je(t))return mo?mo.call(t):"";var n=t+"";return"0"==n&&1/t==-q?"-0":n}function Hn(t,n,r){var e=-1,u=c,o=t.length,i=true,f=[],l=f;if(r)i=false,u=a;else if(o>=200){if(u=n?null:Io(t))return D(u);i=false,u=E,l=new Zt}else l=n?[]:f;t:for(;++e<o;){var s=t[e],h=n?n(s):s,s=r||0!==s?s:0;if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function Qn(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?Tn(t,e?0:o,e?o+1:u):Tn(t,e?o+1:0,e?u:o); +}function Xn(t,n){var r=t;return r instanceof Ut&&(r=r.value()),h(n,function(t,n){return n.func.apply(n.thisArg,s([t],n.args))},r)}function tr(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?s(fn(o,t[e],n,r),fn(t[e],o,n,r)):t[e];return o&&o.length?Hn(o,n,r):[]}function nr(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;)r(i,t[e],o>e?n[e]:T);return i}function rr(t){return $e(t)?t:[]}function er(t){return yi(t)?t:Co(t)}function ur(t,n,r){var e=t.length;return r=r===T?e:r,!n&&r>=e?t:Tn(t,n,r)}function or(t,n){ +if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ir(t){var n=new t.constructor(t.byteLength);return new Fu(n).set(new Fu(t)),n}function fr(t,n){if(t!==n){var r=t!==T,e=null===t,u=t===t,o=Je(t),i=n!==T,f=null===n,c=n===n,a=Je(n);if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function cr(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Xu(o-i,0),l=Array(c+a);for(e=!e;++f<c;)l[f]=n[f]; +for(;++u<i;)(e||o>u)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function ar(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Xu(o-f,0),s=Array(l+a);for(e=!e;++u<l;)s[u]=t[u];for(l=u;++c<a;)s[l+c]=n[c];for(;++i<f;)(e||o>u)&&(s[l+r[i]]=t[u++]);return s}function lr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function sr(t,n,r,e){r||(r={});for(var u=-1,o=n.length;++u<o;){var i=n[u],f=e?e(r[i],t[i],i,r,t):t[i];Yt(r,i,f)}return r}function hr(t,n){return sr(t,Tr(t),n); +}function pr(t,n){return function(r,u){var o=yi(r)?e:Qt,i=n?n():{};return o(r,t,Fr(u),i)}}function _r(t){return Me(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:T,i=u>2?r[2]:T,o=t.length>3&&typeof o=="function"?(u--,o):T;for(i&&te(r[0],r[1],i)&&(o=3>u?T:o,u=1),n=Object(n);++e<u;)(i=r[e])&&t(n,i,e,o);return n})}function vr(t,n){return function(r,e){if(null==r)return r;if(!Ue(r))return t(r,e);for(var u=r.length,o=n?u:-1,i=Object(r);(n?o--:++o<u)&&false!==e(i[o],o,i););return r}}function gr(t){return function(n,r,e){ +var u=-1,o=Object(n);e=e(n);for(var i=e.length;i--;){var f=e[t?i:++u];if(false===r(o[f],f,o))break}return n}}function dr(t,n,r){function e(){return(this&&this!==Kt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=xr(t);return e}function yr(t){return function(n){n=eu(n);var r=Wt.test(n)?n.match(It):T,e=r?r[0]:n.charAt(0);return n=r?ur(r,1).join(""):n.slice(1),e[t]()+n}}function br(t){return function(n){return h(su(lu(n).replace(Et,"")),t,"")}}function xr(t){return function(){var n=arguments; +switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var r=un(t.prototype),n=t.apply(r,n);return Ze(n)?n:r}}function jr(t,n,e){function u(){for(var i=arguments.length,f=Array(i),c=i,a=Dr(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:$(f,a), +i-=c.length,e>i?Br(t,n,Ar,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Kt&&this instanceof u?o:t,this,f)}var o=xr(t);return u}function wr(t){return function(n,r,e){var u=Object(n);if(r=Fr(r,3),!Ue(n))var o=iu(n);return e=t(o||n,function(t,n){return o&&(n=t,t=u[n]),r(t,n,u)},e),e>-1?n[o?o[e]:e]:T}}function mr(t){return Me(function(n){n=sn(n,1);var r=n.length,e=r,u=zt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new Au("Expected a function");if(u&&!i&&"wrapper"==$r(o))var i=new zt([],true); +}for(e=i?e:r;++e<r;)var o=n[e],u=$r(o),f="wrapper"==u?Ro(o):T,i=f&&re(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[$r(f[0])].apply(i,f[3]):1==o.length&&re(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&yi(e)&&e.length>=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++u<r;)t=n[u].call(this,t);return t}})}function Ar(t,n,r,e,u,o,i,f,c,a){function l(){for(var d=arguments.length,y=Array(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=Dr(l),b=y.length;for(x=0;b--;)y[b]===j&&x++; +}if(e&&(y=cr(y,e,u,_)),o&&(y=ar(y,o,i,_)),d-=x,_&&a>d)return j=$(y,j),Br(t,n,Ar,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[t]:t,d=y.length,f){x=y.length;for(var w=to(f.length,x),m=lr(y);w--;){var A=f[w];y[w]=Xr(A,x)?m[A]:T}}else v&&d>1&&y.reverse();return s&&d>c&&(y.length=c),this&&this!==Kt&&this instanceof l&&(b=g||xr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:xr(t);return l}function Or(t,n){return function(r,e){return jn(r,t,n(e))}}function kr(t){return function(n,r){var e; +if(n===T&&r===T)return 0;if(n!==T&&(e=n),r!==T){if(e===T)return r;typeof n=="string"||typeof r=="string"?(n=Yn(n),r=Yn(r)):(n=Jn(n),r=Jn(r)),e=t(n,r)}return e}}function Er(t){return Me(function(n){return n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr())),Me(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Sr(t,n){n=n===T?" ":Yn(n);var r=n.length;return 2>r?r?Pn(n,t):n:(r=Pn(n,Ku(t/N(n))),Wt.test(n)?ur(r.match(It),0,t).join(""):r.slice(0,t))}function Ir(t,n,e,u){ +function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Kt&&this instanceof o?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++n];return r(h,i?e:this,s)}var i=1&n,f=xr(t);return o}function Rr(t){return function(n,r,e){e&&typeof e!="number"&&te(n,r,e)&&(r=e=T),n=nu(n),n=n===n?n:0,r===T?(r=n,n=0):r=nu(r)||0,e=e===T?r>n?1:-1:nu(e)||0;var u=-1;r=Xu(Ku((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Wr(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=nu(n), +r=nu(r)),t(n,r)}}function Br(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:T;i=l?T:i;var h=l?o:T;return o=l?T:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(T,n),re(t)&&Mo(r,n),r.placeholder=e,r}function Lr(t){var n=wu[t];return function(t,r){if(t=nu(t),r=to(Xe(r),292)){var e=(eu(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(eu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Mr(t){return function(n){var r=qr(n);return"[object Map]"==r?U(n):"[object Set]"==r?F(n):A(n,t(n)); +}}function Cr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new Au("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Xu(Xe(i),0),f=f===T?f:Xe(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:Ro(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?cr(e,r,h[4]):r,o[4]=e?$(o[3],"__lodash_placeholder__"):h[4]), +(r=h[5])&&(e=o[5],o[5]=e?ar(e,r,h[6]):r,o[6]=e?$(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:to(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Xu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?So:Mo)(n&&1!=n?8==n||16==n?jr(t,n,f):32!=n&&33!=n||u.length?Ar.apply(T,o):Ir(t,n,r,e):dr(t,n,r),o)}function zr(t,n,r,e,u,o){var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if(c=o.get(t))return c==n; +var c=-1,a=true,l=1&u?new Zt:T;for(o.set(t,n);++c<f;){var s=t[c],h=n[c];if(e)var p=i?e(h,s,c,n,t,o):e(s,h,c,t,n,o);if(p!==T){if(p)continue;a=false;break}if(l){if(!_(n,function(t,n){return l.has(n)||s!==t&&!r(s,t,e,u,o)?void 0:l.add(n)})){a=false;break}}else if(s!==h&&!r(s,h,e,u,o)){a=false;break}}return o["delete"](t),a}function Ur(t,n,r,e,u,o,i){switch(r){case"[object DataView]":if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)break;t=t.buffer,n=n.buffer;case"[object ArrayBuffer]":if(t.byteLength!=n.byteLength||!e(new Fu(t),new Fu(n)))break; +return true;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object Error]":return t.name==n.name&&t.message==n.message;case"[object Number]":return t!=+t?n!=+n:t==+n;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var f=U;case"[object Set]":if(f||(f=D),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),zr(f(t),f(n),e,u,o,i));case"[object Symbol]":if(wo)return wo.call(t)==wo.call(n)}return false}function $r(t){for(var n=t.name+"",r=_o[n],e=Wu.call(_o,n)?r.length:0;e--;){ +var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function Dr(t){return(Wu.call(Ot,"placeholder")?Ot:t).placeholder}function Fr(){var t=Ot.iteratee||_u,t=t===_u?kn:t;return arguments.length?t(arguments[0],arguments[1]):t}function Nr(t,n){var r=t.__data__,e=typeof n;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n)?r[typeof n=="string"?"string":"hash"]:r.map}function Pr(t){for(var n=iu(t),r=n.length;r--;){var e=n[r],u=t[e];n[r]=[e,u,u===u&&!Ze(u)]}return n; +}function Zr(t,n){var r=null==t?T:t[n];return On(r)?r:T}function Tr(t){return Pu(Object(t))}function qr(t){return Mu.call(t)}function Vr(t,n,r){n=ne(n,t)?[n]:er(n);for(var e,u=-1,o=n.length;++u<o;){var i=fe(n[u]);if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&Pe(o)&&Xr(i,o)&&(yi(t)||Ge(t)||ze(t)))}function Kr(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&Wu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Gr(t){return typeof t.constructor!="function"||ee(t)?{}:un(Ju(Object(t))); +}function Jr(r,e,u,o){var i=r.constructor;switch(e){case"[object ArrayBuffer]":return ir(r);case"[object Boolean]":case"[object Date]":return new i(+r);case"[object DataView]":return e=o?ir(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]": +return e=o?ir(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);case"[object Map]":return e=o?u(U(r),true):U(r),h(e,t,new r.constructor);case"[object Number]":case"[object String]":return new i(r);case"[object RegExp]":return e=new r.constructor(r.source,_t.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=o?u(D(r),true):D(r),h(e,n,new r.constructor);case"[object Symbol]":return wo?Object(wo.call(r)):{}}}function Yr(t){var n=t?t.length:T;return Pe(n)&&(yi(t)||Ge(t)||ze(t))?m(n,String):null; +}function Hr(t){return yi(t)||ze(t)}function Qr(t){return yi(t)&&!(2==t.length&&!Fe(t[0]))}function Xr(t,n){return n=null==n?9007199254740991:n,!!n&&(typeof t=="number"||xt.test(t))&&t>-1&&0==t%1&&n>t}function te(t,n,r){if(!Ze(r))return false;var e=typeof n;return("number"==e?Ue(r)&&Xr(n,r.length):"string"==e&&n in r)?Ce(r[n],t):false}function ne(t,n){if(yi(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Je(t)?true:ut.test(t)||!et.test(t)||null!=n&&t in Object(n)}function re(t){ +var n=$r(t),r=Ot[n];return typeof r=="function"&&n in Ut.prototype?t===r?true:(n=Ro(r),!!n&&t===n[0]):false}function ee(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||ku)}function ue(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function oe(t,n,r,e,u,o){return Ze(t)&&Ze(n)&&Bn(t,n,T,oe,o.set(n,t)),t}function ie(t,n){return 1==n.length?t:vn(t,Tn(n,0,-1))}function fe(t){if(typeof t=="string"||Je(t))return t;var n=t+"";return"0"==n&&1/t==-q?"-0":n}function ce(t){ +if(null!=t){try{return Ru.call(t)}catch(n){}return t+""}return""}function ae(t){if(t instanceof Ut)return t.clone();var n=new zt(t.__wrapped__,t.__chain__);return n.__actions__=lr(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function le(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),Tn(t,0>n?0:n,e)):[]}function se(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0,0>n?0:n)):[]}function he(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:Xe(r),0>r&&(r=Xu(e+r,0)), +g(t,Fr(n,3),r)):-1}function pe(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==T&&(u=Xe(r),u=0>r?Xu(e+u,0):to(u,e-1)),g(t,Fr(n,3),u,true)}function _e(t){return t&&t.length?t[0]:T}function ve(t){var n=t?t.length:0;return n?t[n-1]:T}function ge(t,n){return t&&t.length&&n&&n.length?Dn(t,n):t}function de(t){return t?uo.call(t):t}function ye(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){return $e(t)?(n=Xu(t.length,n),true):void 0}),m(n,function(n){return l(t,Un(n))})}function be(t,n){ +if(!t||!t.length)return[];var e=ye(t);return null==n?e:l(e,function(t){return r(n,T,t)})}function xe(t){return t=Ot(t),t.__chain__=true,t}function je(t,n){return n(t)}function we(){return this}function me(t,n){return(yi(t)?u:Ao)(t,Fr(n,3))}function Ae(t,n){return(yi(t)?o:Oo)(t,Fr(n,3))}function Oe(t,n){return(yi(t)?l:In)(t,Fr(n,3))}function ke(t,n,r){var e=-1,u=He(t),o=u.length,i=o-1;for(n=(r?te(t,n,r):n===T)?1:nn(Xe(n),0,o);++e<n;)t=Nn(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,u}function Ee(){ +return xu.now()}function Se(t,n,r){return n=r?T:n,n=t&&null==n?t.length:n,Cr(t,128,T,T,T,T,n)}function Ie(t,n){var r;if(typeof n!="function")throw new Au("Expected a function");return t=Xe(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=T),r}}function Re(t,n,r){return n=r?T:n,t=Cr(t,8,T,T,T,T,T,n),t.placeholder=Re.placeholder,t}function We(t,n,r){return n=r?T:n,t=Cr(t,16,T,T,T,T,T,n),t.placeholder=We.placeholder,t}function Be(t,n,r){function e(n){var r=c,e=a;return c=a=T,_=n,s=t.apply(e,r); +}function u(t){var r=t-p;return t-=_,p===T||r>=n||0>r||g&&t>=l}function o(){var t=Ee();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?to(t,l-r):t,h=At(o,r)}function i(t){return h=T,d&&c?e(t):(c=a=T,s)}function f(){var t=Ee(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===T)return _=t=p,h=At(o,n),v?e(t):s;if(g)return h=At(o,n),e(p)}return h===T&&(h=At(o,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Au("Expected a function");return n=nu(n)||0,Ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Xu(nu(r.maxWait)||0,n):l, +d="trailing"in r?!!r.trailing:d),f.cancel=function(){_=0,c=p=a=h=T},f.flush=function(){return h===T?s:i(Ee())},f}function Le(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new Au("Expected a function");return r.cache=new(Le.Cache||Pt),r}function Me(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=Xu(n===T?t.length-1:Xe(n),0),function(){ +for(var e=arguments,u=-1,o=Xu(e.length-n,0),i=Array(o);++u<o;)i[u]=e[n+u];switch(n){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}for(o=Array(n+1),u=-1;++u<n;)o[u]=e[u];return o[n]=i,r(t,this,o)}}function Ce(t,n){return t===n||t!==t&&n!==n}function ze(t){return $e(t)&&Wu.call(t,"callee")&&(!qu.call(t,"callee")||"[object Arguments]"==Mu.call(t))}function Ue(t){return null!=t&&Pe(Wo(t))&&!Fe(t)}function $e(t){return Te(t)&&Ue(t)}function De(t){ +return Te(t)?"[object Error]"==Mu.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Fe(t){return t=Ze(t)?Mu.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function Ne(t){return typeof t=="number"&&t==Xe(t)}function Pe(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t}function Ze(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Te(t){return!!t&&typeof t=="object"}function qe(t){return typeof t=="number"||Te(t)&&"[object Number]"==Mu.call(t); +}function Ve(t){return!Te(t)||"[object Object]"!=Mu.call(t)||C(t)?false:(t=Ju(Object(t)),null===t?true:(t=Wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&Ru.call(t)==Lu))}function Ke(t){return Ze(t)&&"[object RegExp]"==Mu.call(t)}function Ge(t){return typeof t=="string"||!yi(t)&&Te(t)&&"[object String]"==Mu.call(t)}function Je(t){return typeof t=="symbol"||Te(t)&&"[object Symbol]"==Mu.call(t)}function Ye(t){return Te(t)&&Pe(t.length)&&!!Mt[Mu.call(t)]}function He(t){if(!t)return[]; +if(Ue(t))return Ge(t)?t.match(It):lr(t);if(Zu&&t[Zu])return z(t[Zu]());var n=qr(t);return("[object Map]"==n?U:"[object Set]"==n?D:cu)(t)}function Qe(t){return t?(t=nu(t),t===q||t===-q?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function Xe(t){t=Qe(t);var n=t%1;return t===t?n?t-n:t:0}function tu(t){return t?nn(Xe(t),0,4294967295):0}function nu(t){if(typeof t=="number")return t;if(Je(t))return V;if(Ze(t)&&(t=Fe(t.valueOf)?t.valueOf():t,t=Ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t; +t=t.replace(ct,"");var n=dt.test(t);return n||bt.test(t)?Nt(t.slice(2),n?2:8):gt.test(t)?V:+t}function ru(t){return sr(t,fu(t))}function eu(t){return null==t?"":Yn(t)}function uu(t,n,r){return t=null==t?T:vn(t,n),t===T?r:t}function ou(t,n){return null!=t&&Vr(t,n,bn)}function iu(t){var n=ee(t);if(!n&&!Ue(t))return Qu(Object(t));var r,e=Yr(t),u=!!e,e=e||[],o=e.length;for(r in t)!yn(t,r)||u&&("length"==r||Xr(r,o))||n&&"constructor"==r||e.push(r);return e}function fu(t){for(var n=-1,r=ee(t),e=En(t),u=e.length,o=Yr(t),i=!!o,o=o||[],f=o.length;++n<u;){ +var c=e[n];i&&("length"==c||Xr(c,f))||"constructor"==c&&(r||!Wu.call(t,c))||o.push(c)}return o}function cu(t){return t?k(t,iu(t)):[]}function au(t){return qi(eu(t).toLowerCase())}function lu(t){return(t=eu(t))&&t.replace(jt,W).replace(St,"")}function su(t,n,r){return t=eu(t),n=r?T:n,n===T&&(n=Bt.test(t)?Rt:st),t.match(n)||[]}function hu(t){return function(){return t}}function pu(t){return t}function _u(t){return kn(typeof t=="function"?t:rn(t,true))}function vu(t,n,r){var e=iu(n),o=_n(n,e);null!=r||Ze(n)&&(o.length||!e.length)||(r=n, +n=t,t=this,o=_n(n,iu(n)));var i=!(Ze(r)&&"chain"in r&&!r.chain),f=Fe(t);return u(o,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){var n=this.__chain__;if(i||n){var r=t(this.__wrapped__);return(r.__actions__=lr(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function gu(){}function du(t){return ne(t)?Un(fe(t)):$n(t)}function yu(){return[]}function bu(){return false}R=R?Gt.defaults({},R,Gt.pick(Kt,Lt)):Kt;var xu=R.Date,ju=R.Error,wu=R.Math,mu=R.RegExp,Au=R.TypeError,Ou=R.Array.prototype,ku=R.Object.prototype,Eu=R.String.prototype,Su=R["__core-js_shared__"],Iu=function(){ +var t=/[^.]+$/.exec(Su&&Su.keys&&Su.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ru=R.Function.prototype.toString,Wu=ku.hasOwnProperty,Bu=0,Lu=Ru.call(Object),Mu=ku.toString,Cu=Kt._,zu=mu("^"+Ru.call(Wu).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Uu=Tt?R.Buffer:T,$u=R.Reflect,Du=R.Symbol,Fu=R.Uint8Array,Nu=$u?$u.f:T,Pu=Object.getOwnPropertySymbols,Zu=typeof(Zu=Du&&Du.iterator)=="symbol"?Zu:T,Tu=Object.create,qu=ku.propertyIsEnumerable,Vu=Ou.splice,Ku=wu.ceil,Gu=wu.floor,Ju=Object.getPrototypeOf,Yu=R.isFinite,Hu=Ou.join,Qu=Object.keys,Xu=wu.max,to=wu.min,no=R.parseInt,ro=wu.random,eo=Eu.replace,uo=Ou.reverse,oo=Eu.split,io=Zr(R,"DataView"),fo=Zr(R,"Map"),co=Zr(R,"Promise"),ao=Zr(R,"Set"),lo=Zr(R,"WeakMap"),so=Zr(Object,"create"),ho=lo&&new lo,po=!qu.call({ +valueOf:1},"valueOf"),_o={},vo=ce(io),go=ce(fo),yo=ce(co),bo=ce(ao),xo=ce(lo),jo=Du?Du.prototype:T,wo=jo?jo.valueOf:T,mo=jo?jo.toString:T;Ot.templateSettings={escape:tt,evaluate:nt,interpolate:rt,variable:"",imports:{_:Ot}},Ot.prototype=kt.prototype,Ot.prototype.constructor=Ot,zt.prototype=un(kt.prototype),zt.prototype.constructor=zt,Ut.prototype=un(kt.prototype),Ut.prototype.constructor=Ut,$t.prototype.clear=function(){this.__data__=so?so(null):{}},$t.prototype["delete"]=function(t){return this.has(t)&&delete this.__data__[t]; +},$t.prototype.get=function(t){var n=this.__data__;return so?(t=n[t],"__lodash_hash_undefined__"===t?T:t):Wu.call(n,t)?n[t]:T},$t.prototype.has=function(t){var n=this.__data__;return so?n[t]!==T:Wu.call(n,t)},$t.prototype.set=function(t,n){return this.__data__[t]=so&&n===T?"__lodash_hash_undefined__":n,this},Dt.prototype.clear=function(){this.__data__=[]},Dt.prototype["delete"]=function(t){var n=this.__data__;return t=Ht(n,t),0>t?false:(t==n.length-1?n.pop():Vu.call(n,t,1),true)},Dt.prototype.get=function(t){ +var n=this.__data__;return t=Ht(n,t),0>t?T:n[t][1]},Dt.prototype.has=function(t){return-1<Ht(this.__data__,t)},Dt.prototype.set=function(t,n){var r=this.__data__,e=Ht(r,t);return 0>e?r.push([t,n]):r[e][1]=n,this},Pt.prototype.clear=function(){this.__data__={hash:new $t,map:new(fo||Dt),string:new $t}},Pt.prototype["delete"]=function(t){return Nr(this,t)["delete"](t)},Pt.prototype.get=function(t){return Nr(this,t).get(t)},Pt.prototype.has=function(t){return Nr(this,t).has(t)},Pt.prototype.set=function(t,n){ +return Nr(this,t).set(t,n),this},Zt.prototype.add=Zt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Zt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.clear=function(){this.__data__=new Dt},qt.prototype["delete"]=function(t){return this.__data__["delete"](t)},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,n){var r=this.__data__;return r instanceof Dt&&200==r.__data__.length&&(r=this.__data__=new Pt(r.__data__)), +r.set(t,n),this};var Ao=vr(hn),Oo=vr(pn,true),ko=gr(),Eo=gr(true);Nu&&!qu.call({valueOf:1},"valueOf")&&(En=function(t){return z(Nu(t))});var So=ho?function(t,n){return ho.set(t,n),t}:pu,Io=ao&&1/D(new ao([,-0]))[1]==q?function(t){return new ao(t)}:gu,Ro=ho?function(t){return ho.get(t)}:gu,Wo=Un("length");Pu||(Tr=yu);var Bo=Pu?function(t){for(var n=[];t;)s(n,Tr(t)),t=Ju(Object(t));return n}:Tr;(io&&"[object DataView]"!=qr(new io(new ArrayBuffer(1)))||fo&&"[object Map]"!=qr(new fo)||co&&"[object Promise]"!=qr(co.resolve())||ao&&"[object Set]"!=qr(new ao)||lo&&"[object WeakMap]"!=qr(new lo))&&(qr=function(t){ +var n=Mu.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?ce(t):T)switch(t){case vo:return"[object DataView]";case go:return"[object Map]";case yo:return"[object Promise]";case bo:return"[object Set]";case xo:return"[object WeakMap]"}return n});var Lo=Su?Fe:bu,Mo=function(){var t=0,n=0;return function(r,e){var u=Ee(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return So(r,e)}}(),Co=Le(function(t){var n=[];return eu(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}), +n}),zo=Me(function(t,n){return $e(t)?fn(t,sn(n,1,$e,true)):[]}),Uo=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),Fr(r)):[]}),$o=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),T,r):[]}),Do=Me(function(t){var n=l(t,rr);return n.length&&n[0]===t[0]?xn(n):[]}),Fo=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,Fr(n)):[]}),No=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,T,n):[]; +}),Po=Me(ge),Zo=Me(function(t,n){n=sn(n,1);var r=t?t.length:0,e=tn(t,n);return Fn(t,l(n,function(t){return Xr(t,r)?+t:t}).sort(fr)),e}),To=Me(function(t){return Hn(sn(t,1,$e,true))}),qo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),Fr(n))}),Vo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),T,n)}),Ko=Me(function(t,n){return $e(t)?fn(t,n):[]}),Go=Me(function(t){return tr(f(t,$e))}),Jo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),Fr(n))}),Yo=Me(function(t){ +var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),T,n)}),Ho=Me(ye),Qo=Me(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return be(t,n)}),Xo=Me(function(t){function n(n){return tn(n,t)}t=sn(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Ut&&Xr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:je,args:[n],thisArg:T}),new zt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),ti=pr(function(t,n,r){ +Wu.call(t,r)?++t[r]:t[r]=1}),ni=wr(he),ri=wr(pe),ei=pr(function(t,n,r){Wu.call(t,r)?t[r].push(n):t[r]=[n]}),ui=Me(function(t,n,e){var u=-1,o=typeof n=="function",i=ne(n),f=Ue(t)?Array(t.length):[];return Ao(t,function(t){var c=o?n:i&&null!=t?t[n]:T;f[++u]=c?r(c,t,e):wn(t,n,e)}),f}),oi=pr(function(t,n,r){t[r]=n}),ii=pr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),fi=Me(function(t,n){if(null==t)return[];var r=n.length;return r>1&&te(t,n[0],n[1])?n=[]:r>2&&te(n[0],n[1],n[2])&&(n=[n[0]]), +n=1==n.length&&yi(n[0])?n[0]:sn(n,1,Qr),Mn(t,n,[])}),ci=Me(function(t,n,r){var e=1;if(r.length)var u=$(r,Dr(ci)),e=32|e;return Cr(t,e,n,r,u)}),ai=Me(function(t,n,r){var e=3;if(r.length)var u=$(r,Dr(ai)),e=32|e;return Cr(n,e,t,r,u)}),li=Me(function(t,n){return on(t,1,n)}),si=Me(function(t,n,r){return on(t,nu(n)||0,r)});Le.Cache=Pt;var hi=Me(function(t,n){n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr()));var e=n.length;return Me(function(u){for(var o=-1,i=to(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]); +return r(t,this,u)})}),pi=Me(function(t,n){var r=$(n,Dr(pi));return Cr(t,32,T,n,r)}),_i=Me(function(t,n){var r=$(n,Dr(_i));return Cr(t,64,T,n,r)}),vi=Me(function(t,n){return Cr(t,256,T,T,T,sn(n,1))}),gi=Wr(dn),di=Wr(function(t,n){return t>=n}),yi=Array.isArray,bi=Uu?function(t){return t instanceof Uu}:bu,xi=Wr(Sn),ji=Wr(function(t,n){return n>=t}),wi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,iu(n),t);else for(var r in n)Wu.call(n,r)&&Yt(t,r,n[r])}),mi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,fu(n),t);else for(var r in n)Yt(t,r,n[r]); +}),Ai=_r(function(t,n,r,e){sr(n,fu(n),t,e)}),Oi=_r(function(t,n,r,e){sr(n,iu(n),t,e)}),ki=Me(function(t,n){return tn(t,sn(n,1))}),Ei=Me(function(t){return t.push(T,Vt),r(Ai,T,t)}),Si=Me(function(t){return t.push(T,oe),r(Li,T,t)}),Ii=Or(function(t,n,r){t[n]=r},hu(pu)),Ri=Or(function(t,n,r){Wu.call(t,n)?t[n].push(r):t[n]=[r]},Fr),Wi=Me(wn),Bi=_r(function(t,n,r){Bn(t,n,r)}),Li=_r(function(t,n,r,e){Bn(t,n,r,e)}),Mi=Me(function(t,n){return null==t?{}:(n=l(sn(n,1),fe),Cn(t,fn(gn(t,fu,Bo),n)))}),Ci=Me(function(t,n){ +return null==t?{}:Cn(t,l(sn(n,1),fe))}),zi=Mr(iu),Ui=Mr(fu),$i=br(function(t,n,r){return n=n.toLowerCase(),t+(r?au(n):n)}),Di=br(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Fi=br(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Ni=yr("toLowerCase"),Pi=br(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Zi=br(function(t,n,r){return t+(r?" ":"")+qi(n)}),Ti=br(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),qi=yr("toUpperCase"),Vi=Me(function(t,n){try{return r(t,T,n)}catch(e){ +return De(e)?e:new ju(e)}}),Ki=Me(function(t,n){return u(sn(n,1),function(n){n=fe(n),t[n]=ci(t[n],t)}),t}),Gi=mr(),Ji=mr(true),Yi=Me(function(t,n){return function(r){return wn(r,t,n)}}),Hi=Me(function(t,n){return function(r){return wn(t,r,n)}}),Qi=Er(l),Xi=Er(i),tf=Er(_),nf=Rr(),rf=Rr(true),ef=kr(function(t,n){return t+n}),uf=Lr("ceil"),of=kr(function(t,n){return t/n}),ff=Lr("floor"),cf=kr(function(t,n){return t*n}),af=Lr("round"),lf=kr(function(t,n){return t-n});return Ot.after=function(t,n){if(typeof n!="function")throw new Au("Expected a function"); +return t=Xe(t),function(){return 1>--t?n.apply(this,arguments):void 0}},Ot.ary=Se,Ot.assign=wi,Ot.assignIn=mi,Ot.assignInWith=Ai,Ot.assignWith=Oi,Ot.at=ki,Ot.before=Ie,Ot.bind=ci,Ot.bindAll=Ki,Ot.bindKey=ai,Ot.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return yi(t)?t:[t]},Ot.chain=xe,Ot.chunk=function(t,n,r){if(n=(r?te(t,n,r):n===T)?1:Xu(Xe(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Ku(r/n));r>e;)o[u++]=Tn(t,e,e+=n);return o},Ot.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++n<r;){ +var o=t[n];o&&(u[e++]=o)}return u},Ot.concat=function(){for(var t=arguments.length,n=Array(t?t-1:0),r=arguments[0],e=t;e--;)n[e-1]=arguments[e];return t?s(yi(r)?lr(r):[r],sn(n,1)):[]},Ot.cond=function(t){var n=t?t.length:0,e=Fr();return t=n?l(t,function(t){if("function"!=typeof t[1])throw new Au("Expected a function");return[e(t[0]),t[1]]}):[],Me(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e)}})},Ot.conforms=function(t){return en(rn(t,true))},Ot.constant=hu,Ot.countBy=ti, +Ot.create=function(t,n){var r=un(t);return n?Xt(r,n):r},Ot.curry=Re,Ot.curryRight=We,Ot.debounce=Be,Ot.defaults=Ei,Ot.defaultsDeep=Si,Ot.defer=li,Ot.delay=si,Ot.difference=zo,Ot.differenceBy=Uo,Ot.differenceWith=$o,Ot.drop=le,Ot.dropRight=se,Ot.dropRightWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),true,true):[]},Ot.dropWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),true):[]},Ot.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&te(t,n,r)&&(r=0,e=u),u=t.length, +r=Xe(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Xe(e),0>e&&(e+=u),e=r>e?0:tu(e);e>r;)t[r++]=n;return t},Ot.filter=function(t,n){return(yi(t)?f:ln)(t,Fr(n,3))},Ot.flatMap=function(t,n){return sn(Oe(t,n),1)},Ot.flatMapDeep=function(t,n){return sn(Oe(t,n),q)},Ot.flatMapDepth=function(t,n,r){return r=r===T?1:Xe(r),sn(Oe(t,n),r)},Ot.flatten=function(t){return t&&t.length?sn(t,1):[]},Ot.flattenDeep=function(t){return t&&t.length?sn(t,q):[]},Ot.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Xe(n),sn(t,n)):[]; +},Ot.flip=function(t){return Cr(t,512)},Ot.flow=Gi,Ot.flowRight=Ji,Ot.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n<r;){var u=t[n];e[u[0]]=u[1]}return e},Ot.functions=function(t){return null==t?[]:_n(t,iu(t))},Ot.functionsIn=function(t){return null==t?[]:_n(t,fu(t))},Ot.groupBy=ei,Ot.initial=function(t){return se(t,1)},Ot.intersection=Do,Ot.intersectionBy=Fo,Ot.intersectionWith=No,Ot.invert=Ii,Ot.invertBy=Ri,Ot.invokeMap=ui,Ot.iteratee=_u,Ot.keyBy=oi,Ot.keys=iu,Ot.keysIn=fu,Ot.map=Oe, +Ot.mapKeys=function(t,n){var r={};return n=Fr(n,3),hn(t,function(t,e,u){r[n(t,e,u)]=t}),r},Ot.mapValues=function(t,n){var r={};return n=Fr(n,3),hn(t,function(t,e,u){r[e]=n(t,e,u)}),r},Ot.matches=function(t){return Rn(rn(t,true))},Ot.matchesProperty=function(t,n){return Wn(t,rn(n,true))},Ot.memoize=Le,Ot.merge=Bi,Ot.mergeWith=Li,Ot.method=Yi,Ot.methodOf=Hi,Ot.mixin=vu,Ot.negate=function(t){if(typeof t!="function")throw new Au("Expected a function");return function(){return!t.apply(this,arguments)}},Ot.nthArg=function(t){ +return t=Xe(t),Me(function(n){return Ln(n,t)})},Ot.omit=Mi,Ot.omitBy=function(t,n){return n=Fr(n),zn(t,function(t,r){return!n(t,r)})},Ot.once=function(t){return Ie(2,t)},Ot.orderBy=function(t,n,r,e){return null==t?[]:(yi(n)||(n=null==n?[]:[n]),r=e?T:r,yi(r)||(r=null==r?[]:[r]),Mn(t,n,r))},Ot.over=Qi,Ot.overArgs=hi,Ot.overEvery=Xi,Ot.overSome=tf,Ot.partial=pi,Ot.partialRight=_i,Ot.partition=ii,Ot.pick=Ci,Ot.pickBy=function(t,n){return null==t?{}:zn(t,Fr(n))},Ot.property=du,Ot.propertyOf=function(t){ +return function(n){return null==t?T:vn(t,n)}},Ot.pull=Po,Ot.pullAll=ge,Ot.pullAllBy=function(t,n,r){return t&&t.length&&n&&n.length?Dn(t,n,Fr(r)):t},Ot.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?Dn(t,n,T,r):t},Ot.pullAt=Zo,Ot.range=nf,Ot.rangeRight=rf,Ot.rearg=vi,Ot.reject=function(t,n){var r=yi(t)?f:ln;return n=Fr(n,3),r(t,function(t,r,e){return!n(t,r,e)})},Ot.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=Fr(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i), +u.push(e))}return Fn(t,u),r},Ot.rest=Me,Ot.reverse=de,Ot.sampleSize=ke,Ot.set=function(t,n,r){return null==t?t:Zn(t,n,r)},Ot.setWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null==t?t:Zn(t,n,r,e)},Ot.shuffle=function(t){return ke(t,4294967295)},Ot.slice=function(t,n,r){var e=t?t.length:0;return e?(r&&typeof r!="number"&&te(t,n,r)?(n=0,r=e):(n=null==n?0:Xe(n),r=r===T?e:Xe(r)),Tn(t,n,r)):[]},Ot.sortBy=fi,Ot.sortedUniq=function(t){return t&&t.length?Gn(t):[]},Ot.sortedUniqBy=function(t,n){ +return t&&t.length?Gn(t,Fr(n)):[]},Ot.split=function(t,n,r){return r&&typeof r!="number"&&te(t,n,r)&&(n=r=T),r=r===T?4294967295:r>>>0,r?(t=eu(t))&&(typeof n=="string"||null!=n&&!Ke(n))&&(n=Yn(n),""==n&&Wt.test(t))?ur(t.match(It),0,r):oo.call(t,n,r):[]},Ot.spread=function(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=n===T?0:Xu(Xe(n),0),Me(function(e){var u=e[n];return e=ur(e,0,n),u&&s(e,u),r(t,this,e)})},Ot.tail=function(t){return le(t,1)},Ot.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Xe(n), +Tn(t,0,0>n?0:n)):[]},Ot.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0>n?0:n,e)):[]},Ot.takeRightWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),false,true):[]},Ot.takeWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3)):[]},Ot.tap=function(t,n){return n(t),t},Ot.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Au("Expected a function");return Ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Be(t,n,{leading:e,maxWait:n, +trailing:u})},Ot.thru=je,Ot.toArray=He,Ot.toPairs=zi,Ot.toPairsIn=Ui,Ot.toPath=function(t){return yi(t)?l(t,fe):Je(t)?[t]:lr(Co(t))},Ot.toPlainObject=ru,Ot.transform=function(t,n,r){var e=yi(t)||Ye(t);if(n=Fr(n,4),null==r)if(e||Ze(t)){var o=t.constructor;r=e?yi(t)?new o:[]:Fe(o)?un(Ju(Object(t))):{}}else r={};return(e?u:hn)(t,function(t,e,u){return n(r,t,e,u)}),r},Ot.unary=function(t){return Se(t,1)},Ot.union=To,Ot.unionBy=qo,Ot.unionWith=Vo,Ot.uniq=function(t){return t&&t.length?Hn(t):[]},Ot.uniqBy=function(t,n){ +return t&&t.length?Hn(t,Fr(n)):[]},Ot.uniqWith=function(t,n){return t&&t.length?Hn(t,T,n):[]},Ot.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ne(e,r)?[e]:er(e);r=ie(r,e),e=fe(ve(e)),r=!(null!=r&&yn(r,e))||delete r[e]}return r},Ot.unzip=ye,Ot.unzipWith=be,Ot.update=function(t,n,r){return null==t?t:Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),void 0)},Ot.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),e)),t},Ot.values=cu, +Ot.valuesIn=function(t){return null==t?[]:k(t,fu(t))},Ot.without=Ko,Ot.words=su,Ot.wrap=function(t,n){return n=null==n?pu:n,pi(n,t)},Ot.xor=Go,Ot.xorBy=Jo,Ot.xorWith=Yo,Ot.zip=Ho,Ot.zipObject=function(t,n){return nr(t||[],n||[],Yt)},Ot.zipObjectDeep=function(t,n){return nr(t||[],n||[],Zn)},Ot.zipWith=Qo,Ot.entries=zi,Ot.entriesIn=Ui,Ot.extend=mi,Ot.extendWith=Ai,vu(Ot,Ot),Ot.add=ef,Ot.attempt=Vi,Ot.camelCase=$i,Ot.capitalize=au,Ot.ceil=uf,Ot.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=nu(r), +r=r===r?r:0),n!==T&&(n=nu(n),n=n===n?n:0),nn(nu(t),n,r)},Ot.clone=function(t){return rn(t,false,true)},Ot.cloneDeep=function(t){return rn(t,true,true)},Ot.cloneDeepWith=function(t,n){return rn(t,true,true,n)},Ot.cloneWith=function(t,n){return rn(t,false,true,n)},Ot.deburr=lu,Ot.divide=of,Ot.endsWith=function(t,n,r){t=eu(t),n=Yn(n);var e=t.length;return r=r===T?e:nn(Xe(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},Ot.eq=Ce,Ot.escape=function(t){return(t=eu(t))&&X.test(t)?t.replace(H,B):t},Ot.escapeRegExp=function(t){ +return(t=eu(t))&&ft.test(t)?t.replace(it,"\\$&"):t},Ot.every=function(t,n,r){var e=yi(t)?i:cn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.find=ni,Ot.findIndex=he,Ot.findKey=function(t,n){return v(t,Fr(n,3),hn)},Ot.findLast=ri,Ot.findLastIndex=pe,Ot.findLastKey=function(t,n){return v(t,Fr(n,3),pn)},Ot.floor=ff,Ot.forEach=me,Ot.forEachRight=Ae,Ot.forIn=function(t,n){return null==t?t:ko(t,Fr(n,3),fu)},Ot.forInRight=function(t,n){return null==t?t:Eo(t,Fr(n,3),fu)},Ot.forOwn=function(t,n){return t&&hn(t,Fr(n,3)); +},Ot.forOwnRight=function(t,n){return t&&pn(t,Fr(n,3))},Ot.get=uu,Ot.gt=gi,Ot.gte=di,Ot.has=function(t,n){return null!=t&&Vr(t,n,yn)},Ot.hasIn=ou,Ot.head=_e,Ot.identity=pu,Ot.includes=function(t,n,r,e){return t=Ue(t)?t:cu(t),r=r&&!e?Xe(r):0,e=t.length,0>r&&(r=Xu(e+r,0)),Ge(t)?e>=r&&-1<t.indexOf(n,r):!!e&&-1<d(t,n,r)},Ot.indexOf=function(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:Xe(r),0>r&&(r=Xu(e+r,0)),d(t,n,r)):-1},Ot.inRange=function(t,n,r){return n=nu(n)||0,r===T?(r=n,n=0):r=nu(r)||0,t=nu(t), +t>=to(n,r)&&t<Xu(n,r)},Ot.invoke=Wi,Ot.isArguments=ze,Ot.isArray=yi,Ot.isArrayBuffer=function(t){return Te(t)&&"[object ArrayBuffer]"==Mu.call(t)},Ot.isArrayLike=Ue,Ot.isArrayLikeObject=$e,Ot.isBoolean=function(t){return true===t||false===t||Te(t)&&"[object Boolean]"==Mu.call(t)},Ot.isBuffer=bi,Ot.isDate=function(t){return Te(t)&&"[object Date]"==Mu.call(t)},Ot.isElement=function(t){return!!t&&1===t.nodeType&&Te(t)&&!Ve(t)},Ot.isEmpty=function(t){if(Ue(t)&&(yi(t)||Ge(t)||Fe(t.splice)||ze(t)||bi(t)))return!t.length; +if(Te(t)){var n=qr(t);if("[object Map]"==n||"[object Set]"==n)return!t.size}for(var r in t)if(Wu.call(t,r))return false;return!(po&&iu(t).length)},Ot.isEqual=function(t,n){return mn(t,n)},Ot.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:T)?r(t,n):T;return e===T?mn(t,n,r):!!e},Ot.isError=De,Ot.isFinite=function(t){return typeof t=="number"&&Yu(t)},Ot.isFunction=Fe,Ot.isInteger=Ne,Ot.isLength=Pe,Ot.isMap=function(t){return Te(t)&&"[object Map]"==qr(t)},Ot.isMatch=function(t,n){return t===n||An(t,n,Pr(n)); +},Ot.isMatchWith=function(t,n,r){return r=typeof r=="function"?r:T,An(t,n,Pr(n),r)},Ot.isNaN=function(t){return qe(t)&&t!=+t},Ot.isNative=function(t){if(Lo(t))throw new ju("This method is not supported with `core-js`. Try https://github.com/es-shims.");return On(t)},Ot.isNil=function(t){return null==t},Ot.isNull=function(t){return null===t},Ot.isNumber=qe,Ot.isObject=Ze,Ot.isObjectLike=Te,Ot.isPlainObject=Ve,Ot.isRegExp=Ke,Ot.isSafeInteger=function(t){return Ne(t)&&t>=-9007199254740991&&9007199254740991>=t; +},Ot.isSet=function(t){return Te(t)&&"[object Set]"==qr(t)},Ot.isString=Ge,Ot.isSymbol=Je,Ot.isTypedArray=Ye,Ot.isUndefined=function(t){return t===T},Ot.isWeakMap=function(t){return Te(t)&&"[object WeakMap]"==qr(t)},Ot.isWeakSet=function(t){return Te(t)&&"[object WeakSet]"==Mu.call(t)},Ot.join=function(t,n){return t?Hu.call(t,n):""},Ot.kebabCase=Di,Ot.last=ve,Ot.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==T&&(u=Xe(r),u=(0>u?Xu(e+u,0):to(u,e-1))+1),n!==n)return M(t,u-1,true); +for(;u--;)if(t[u]===n)return u;return-1},Ot.lowerCase=Fi,Ot.lowerFirst=Ni,Ot.lt=xi,Ot.lte=ji,Ot.max=function(t){return t&&t.length?an(t,pu,dn):T},Ot.maxBy=function(t,n){return t&&t.length?an(t,Fr(n),dn):T},Ot.mean=function(t){return b(t,pu)},Ot.meanBy=function(t,n){return b(t,Fr(n))},Ot.min=function(t){return t&&t.length?an(t,pu,Sn):T},Ot.minBy=function(t,n){return t&&t.length?an(t,Fr(n),Sn):T},Ot.stubArray=yu,Ot.stubFalse=bu,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){ +return true},Ot.multiply=cf,Ot.nth=function(t,n){return t&&t.length?Ln(t,Xe(n)):T},Ot.noConflict=function(){return Kt._===this&&(Kt._=Cu),this},Ot.noop=gu,Ot.now=Ee,Ot.pad=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return!n||e>=n?t:(n=(n-e)/2,Sr(Gu(n),r)+t+Sr(Ku(n),r))},Ot.padEnd=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?t+Sr(n-e,r):t},Ot.padStart=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?Sr(n-e,r)+t:t},Ot.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n), +t=eu(t).replace(ct,""),no(t,n||(vt.test(t)?16:10))},Ot.random=function(t,n,r){if(r&&typeof r!="boolean"&&te(t,n,r)&&(n=r=T),r===T&&(typeof n=="boolean"?(r=n,n=T):typeof t=="boolean"&&(r=t,t=T)),t===T&&n===T?(t=0,n=1):(t=nu(t)||0,n===T?(n=t,t=0):n=nu(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=ro(),to(t+r*(n-t+Ft("1e-"+((r+"").length-1))),n)):Nn(t,n)},Ot.reduce=function(t,n,r){var e=yi(t)?h:x,u=3>arguments.length;return e(t,Fr(n,4),r,u,Ao)},Ot.reduceRight=function(t,n,r){var e=yi(t)?p:x,u=3>arguments.length; +return e(t,Fr(n,4),r,u,Oo)},Ot.repeat=function(t,n,r){return n=(r?te(t,n,r):n===T)?1:Xe(n),Pn(eu(t),n)},Ot.replace=function(){var t=arguments,n=eu(t[0]);return 3>t.length?n:eo.call(n,t[1],t[2])},Ot.result=function(t,n,r){n=ne(n,t)?[n]:er(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e<u;){var o=null==t?T:t[fe(n[e])];o===T&&(e=u,o=r),t=Fe(o)?o.call(t):o}return t},Ot.round=af,Ot.runInContext=Z,Ot.sample=function(t){t=Ue(t)?t:cu(t);var n=t.length;return n>0?t[Nn(0,n-1)]:T},Ot.size=function(t){if(null==t)return 0; +if(Ue(t)){var n=t.length;return n&&Ge(t)?N(t):n}return Te(t)&&(n=qr(t),"[object Map]"==n||"[object Set]"==n)?t.size:iu(t).length},Ot.snakeCase=Pi,Ot.some=function(t,n,r){var e=yi(t)?_:qn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.sortedIndex=function(t,n){return Vn(t,n)},Ot.sortedIndexBy=function(t,n,r){return Kn(t,n,Fr(r))},Ot.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Vn(t,n);if(r>e&&Ce(t[e],n))return e}return-1},Ot.sortedLastIndex=function(t,n){return Vn(t,n,true)},Ot.sortedLastIndexBy=function(t,n,r){ +return Kn(t,n,Fr(r),true)},Ot.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Vn(t,n,true)-1;if(Ce(t[r],n))return r}return-1},Ot.startCase=Zi,Ot.startsWith=function(t,n,r){return t=eu(t),r=nn(Xe(r),0,t.length),t.lastIndexOf(Yn(n),r)==r},Ot.subtract=lf,Ot.sum=function(t){return t&&t.length?w(t,pu):0},Ot.sumBy=function(t,n){return t&&t.length?w(t,Fr(n)):0},Ot.template=function(t,n,r){var e=Ot.templateSettings;r&&te(t,n,r)&&(n=T),t=eu(t),n=Ai({},n,e,Vt),r=Ai({},n.imports,e.imports,Vt);var u,o,i=iu(r),f=k(r,i),c=0; +r=n.interpolate||wt;var a="__p+='";r=mu((n.escape||wt).source+"|"+r.source+"|"+(r===rt?pt:wt).source+"|"+(n.evaluate||wt).source+"|$","g");var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(mt,L),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(K,""):a).replace(G,"$1").replace(J,"$1;"), +a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",n=Vi(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,De(n))throw n;return n},Ot.times=function(t,n){if(t=Xe(t),1>t||t>9007199254740991)return[];var r=4294967295,e=to(t,4294967295);for(n=Fr(n),t-=4294967295,e=m(e,n);++r<t;)n(r);return e},Ot.toFinite=Qe,Ot.toInteger=Xe,Ot.toLength=tu,Ot.toLower=function(t){ +return eu(t).toLowerCase()},Ot.toNumber=nu,Ot.toSafeInteger=function(t){return nn(Xe(t),-9007199254740991,9007199254740991)},Ot.toString=eu,Ot.toUpper=function(t){return eu(t).toUpperCase()},Ot.trim=function(t,n,r){return(t=eu(t))&&(r||n===T)?t.replace(ct,""):t&&(n=Yn(n))?(t=t.match(It),n=n.match(It),ur(t,S(t,n),I(t,n)+1).join("")):t},Ot.trimEnd=function(t,n,r){return(t=eu(t))&&(r||n===T)?t.replace(lt,""):t&&(n=Yn(n))?(t=t.match(It),n=I(t,n.match(It))+1,ur(t,0,n).join("")):t},Ot.trimStart=function(t,n,r){ +return(t=eu(t))&&(r||n===T)?t.replace(at,""):t&&(n=Yn(n))?(t=t.match(It),n=S(t,n.match(It)),ur(t,n).join("")):t},Ot.truncate=function(t,n){var r=30,e="...";if(Ze(n))var u="separator"in n?n.separator:u,r="length"in n?Xe(n.length):r,e="omission"in n?Yn(n.omission):e;t=eu(t);var o=t.length;if(Wt.test(t))var i=t.match(It),o=i.length;if(r>=o)return t;if(o=r-N(e),1>o)return e;if(r=i?ur(i,0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Ke(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=mu(u.source,eu(_t.exec(u))+"g")), +u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===T?o:c)}}else t.indexOf(Yn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},Ot.unescape=function(t){return(t=eu(t))&&Q.test(t)?t.replace(Y,P):t},Ot.uniqueId=function(t){var n=++Bu;return eu(t)+n},Ot.upperCase=Ti,Ot.upperFirst=qi,Ot.each=me,Ot.eachRight=Ae,Ot.first=_e,vu(Ot,function(){var t={};return hn(Ot,function(n,r){Wu.call(Ot.prototype,r)||(t[r]=n)}),t}(),{chain:false}),Ot.VERSION="4.13.1",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){ +Ot[t].placeholder=Ot}),u(["drop","take"],function(t,n){Ut.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Ut(this);r=r===T?1:Xu(Xe(r),0);var u=this.clone();return e?u.__takeCount__=to(r,u.__takeCount__):u.__views__.push({size:to(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Ut.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Ut.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({ +iteratee:Fr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Ut.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");Ut.prototype[t]=function(){return this.__filtered__?new Ut(this):this[r](1)}}),Ut.prototype.compact=function(){return this.filter(pu)},Ut.prototype.find=function(t){return this.filter(t).head()},Ut.prototype.findLast=function(t){return this.reverse().find(t); +},Ut.prototype.invokeMap=Me(function(t,n){return typeof t=="function"?new Ut(this):this.map(function(r){return wn(r,t,n)})}),Ut.prototype.reject=function(t){return t=Fr(t,3),this.filter(function(n){return!t(n)})},Ut.prototype.slice=function(t,n){t=Xe(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Ut(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==T&&(n=Xe(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Ut.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ut.prototype.toArray=function(){ +return this.take(4294967295)},hn(Ut.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Ot[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(Ot.prototype[n]=function(){function n(t){return t=u.apply(Ot,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Ut,a=f[0],l=c||yi(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new Ut(this), +i=t.apply(i,f),i.__actions__.push({func:je,args:[n],thisArg:T}),new zt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=Ou[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Ot.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(yi(u)?u:[],t)}return this[r](function(r){return n.apply(yi(r)?r:[],t)})}}),hn(Ut.prototype,function(t,n){ +var r=Ot[n];if(r){var e=r.name+"";(_o[e]||(_o[e]=[])).push({name:n,func:r})}}),_o[Ar(T,2).name]=[{name:"wrapper",func:T}],Ut.prototype.clone=function(){var t=new Ut(this.__wrapped__);return t.__actions__=lr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=lr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=lr(this.__views__),t},Ut.prototype.reverse=function(){if(this.__filtered__){var t=new Ut(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(), +t.__dir__*=-1;return t},Ut.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=yi(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++c<a;){var l=i[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":t-=s;break;case"take":t=to(t,f+s);break;case"takeRight":f=Xu(f,t-s)}}if(t={start:f,end:t},i=t.start,f=t.end,t=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,c=0,a=to(t,this.__takeCount__),!e||200>o||o==t&&a==t)return Xn(n,this.__actions__);e=[]; +t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o<f;){var h=i[o],s=h.type,h=(0,h.iteratee)(l);if(2==s)l=h;else if(!h){if(1==s)continue t;break t}}e[c++]=l}return e},Ot.prototype.at=Xo,Ot.prototype.chain=function(){return xe(this)},Ot.prototype.commit=function(){return new zt(this.value(),this.__chain__)},Ot.prototype.next=function(){this.__values__===T&&(this.__values__=He(this.value()));var t=this.__index__>=this.__values__.length,n=t?T:this.__values__[this.__index__++];return{done:t,value:n}},Ot.prototype.plant=function(t){ +for(var n,r=this;r instanceof kt;){var e=ae(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Ot.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Ut?(this.__actions__.length&&(t=new Ut(this)),t=t.reverse(),t.__actions__.push({func:je,args:[de],thisArg:T}),new zt(t,this.__chain__)):this.thru(de)},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return Xn(this.__wrapped__,this.__actions__)},Zu&&(Ot.prototype[Zu]=we), +Ot}var T,q=1/0,V=NaN,K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/[a-zA-Z0-9]+/g,ht=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,vt=/^0x/i,gt=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,jt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,wt=/($^)/,mt=/['\n\r\u2028\u2029\\]/g,At="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",Ot="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+At,kt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",Et=RegExp("['\u2019]","g"),St=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),It=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kt+At,"g"),Rt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",Ot].join("|"),"g"),Wt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ isFinite parseInt setTimeout".split(" "),Mt={}; +Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=true,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=false; +var Ct={};Ct["[object Arguments]"]=Ct["[object Array]"]=Ct["[object ArrayBuffer]"]=Ct["[object DataView]"]=Ct["[object Boolean]"]=Ct["[object Date]"]=Ct["[object Float32Array]"]=Ct["[object Float64Array]"]=Ct["[object Int8Array]"]=Ct["[object Int16Array]"]=Ct["[object Int32Array]"]=Ct["[object Map]"]=Ct["[object Number]"]=Ct["[object Object]"]=Ct["[object RegExp]"]=Ct["[object Set]"]=Ct["[object String]"]=Ct["[object Symbol]"]=Ct["[object Uint8Array]"]=Ct["[object Uint8ClampedArray]"]=Ct["[object Uint16Array]"]=Ct["[object Uint32Array]"]=true, +Ct["[object Error]"]=Ct["[object Function]"]=Ct["[object WeakMap]"]=false;var zt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", +"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},$t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Dt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=parseFloat,Nt=parseInt,Pt=typeof exports=="object"&&exports,Zt=Pt&&typeof module=="object"&&module,Tt=Zt&&Zt.exports===Pt,qt=R(typeof self=="object"&&self),Vt=R(typeof this=="object"&&this),Kt=R(typeof global=="object"&&global)||qt||Vt||Function("return this")(),Gt=Z(); +(qt||{})._=Gt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Gt}):Zt?((Zt.exports=Gt)._=Gt,Pt._=Gt):Kt._=Gt}).call(this); \ No newline at end of file
true
Other
mrdoob
three.js
fa11f5f2120600cc5686c2fd2333057e389f15d8.json
Update GLTFLoader.parse documentation
docs/examples/loaders/GLTFLoader.html
@@ -120,14 +120,15 @@ <h3>[method:null setCrossOrigin]( [page:String value] )</h3> [page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. </div> - <h3>[method:null parse]( [page:Object json], [page:Function callBack], [page:String path] )</h3> + <h3>[method:null parse]( [page:ArrayBuffer data], [page:String path], [page:Function onLoad], [page:Function onError] )</h3> <div> - [page:Object json] — <em>JSON</em> object to parse.<br /> - [page:Function callBack] — Will be called when parse completes.<br /> + [page:ArrayBuffer data] — glTF-based ArrayBuffer or <em>JSON</em> structure String to parse.<br /> [page:String path] — The base path from which to find subsequent glTF resources such as textures and .bin data files.<br /> + [page:Function onLoad] — A function to be called when parse completes.<br /> + [page:Function onError] — (optional) A function to be called if an error occurs during parsing. The function receives error as an argument.<br /> </div> <div> - Parse a glTF-based <em>JSON</em> structure and fire [page:Function callback] when complete. The argument to [page:Function callback] will be an [page:object] that contains loaded parts: .[page:Scene scene], .[page:Array scenes], .[page:Array cameras], and .[page:Array animations]. + Parse a glTF-based ArrayBuffer or <em>JSON</em> structure String and fire [page:Function onLoad] callback when complete. The argument to [page:Function onLoad] will be an [page:object] that contains loaded parts: .[page:Scene scene], .[page:Array scenes], .[page:Array cameras], and .[page:Array animations]. </div> <h2>Source</h2>
false
Other
mrdoob
three.js
11b9d7d8ca3244322116a2e64448feb4f4ef82f9.json
reduce default particle count for IE and Edge
examples/webgl_gpgpu_protoplanet.html
@@ -266,11 +266,15 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); + var isIE = /Trident/i.test( navigator.userAgent ); + var isEdge = /Edge/i.test( navigator.userAgent ); + var hash = document.location.hash.substr( 1 ); + if ( hash ) hash = parseInt( hash, 0 ); // Texture width for simulation (each texel is a debris particle) - var WIDTH = hash || 64; + var WIDTH = hash || ( isIE || isEdge ) ? 4 : 64; var container, stats; var camera, scene, renderer, geometry, controls;
false
Other
mrdoob
three.js
8d122e7777000ecb5988615a29b3045a91f1672e.json
Use WebVR 1.1 view matrices correctly in VREffect This will make VREffect work correctly in cases where the view transforms are not simply based on the head pose with the eye translation applied. For example, they may contain eye orientation. The code is partially based on an earlier attempt to fix this by Brandon Jones, but is fixed to work in both sitting and standing examples. Related to issue #9708
examples/js/effects/VREffect.js
@@ -14,6 +14,9 @@ THREE.VREffect = function ( renderer, onError ) { var eyeTranslationL = new THREE.Vector3(); var eyeTranslationR = new THREE.Vector3(); var renderRectL, renderRectR; + var headMatrix = new THREE.Matrix4(); + var eyeMatrixL = new THREE.Matrix4(); + var eyeMatrixR = new THREE.Matrix4(); var frameData = null; @@ -241,12 +244,6 @@ THREE.VREffect = function ( renderer, onError ) { } - var eyeParamsL = vrDisplay.getEyeParameters( 'left' ); - var eyeParamsR = vrDisplay.getEyeParameters( 'right' ); - - eyeTranslationL.fromArray( eyeParamsL.offset ); - eyeTranslationR.fromArray( eyeParamsR.offset ); - if ( Array.isArray( scene ) ) { console.warn( 'THREE.VREffect.render() no longer supports arrays. Use object.layers instead.' ); @@ -310,9 +307,6 @@ THREE.VREffect = function ( renderer, onError ) { cameraR.quaternion.copy( cameraL.quaternion ); cameraR.scale.copy( cameraL.scale ); - cameraL.translateOnAxis( eyeTranslationL, cameraL.scale.x ); - cameraR.translateOnAxis( eyeTranslationR, cameraR.scale.x ); - if ( vrDisplay.getFrameData ) { vrDisplay.depthNear = camera.near; @@ -323,11 +317,30 @@ THREE.VREffect = function ( renderer, onError ) { cameraL.projectionMatrix.elements = frameData.leftProjectionMatrix; cameraR.projectionMatrix.elements = frameData.rightProjectionMatrix; + getEyeMatrices( frameData ); + + cameraL.updateMatrix(); + cameraL.matrix.multiply( eyeMatrixL ); + cameraL.matrix.decompose( cameraL.position, cameraL.quaternion, cameraL.scale ); + + cameraR.updateMatrix(); + cameraR.matrix.multiply( eyeMatrixR ); + cameraR.matrix.decompose( cameraR.position, cameraR.quaternion, cameraR.scale ); + } else { + var eyeParamsL = vrDisplay.getEyeParameters( 'left' ); + var eyeParamsR = vrDisplay.getEyeParameters( 'right' ); + cameraL.projectionMatrix = fovToProjection( eyeParamsL.fieldOfView, true, camera.near, camera.far ); cameraR.projectionMatrix = fovToProjection( eyeParamsR.fieldOfView, true, camera.near, camera.far ); + eyeTranslationL.fromArray( eyeParamsL.offset ); + eyeTranslationR.fromArray( eyeParamsR.offset ); + + cameraL.translateOnAxis( eyeTranslationL, cameraL.scale.x ); + cameraR.translateOnAxis( eyeTranslationR, cameraR.scale.x ); + } // render left eye @@ -402,6 +415,50 @@ THREE.VREffect = function ( renderer, onError ) { // + var poseOrientation = new THREE.Quaternion(); + var posePosition = new THREE.Vector3(); + + // Compute model matrices of the eyes with respect to the head. + function getEyeMatrices( frameData ) { + + // Compute the matrix for the position of the head based on the pose + if ( frameData.pose.orientation ) { + + poseOrientation.fromArray( frameData.pose.orientation ); + headMatrix.makeRotationFromQuaternion( poseOrientation ); + + } else { + + headMatrix.identity(); + + } + + if ( frameData.pose.position ) { + + posePosition.fromArray( frameData.pose.position ); + headMatrix.setPosition( posePosition ); + + } + + // The view matrix transforms vertices from sitting space to eye space. As such, the view matrix can be thought of as a product of two matrices: + // headToEyeMatrix * sittingToHeadMatrix + + // The headMatrix that we've calculated above is the model matrix of the head in sitting space, which is the inverse of sittingToHeadMatrix. + // So when we multiply the view matrix with headMatrix, we're left with headToEyeMatrix: + // viewMatrix * headMatrix = headToEyeMatrix * sittingToHeadMatrix * headMatrix = headToEyeMatrix + + eyeMatrixL.fromArray( frameData.leftViewMatrix ); + eyeMatrixL.multiply( headMatrix ); + eyeMatrixR.fromArray( frameData.rightViewMatrix ); + eyeMatrixR.multiply( headMatrix ); + + // The eye's model matrix in head space is the inverse of headToEyeMatrix we calculated above. + + eyeMatrixL.getInverse( eyeMatrixL ); + eyeMatrixR.getInverse( eyeMatrixR ); + + } + function fovToNDCScaleOffset( fov ) { var pxscale = 2.0 / ( fov.leftTan + fov.rightTan );
false
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/addons/io_three/exporter/scene.py
@@ -150,8 +150,7 @@ def write(self): if geo_type == constants.GEOMETRY.lower(): geom_data.pop(constants.DATA) elif geo_type == constants.BUFFER_GEOMETRY.lower(): - geom_data.pop(constants.ATTRIBUTES) - geom_data.pop(constants.METADATA) + geom_data.pop(constants.DATA) url = 'geometry.%s%s' % (geom.node, extension) geometry_file = os.path.join(export_dir, url)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/js/review.js
@@ -133,21 +133,20 @@ function loadGeometry( data, url ) { } - var material = new THREE.MultiMaterial( data.materials ); var mesh; if ( data.geometry.animations !== undefined && data.geometry.animations.length > 0 ) { console.log( 'loading animation' ); data.materials[ 0 ].skinning = true; - mesh = new THREE.SkinnedMesh( data.geometry, material, false ); + mesh = new THREE.SkinnedMesh( data.geometry, data.materials, false ); mixer = new THREE.AnimationMixer( mesh ); animation = mixer.clipAction( mesh.geometry.animations[ 0 ] ); } else { - mesh = new THREE.Mesh( data.geometry, material ); + mesh = new THREE.Mesh( data.geometry, data.materials ); if ( data.geometry.morphTargets.length > 0 ) {
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces + $JSON --vertices --faces --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_animation.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/anim.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --animation rest --bones --skinning \ - --embedAnimation + --embedAnimation --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_bump_spec_maps.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/planeA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures + $JSON --vertices --faces --faceMaterials --uvs --maps --exportTextures --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_diffuse_map.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures + $JSON --vertices --faces --faceMaterials --uvs --maps --exportTextures --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_influences.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/anim.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --animation --bones --skinning \ - --embedAnimation --influencesPerVertex 4 + --embedAnimation --influencesPerVertex 4 --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_lambert_material.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --faceMaterials + $JSON --vertices --faces --faceMaterials --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_light_map.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/lightmap.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures + $JSON --vertices --faces --faceMaterials --uvs --maps --exportTextures --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_mix_colors.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeB.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --colors --faceMaterials --mixColors + $JSON --vertices --faces --colors --faceMaterials --mixColors --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_morph_targets.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/anim.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --morphTargets --embedAnimation + $JSON --vertices --faces --morphTargets --embedAnimation --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_normal_map.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/planeB.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --faceMaterials --uvs --maps --normals \ - --copyTextures + --exportTextures --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_normals.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/torusA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --normals --indent + $JSON --vertices --faces --normals --indent --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_phong_material.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/torusA.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --normals --faceMaterials + $JSON --vertices --faces --normals --faceMaterials --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_vertex_colors.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeB.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --colors --faceMaterials + $JSON --vertices --faces --colors --faceMaterials --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_geometry_wireframe.bash
@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DIR/setup_test_env.bash" blender --background $BLEND/cubeC.blend --python $PYSCRIPT -- \ - $JSON --vertices --faces --faceMaterials + $JSON --vertices --faces --faceMaterials --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_area_light.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_area_light.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --lights --materials --embedGeometry + --lights --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_children.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_children.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --cameras --materials --embedGeometry --lights --cameras + --cameras --materials --embedGeometry --lights --cameras --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_directional_light.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_directional_light.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --lights --materials --embedGeometry + --lights --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_hemi_light.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_hemi_light.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --lights --materials --embedGeometry + --lights --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_instancing.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_instancing.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --scene --materials --enablePrecision \ - --precision 4 --embedGeometry --indent + --precision 4 --embedGeometry --indent --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_maps.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_maps.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --scene --materials --maps \ - --uvs --embedGeometry --copyTextures + --uvs --embedGeometry --exportTextures --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_no_embed.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_instancing.blend --python $PYSCRIPT -- \ $JSON --vertices --faces --scene --materials --enablePrecision \ - --precision 4 + --precision 4 --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_orthographic.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_orthographic_camera.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --cameras --materials --embedGeometry + --cameras --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_perspective.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_perspective_camera.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --cameras --materials --embedGeometry + --cameras --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_point_light.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_point_light.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --lights --materials --embedGeometry + --lights --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
16b938bd9d600bf887274efb8f7284fa9256cf74.json
fix some blender exporter tests
utils/exporters/blender/tests/scripts/test_scene_spot_light.bash
@@ -5,5 +5,5 @@ source "$DIR/setup_test_env.bash" blender --background $BLEND/scene_spot_light.blend \ --python $PYSCRIPT -- $JSON --vertices --faces --scene \ - --lights --materials --embedGeometry + --lights --materials --embedGeometry --geometryType Geometry makereview $@ --tag $(tagname)
true
Other
mrdoob
three.js
5989d08230a8d5a6c82cc9c70172d2c920e79b0d.json
Fix OBJExporter without normals
examples/js/exporters/OBJExporter.js
@@ -124,7 +124,7 @@ THREE.OBJExporter.prototype = { j = indices.getX( i + m ) + 1; - face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + '/' + ( indexNormals + j ); + face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + ( normals ? '/' + ( indexNormals + j ) : '' ); } @@ -141,7 +141,7 @@ THREE.OBJExporter.prototype = { j = i + m + 1; - face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + '/' + ( indexNormals + j ); + face[ m ] = ( indexVertex + j ) + '/' + ( uvs ? ( indexVertexUvs + j ) : '' ) + '/' + ( normals ? '/' + ( indexNormals + j ) : '' ); }
false
Other
mrdoob
three.js
dbb1a026f09c6ada1dbe069ce3dd460964abd9f3.json
Add OBJ loader to gltf example
examples/js/exporters/GLTFExporter.js
@@ -1487,4 +1487,4 @@ THREE.GLTFExporter.prototype = { } -}; +}; \ No newline at end of file
true
Other
mrdoob
three.js
dbb1a026f09c6ada1dbe069ce3dd460964abd9f3.json
Add OBJ loader to gltf example
examples/misc_exporter_gltf.html
@@ -26,6 +26,7 @@ <button id="export_scene">Export Scene1</button> <button id="export_scenes">Export Scene1 and Scene 2</button> <button id="export_object">Export Sphere</button> + <button id="export_obj">Export WaltHead</button> <button id="export_objects">Export Sphere and Grid</button> <button id="export_scene_object">Export Scene1 and Sphere</button> <br/> @@ -38,6 +39,7 @@ <script src="../build/three.js"></script> <script src="js/Detector.js"></script> + <script src="js/loaders/OBJLoader.js"></script> <script src="js/exporters/GLTFExporter.js"></script> <script> @@ -88,6 +90,12 @@ } ); + document.getElementById( 'export_obj' ).addEventListener( 'click', function () { + + exportGLTF( waltHead ); + + } ); + document.getElementById( 'export_objects' ).addEventListener( 'click', function () { exportGLTF( [ sphere, gridHelper ] ); @@ -133,7 +141,7 @@ var container; var camera, object, scene1, scene2, renderer; - var gridHelper, sphere; + var gridHelper, sphere, waltHead; init(); animate(); @@ -474,6 +482,20 @@ object.visible = false; scene1.add( object ); + // --------------------------------------------------------------------- + // + // + var loader = new THREE.OBJLoader(); + loader.load( 'models/obj/walt/WaltHead.obj', function ( obj ) { + + waltHead = obj; + waltHead.scale.multiplyScalar( 1.5 ); + waltHead.position.set(400, 0, 0); + scene1.add( waltHead ); + + } ); + + // --------------------------------------------------------------------- // 2nd Scene // ---------------------------------------------------------------------
true
Other
mrdoob
three.js
171de9dfbbe6c0e133408c1c0fd5e57c544690d7.json
Fix OBJ loader with empty uvs or normals
examples/js/loaders/OBJLoader.js
@@ -286,19 +286,17 @@ THREE.OBJLoader = ( function () { this.addVertex( ia, ib, ic ); - if ( ua !== undefined ) { + if ( ua !== undefined && ua !== '' ) { var uvLen = this.uvs.length; - ia = this.parseUVIndex( ua, uvLen ); ib = this.parseUVIndex( ub, uvLen ); ic = this.parseUVIndex( uc, uvLen ); - this.addUV( ia, ib, ic ); } - if ( na !== undefined ) { + if ( na !== undefined && na !== '' ) { // Normals are many times the same. If so, skip function call and parseInt. var nLen = this.normals.length;
false
Other
mrdoob
three.js
38de4ccca5ecc0df5779cbcee7a3c2f4e4f6cd64.json
Add padding to glb chunks
examples/js/exporters/GLTFExporter.js
@@ -128,7 +128,18 @@ THREE.GLTFExporter.prototype = { * @param {string} text * @return {ArrayBuffer} */ - function stringToArrayBuffer( text ) { + function stringToArrayBuffer( text, padded ) { + if ( padded ) { + + var pad = getPaddedBufferSize( text.length ) - text.length; + + for ( var i = 0; i < pad; i++ ) { + + text += ' '; + + } + + } if ( window.TextEncoder !== undefined ) { @@ -194,6 +205,28 @@ THREE.GLTFExporter.prototype = { } + /** + * Returns a buffer aligned to 4-byte boundary. + * + * @param {ArrayBuffer} arrayBuffer Buffer to pad + * @returns {ArrayBuffer} The same buffer if it's already aligned to 4-byte boundary or a new buffer + */ + function getPaddedArrayBuffer( arrayBuffer ) { + + var paddedLength = getPaddedBufferSize( arrayBuffer.byteLength ); + + if (paddedLength !== arrayBuffer.byteLength ) { + + var paddedBuffer = new ArrayBuffer( paddedLength ); + new Uint8Array( paddedBuffer ).set(new Uint8Array(arrayBuffer)); + return paddedBuffer; + + } + + return arrayBuffer; + + } + /** * Process a buffer to append to the default one. * @param {THREE.BufferAttribute} attribute Attribute to store @@ -1367,14 +1400,14 @@ THREE.GLTFExporter.prototype = { reader.onloadend = function () { // Binary chunk. - var binaryChunk = reader.result; + var binaryChunk = getPaddedArrayBuffer( reader.result ); var binaryChunkPrefix = new DataView( new ArrayBuffer( GLB_CHUNK_PREFIX_BYTES ) ); binaryChunkPrefix.setUint32( 0, binaryChunk.byteLength, true ); binaryChunkPrefix.setUint32( 4, GLB_CHUNK_TYPE_BIN, true ); // JSON chunk. delete outputJSON.buffers[ 0 ].uri; // Omitted URI indicates use of binary chunk. - var jsonChunk = stringToArrayBuffer( JSON.stringify( outputJSON ) ); + var jsonChunk = stringToArrayBuffer( JSON.stringify( outputJSON ), true ); var jsonChunkPrefix = new DataView( new ArrayBuffer( GLB_CHUNK_PREFIX_BYTES ) ); jsonChunkPrefix.setUint32( 0, jsonChunk.byteLength, true ); jsonChunkPrefix.setUint32( 4, GLB_CHUNK_TYPE_JSON, true );
false
Other
mrdoob
three.js
d45a042cf962e9b1aa9441810ba118647b48aacb.json
Allow context menu when controls are disabled
examples/js/controls/OrbitControls.js
@@ -888,6 +888,8 @@ THREE.OrbitControls = function ( object, domElement ) { function onContextMenu( event ) { + if ( scope.enabled === false ) return; + event.preventDefault(); }
false
Other
mrdoob
three.js
8d9130d3ddee37bd78c0aaf6de6da27e8f4c0c74.json
add example in list
examples/files.js
@@ -244,6 +244,7 @@ var files = { "webgl_simple_gi", "webgl_skinning_simple", "webgl_sprites", + "webgl_sprites_nodes", "webgl_terrain_dynamic", "webgl_test_memory", "webgl_test_memory2",
false
Other
mrdoob
three.js
c99579810c266ede1eaa18acee77dae55fa5c0eb.json
Add displacementMap support to distanceRGBA shader
src/renderers/shaders/ShaderLib.js
@@ -192,6 +192,7 @@ var ShaderLib = { uniforms: UniformsUtils.merge( [ UniformsLib.common, + UniformsLib.displacementmap, { lightPos: { value: new Vector3() } }
true
Other
mrdoob
three.js
c99579810c266ede1eaa18acee77dae55fa5c0eb.json
Add displacementMap support to distanceRGBA shader
src/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl
@@ -2,6 +2,7 @@ varying vec4 vWorldPosition; #include <common> #include <uv_pars_vertex> +#include <displacementmap_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <clipping_planes_pars_vertex> @@ -11,9 +12,19 @@ void main() { #include <uv_vertex> #include <skinbase_vertex> + + #ifdef USE_DISPLACEMENTMAP + + #include <beginnormal_vertex> + #include <morphnormal_vertex> + #include <skinnormal_vertex> + + #endif + #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> + #include <displacementmap_vertex> #include <project_vertex> #include <worldpos_vertex> #include <clipping_planes_vertex>
true
Other
mrdoob
three.js
9b12fad68dba3ea23ca4e5c3f8cd428f0a19ab88.json
Remove overlooked slot | 0 defensive checks.
editor/js/commands/SetMaterialColorCommand.js
@@ -20,7 +20,7 @@ var SetMaterialColorCommand = function ( object, attributeName, newValue, slot ) this.object = object; this.attributeName = attributeName; - this.slot = slot | 0; + this.slot = slot; var material = this.editor.getObjectMaterial( this.object, this.slot );
true
Other
mrdoob
three.js
9b12fad68dba3ea23ca4e5c3f8cd428f0a19ab88.json
Remove overlooked slot | 0 defensive checks.
editor/js/commands/SetMaterialCommand.js
@@ -19,7 +19,7 @@ var SetMaterialCommand = function ( object, newMaterial , slot) { this.object = object; - this.slot = slot | 0; + this.slot = slot; var material = this.editor.getObjectMaterial( this.object, this.slot );
true
Other
mrdoob
three.js
62cae272869c70d99e95f75619973cdb750f7d1d.json
Load cube map only once
examples/webgl_materials_cubemap_balls_refraction.html
@@ -77,12 +77,8 @@ var geometry = new THREE.SphereBufferGeometry( 100, 32, 16 ); - var textureCube = new THREE.CubeTextureLoader() - .setPath( 'textures/cube/Park3Med/' ) - .load( [ 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg' ] ); - textureCube.mapping = THREE.CubeRefractionMapping; - - var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube, refractionRatio: 0.95 } ); + var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: scene.background, refractionRatio: 0.95 } ); + material.envMap.mapping = THREE.CubeRefractionMapping; for ( var i = 0; i < 500; i ++ ) {
false
Other
mrdoob
three.js
a5efcd16744d1ae71d3bf80c25d361ff1e1a9f4d.json
Remove dead code.
editor/js/commands/SetMaterialColorCommand.js
@@ -24,7 +24,6 @@ var SetMaterialColorCommand = function ( object, attributeName, newValue, slot ) var material = this.editor.getObjectMaterial( this.object, this.slot ); - //this.oldValue = ( object !== undefined ) ? this.object.material[ this.attributeName ].getHex() : undefined; this.oldValue = ( material !== undefined ) ? material[ this.attributeName ].getHex() : undefined; this.newValue = newValue;
false
Other
mrdoob
three.js
4e651f4827b172960f9ff241515d190ac391f5e3.json
Add multiple material slots to three Editor.
editor/js/Editor.js
@@ -347,6 +347,38 @@ Editor.prototype = { }, + getObjectMaterial: function ( object, slot ) { + + var material = object.material; + + if( Array.isArray( material ) == true){ + var slot = slot | 0; + + if(slot < 0) slot = 0; + else if(slot >= material.length) slot = material.length; + + material = material[ slot ]; + } + + return material; + + }, + + setObjectMaterial: function ( object, slot, newMaterial ) { + + var material = object.material; + + if( Array.isArray( material ) == true){ + var slot = this.materialSlot | 0; + + if(slot < 0) slot = 0; + else if(slot >= material.length) slot = material.length; + + material[ slot ] = newMaterial; + }else + object.material = newMaterial; + }, + // select: function ( object ) {
true
Other
mrdoob
three.js
4e651f4827b172960f9ff241515d190ac391f5e3.json
Add multiple material slots to three Editor.
editor/js/Sidebar.Material.js
@@ -5,7 +5,10 @@ Sidebar.Material = function ( editor ) { var signals = editor.signals; + var currentObject; + + var currentMaterialSlot = 0; var container = new UI.Panel(); container.setBorderTop( '0' ); @@ -14,13 +17,27 @@ Sidebar.Material = function ( editor ) { // New / Copy / Paste var copiedMaterial; + var managerRow = new UI.Row(); + // Current material slot + + var materialSlotRow = new UI.Row(); + + materialSlotRow.add( new UI.Text( 'Material Slot' ).setWidth( '90px' ) ); + + var materialSlotSelect = new UI.Select().setWidth( '170px' ).setFontSize( '12px' ).onChange( update ); + + materialSlotRow.add( materialSlotSelect ); + + container.add( materialSlotRow ); + managerRow.add( new UI.Text( '' ).setWidth( '90px' ) ); + managerRow.add( new UI.Button( 'New' ).onClick( function () { var material = new THREE[ materialClass.getValue() ](); - editor.execute( new SetMaterialCommand( currentObject, material ), 'New Material: ' + materialClass.getValue() ); + editor.execute( new SetMaterialCommand( currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() ); update(); } ) ); @@ -29,13 +46,20 @@ Sidebar.Material = function ( editor ) { copiedMaterial = currentObject.material; + if( Array.isArray( copiedMaterial ) == true){ + + if( copiedMaterial.length == 0 ) return; + + copiedMaterial = copiedMaterial[ currentMaterialSlot ] + } + } ) ); managerRow.add( new UI.Button( 'Paste' ).setMarginLeft( '4px' ).onClick( function () { if ( copiedMaterial === undefined ) return; - editor.execute( new SetMaterialCommand( currentObject, copiedMaterial ), 'Pasted Material: ' + materialClass.getValue() ); + editor.execute( new SetMaterialCommand( currentObject, copiedMaterial, currentMaterialSlot ), 'Pasted Material: ' + materialClass.getValue() ); refreshUI(); update(); @@ -90,7 +114,7 @@ Sidebar.Material = function ( editor ) { var materialNameRow = new UI.Row(); var materialName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () { - editor.execute( new SetMaterialValueCommand( editor.selected, 'name', materialName.getValue() ) ); + editor.execute( new SetMaterialValueCommand( editor.selected, 'name', materialName.getValue(), currentMaterialSlot ) ); } ); @@ -410,15 +434,9 @@ Sidebar.Material = function ( editor ) { // shading var materialShadingRow = new UI.Row(); - var materialShading = new UI.Select().setOptions( { - - 0: 'No', - 1: 'Flat', - 2: 'Smooth' - - } ).setWidth( '150px' ).setFontSize( '12px' ).onChange( update ); + var materialShading = new UI.Checkbox(false).setLeft( '100px' ).onChange( update ); - materialShadingRow.add( new UI.Text( 'Shading' ).setWidth( '90px' ) ); + materialShadingRow.add( new UI.Text( 'Flat Shaded' ).setWidth( '90px' ) ); materialShadingRow.add( materialShading ); container.add( materialShadingRow ); @@ -493,6 +511,15 @@ Sidebar.Material = function ( editor ) { var geometry = object.geometry; var material = object.material; + var previousSelectedSlot = currentMaterialSlot; + + currentMaterialSlot = materialSlotSelect.getValue() | 0; + + if( currentMaterialSlot != previousSelectedSlot ) + refreshUI(true); + + material = editor.getObjectMaterial( currentObject, currentMaterialSlot ) + var textureWarning = false; var objectHasUvs = false; @@ -504,15 +531,15 @@ Sidebar.Material = function ( editor ) { if ( material.uuid !== undefined && material.uuid !== materialUUID.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'uuid', materialUUID.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'uuid', materialUUID.getValue(), currentMaterialSlot ) ); } if ( material instanceof THREE[ materialClass.getValue() ] === false ) { material = new THREE[ materialClass.getValue() ](); - editor.execute( new SetMaterialCommand( currentObject, material ), 'New Material: ' + materialClass.getValue() ); + editor.execute( new SetMaterialCommand( currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() ); // TODO Copy other references in the scene graph // keeping name and UUID then. // Also there should be means to create a unique @@ -523,49 +550,49 @@ Sidebar.Material = function ( editor ) { if ( material.color !== undefined && material.color.getHex() !== materialColor.getHexValue() ) { - editor.execute( new SetMaterialColorCommand( currentObject, 'color', materialColor.getHexValue() ) ); + editor.execute( new SetMaterialColorCommand( currentObject, 'color', materialColor.getHexValue(), currentMaterialSlot ) ); } if ( material.roughness !== undefined && Math.abs( material.roughness - materialRoughness.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'roughness', materialRoughness.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'roughness', materialRoughness.getValue(), currentMaterialSlot ) ); } if ( material.metalness !== undefined && Math.abs( material.metalness - materialMetalness.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'metalness', materialMetalness.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'metalness', materialMetalness.getValue(), currentMaterialSlot ) ); } if ( material.emissive !== undefined && material.emissive.getHex() !== materialEmissive.getHexValue() ) { - editor.execute( new SetMaterialColorCommand( currentObject, 'emissive', materialEmissive.getHexValue() ) ); + editor.execute( new SetMaterialColorCommand( currentObject, 'emissive', materialEmissive.getHexValue(), currentMaterialSlot ) ); } if ( material.specular !== undefined && material.specular.getHex() !== materialSpecular.getHexValue() ) { - editor.execute( new SetMaterialColorCommand( currentObject, 'specular', materialSpecular.getHexValue() ) ); + editor.execute( new SetMaterialColorCommand( currentObject, 'specular', materialSpecular.getHexValue(), currentMaterialSlot ) ); } if ( material.shininess !== undefined && Math.abs( material.shininess - materialShininess.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'shininess', materialShininess.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'shininess', materialShininess.getValue(), currentMaterialSlot ) ); } if ( material.clearCoat !== undefined && Math.abs( material.clearCoat - materialClearCoat.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'clearCoat', materialClearCoat.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'clearCoat', materialClearCoat.getValue(), currentMaterialSlot ) ); } if ( material.clearCoatRoughness !== undefined && Math.abs( material.clearCoatRoughness - materialClearCoatRoughness.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'clearCoatRoughness', materialClearCoatRoughness.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'clearCoatRoughness', materialClearCoatRoughness.getValue(), currentMaterialSlot ) ); } @@ -575,15 +602,15 @@ Sidebar.Material = function ( editor ) { if ( material.vertexColors !== vertexColors ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'vertexColors', vertexColors ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'vertexColors', vertexColors, currentMaterialSlot ) ); } } if ( material.skinning !== undefined && material.skinning !== materialSkinning.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'skinning', materialSkinning.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'skinning', materialSkinning.getValue(), currentMaterialSlot ) ); } @@ -596,7 +623,7 @@ Sidebar.Material = function ( editor ) { var map = mapEnabled ? materialMap.getValue() : null; if ( material.map !== map ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'map', map ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'map', map, currentMaterialSlot ) ); } @@ -617,7 +644,7 @@ Sidebar.Material = function ( editor ) { var alphaMap = mapEnabled ? materialAlphaMap.getValue() : null; if ( material.alphaMap !== alphaMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'alphaMap', alphaMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'alphaMap', alphaMap, currentMaterialSlot ) ); } @@ -638,13 +665,13 @@ Sidebar.Material = function ( editor ) { var bumpMap = bumpMapEnabled ? materialBumpMap.getValue() : null; if ( material.bumpMap !== bumpMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'bumpMap', bumpMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'bumpMap', bumpMap, currentMaterialSlot ) ); } if ( material.bumpScale !== materialBumpScale.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'bumpScale', materialBumpScale.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'bumpScale', materialBumpScale.getValue(), currentMaterialSlot ) ); } @@ -665,7 +692,7 @@ Sidebar.Material = function ( editor ) { var normalMap = normalMapEnabled ? materialNormalMap.getValue() : null; if ( material.normalMap !== normalMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'normalMap', normalMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'normalMap', normalMap, currentMaterialSlot ) ); } @@ -686,13 +713,13 @@ Sidebar.Material = function ( editor ) { var displacementMap = displacementMapEnabled ? materialDisplacementMap.getValue() : null; if ( material.displacementMap !== displacementMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'displacementMap', displacementMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'displacementMap', displacementMap, currentMaterialSlot ) ); } if ( material.displacementScale !== materialDisplacementScale.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'displacementScale', materialDisplacementScale.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'displacementScale', materialDisplacementScale.getValue(), currentMaterialSlot ) ); } @@ -713,7 +740,7 @@ Sidebar.Material = function ( editor ) { var roughnessMap = roughnessMapEnabled ? materialRoughnessMap.getValue() : null; if ( material.roughnessMap !== roughnessMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'roughnessMap', roughnessMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'roughnessMap', roughnessMap, currentMaterialSlot ) ); } @@ -734,7 +761,7 @@ Sidebar.Material = function ( editor ) { var metalnessMap = metalnessMapEnabled ? materialMetalnessMap.getValue() : null; if ( material.metalnessMap !== metalnessMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'metalnessMap', metalnessMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'metalnessMap', metalnessMap, currentMaterialSlot ) ); } @@ -755,7 +782,7 @@ Sidebar.Material = function ( editor ) { var specularMap = specularMapEnabled ? materialSpecularMap.getValue() : null; if ( material.specularMap !== specularMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'specularMap', specularMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'specularMap', specularMap, currentMaterialSlot ) ); } @@ -775,7 +802,7 @@ Sidebar.Material = function ( editor ) { if ( material.envMap !== envMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'envMap', envMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'envMap', envMap, currentMaterialSlot ) ); } @@ -787,7 +814,7 @@ Sidebar.Material = function ( editor ) { if ( material.reflectivity !== reflectivity ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'reflectivity', reflectivity ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'reflectivity', reflectivity, currentMaterialSlot ) ); } @@ -802,7 +829,7 @@ Sidebar.Material = function ( editor ) { var lightMap = lightMapEnabled ? materialLightMap.getValue() : null; if ( material.lightMap !== lightMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'lightMap', lightMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'lightMap', lightMap, currentMaterialSlot ) ); } @@ -823,13 +850,13 @@ Sidebar.Material = function ( editor ) { var aoMap = aoMapEnabled ? materialAOMap.getValue() : null; if ( material.aoMap !== aoMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'aoMap', aoMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'aoMap', aoMap, currentMaterialSlot ) ); } if ( material.aoMapIntensity !== materialAOScale.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'aoMapIntensity', materialAOScale.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'aoMapIntensity', materialAOScale.getValue(), currentMaterialSlot ) ); } @@ -850,7 +877,7 @@ Sidebar.Material = function ( editor ) { var emissiveMap = emissiveMapEnabled ? materialEmissiveMap.getValue() : null; if ( material.emissiveMap !== emissiveMap ) { - editor.execute( new SetMaterialMapCommand( currentObject, 'emissiveMap', emissiveMap ) ); + editor.execute( new SetMaterialMapCommand( currentObject, 'emissiveMap', emissiveMap, currentMaterialSlot ) ); } @@ -867,19 +894,19 @@ Sidebar.Material = function ( editor ) { var side = parseInt( materialSide.getValue() ); if ( material.side !== side ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'side', side ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'side', side, currentMaterialSlot ) ); } } - if ( material.shading !== undefined ) { + if ( material.flatShading !== undefined ) { - var shading = parseInt( materialShading.getValue() ); - if ( material.shading !== shading ) { + var flatShading = materialShading.getValue(); + if ( material.flatShading != flatShading ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'shading', shading ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'flatShading', flatShading, currentMaterialSlot ) ); } @@ -890,39 +917,39 @@ Sidebar.Material = function ( editor ) { var blending = parseInt( materialBlending.getValue() ); if ( material.blending !== blending ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'blending', blending ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'blending', blending, currentMaterialSlot ) ); } } if ( material.opacity !== undefined && Math.abs( material.opacity - materialOpacity.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'opacity', materialOpacity.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'opacity', materialOpacity.getValue(), currentMaterialSlot ) ); } if ( material.transparent !== undefined && material.transparent !== materialTransparent.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'transparent', materialTransparent.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'transparent', materialTransparent.getValue(), currentMaterialSlot ) ); } if ( material.alphaTest !== undefined && Math.abs( material.alphaTest - materialAlphaTest.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'alphaTest', materialAlphaTest.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'alphaTest', materialAlphaTest.getValue(), currentMaterialSlot ) ); } if ( material.wireframe !== undefined && material.wireframe !== materialWireframe.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue(), currentMaterialSlot) ); } if ( material.wireframeLinewidth !== undefined && Math.abs( material.wireframeLinewidth - materialWireframeLinewidth.getValue() ) >= 0.01 ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'wireframeLinewidth', materialWireframeLinewidth.getValue() ) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'wireframeLinewidth', materialWireframeLinewidth.getValue(), currentMaterialSlot ) ); } @@ -968,7 +995,7 @@ Sidebar.Material = function ( editor ) { 'aoMap': materialAOMapRow, 'emissiveMap': materialEmissiveMapRow, 'side': materialSideRow, - 'shading': materialShadingRow, + 'flatShading': materialShadingRow, 'blending': materialBlendingRow, 'opacity': materialOpacityRow, 'transparent': materialTransparentRow, @@ -978,6 +1005,13 @@ Sidebar.Material = function ( editor ) { var material = currentObject.material; + if( Array.isArray( material ) == true){ + + if( material.length == 0 ) return; + + material = material[0] + } + for ( var property in properties ) { properties[ property ].setDisplay( material[ property ] !== undefined ? '' : 'none' ); @@ -993,6 +1027,46 @@ Sidebar.Material = function ( editor ) { var material = currentObject.material; + var materialArray = [] + + if( Array.isArray( material ) == true){ + + if( material.length == 0 ){ + + currentMaterialSlot = 0; + + materialArray = [undefined]; + + }else{ + + materialArray = material; + + } + + } else { + + materialArray = [material]; + + } + + var slotOptions = {}; + + if( ( currentMaterialSlot < 0 ) || ( currentMaterialSlot >= materialArray.length ) ) currentMaterialSlot = 0; + + for( var i=0; i < materialArray.length; i++){ + + var material = materialArray[ i ]; + + var label = material ? ( material.name == '' ? '[Unnamed]' : material.name ) : '[No Material]'; + + slotOptions[i] = '' + (i+1) + ':' + materialArray.length + ' ' + label; + } + + materialSlotSelect.setOptions(slotOptions).setValue( currentMaterialSlot ) + + material = editor.getObjectMaterial( currentObject, currentMaterialSlot ); + + if ( material.uuid !== undefined ) { materialUUID.setValue( material.uuid ); @@ -1229,9 +1303,9 @@ Sidebar.Material = function ( editor ) { } - if ( material.shading !== undefined ) { + if ( material.flatShading !== undefined ) { - materialShading.setValue( material.shading ); + materialShading.setValue( material.flatShading ); } @@ -1278,9 +1352,14 @@ Sidebar.Material = function ( editor ) { // events signals.objectSelected.add( function ( object ) { + var hasMaterial = false + + if ( object && object.material ) { + if( ( Array.isArray( object.material ) === false ) || ( object.material.length > 0 ) ) + hasMaterial = true; + } - if ( object && object.material && - Array.isArray( object.material ) === false ) { + if( hasMaterial ){ var objectChanged = object !== currentObject;
true
Other
mrdoob
three.js
4e651f4827b172960f9ff241515d190ac391f5e3.json
Add multiple material slots to three Editor.
editor/js/commands/SetMaterialColorCommand.js
@@ -10,7 +10,7 @@ * @constructor */ -var SetMaterialColorCommand = function ( object, attributeName, newValue ) { +var SetMaterialColorCommand = function ( object, attributeName, newValue, slot ) { Command.call( this ); @@ -20,24 +20,30 @@ var SetMaterialColorCommand = function ( object, attributeName, newValue ) { this.object = object; this.attributeName = attributeName; - this.oldValue = ( object !== undefined ) ? this.object.material[ this.attributeName ].getHex() : undefined; - this.newValue = newValue; + this.slot = slot | 0; + + var material = this.editor.getObjectMaterial( this.object, this.slot ); + //this.oldValue = ( object !== undefined ) ? this.object.material[ this.attributeName ].getHex() : undefined; + this.oldValue = ( material !== undefined ) ? material[ this.attributeName ].getHex() : undefined; + this.newValue = newValue; + }; SetMaterialColorCommand.prototype = { execute: function () { - - this.object.material[ this.attributeName ].setHex( this.newValue ); - this.editor.signals.materialChanged.dispatch( this.object.material ); + var material = this.editor.getObjectMaterial( this.object, this.slot ) + material[ this.attributeName ].setHex( this.newValue ); + this.editor.signals.materialChanged.dispatch( material ); }, undo: function () { + var material = this.editor.getObjectMaterial( this.object, this.slot ) - this.object.material[ this.attributeName ].setHex( this.oldValue ); - this.editor.signals.materialChanged.dispatch( this.object.material ); + material[ this.attributeName ].setHex( this.oldValue ); + this.editor.signals.materialChanged.dispatch( material ); },
true
Other
mrdoob
three.js
4e651f4827b172960f9ff241515d190ac391f5e3.json
Add multiple material slots to three Editor.
editor/js/commands/SetMaterialCommand.js
@@ -9,31 +9,40 @@ * @constructor */ -var SetMaterialCommand = function ( object, newMaterial ) { + +var SetMaterialCommand = function ( object, newMaterial , slot) { Command.call( this ); this.type = 'SetMaterialCommand'; this.name = 'New Material'; this.object = object; - this.oldMaterial = ( object !== undefined ) ? object.material : undefined; - this.newMaterial = newMaterial; + this.slot = slot | 0; + + var material = this.editor.getObjectMaterial( this.object, this.slot ); + + this.oldMaterial = material; + + this.newMaterial = newMaterial; + }; SetMaterialCommand.prototype = { execute: function () { + + this.editor.setObjectMaterial( this.object, this.slot, this.newMaterial ); - this.object.material = this.newMaterial; this.editor.signals.materialChanged.dispatch( this.newMaterial ); }, undo: function () { + + this.editor.setObjectMaterial( this.object, this.slot, this.oldMaterial ); - this.object.material = this.oldMaterial; this.editor.signals.materialChanged.dispatch( this.oldMaterial ); },
true
Other
mrdoob
three.js
4e651f4827b172960f9ff241515d190ac391f5e3.json
Add multiple material slots to three Editor.
editor/js/commands/SetMaterialValueCommand.js
@@ -10,16 +10,20 @@ * @constructor */ -var SetMaterialValueCommand = function ( object, attributeName, newValue ) { +var SetMaterialValueCommand = function ( object, attributeName, newValue, slot ) { Command.call( this ); this.type = 'SetMaterialValueCommand'; this.name = 'Set Material.' + attributeName; this.updatable = true; + this.slot = slot; this.object = object; - this.oldValue = ( object !== undefined ) ? object.material[ attributeName ] : undefined; + + var material = this.editor.getObjectMaterial( this.object, this.slot ); + + this.oldValue = ( material !== undefined ) ? material[ attributeName ] : undefined; this.newValue = newValue; this.attributeName = attributeName; @@ -28,20 +32,21 @@ var SetMaterialValueCommand = function ( object, attributeName, newValue ) { SetMaterialValueCommand.prototype = { execute: function () { - - this.object.material[ this.attributeName ] = this.newValue; - this.object.material.needsUpdate = true; + var material = this.editor.getObjectMaterial( this.object, this.slot ); + material[ this.attributeName ] = this.newValue; + material.needsUpdate = true; this.editor.signals.objectChanged.dispatch( this.object ); - this.editor.signals.materialChanged.dispatch( this.object.material ); + this.editor.signals.materialChanged.dispatch( material ); }, undo: function () { + var material = this.editor.getObjectMaterial( this.object, this.slot ); - this.object.material[ this.attributeName ] = this.oldValue; - this.object.material.needsUpdate = true; + material[ this.attributeName ] = this.oldValue; + material.needsUpdate = true; this.editor.signals.objectChanged.dispatch( this.object ); - this.editor.signals.materialChanged.dispatch( this.object.material ); + this.editor.signals.materialChanged.dispatch( material ); },
true
Other
mrdoob
three.js
4205deffbee6a6c094546913af77903a82be3494.json
Improve introduction doc fixing small scope issues Small issues: - Missing `var` keywords - Multiple left-hand assignments declaring global variables, more info: http://stackoverflow.com/questions/1758576/multiple-left-hand-assignment-with-javascript
docs/manual/introduction/How-to-update-things.html
@@ -69,14 +69,14 @@ <h3>[page:BufferGeometry]</h3> geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); // draw range -drawCount = 2; // draw the first 2 points, only +var drawCount = 2; // draw the first 2 points, only geometry.setDrawRange( 0, drawCount ); // material var material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 2 } ); // line -line = new THREE.Line( geometry, material ); +var line = new THREE.Line( geometry, material ); scene.add( line ); </code> <p> @@ -85,7 +85,8 @@ <h3>[page:BufferGeometry]</h3> <code> var positions = line.geometry.attributes.position.array; -var x = y = z = index = 0; +var x, y, z, index; +x = y = z = index = 0; for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {
false
Other
mrdoob
three.js
f9f4827a5959678f9de40e4ba88e1a97e30504fa.json
fix comparison with -0 in Math.js
test/unit/src/math/Math.js
@@ -24,12 +24,21 @@ QUnit.test( "Math.sign/polyfill", function( assert ) { assert.ok( isNaN( Math.sign(new THREE.Vector3()) ) , "If x is NaN<object>, the result is NaN."); assert.ok( isNaN( Math.sign() ) , "If x is NaN<undefined>, the result is NaN."); assert.ok( isNaN( Math.sign('--3') ) , "If x is NaN<'--3'>, the result is NaN."); - assert.ok( Math.sign(-0) === -0 , "If x is -0, the result is -0."); + assert.ok( isNegativeZero( Math.sign(-0) ) , "If x is -0, the result is -0."); assert.ok( Math.sign(+0) === +0 , "If x is +0, the result is +0."); assert.ok( Math.sign(-Infinity) === -1 , "If x is negative<-Infinity> and not -0, the result is -1."); assert.ok( Math.sign('-3') === -1 , "If x is negative<'-3'> and not -0, the result is -1."); assert.ok( Math.sign('-1e-10') === -1 , "If x is negative<'-1e-10'> and not -0, the result is -1."); assert.ok( Math.sign(+Infinity) === +1 , "If x is positive<+Infinity> and not +0, the result is +1."); assert.ok( Math.sign('+3') === +1 , "If x is positive<'+3'> and not +0, the result is +1."); + // Comparing with -0 is tricky because 0 === -0. But + // luckily 1 / -0 === -Infinity so we can use that. + + function isNegativeZero( value ) { + + return value === 0 && 1 / value < 0; + + } + });
false
Other
mrdoob
three.js
c9a85c59f821841872daf13f5e1fc7111d11bc2c.json
Remove return statement from .update()
src/helpers/FaceNormalsHelper.js
@@ -110,8 +110,6 @@ FaceNormalsHelper.prototype.update = ( function () { position.needsUpdate = true; - return this; - }; }() );
false
Other
mrdoob
three.js
10c8fcaa50c1c620d0deb4800490fb29742777a1.json
Remove return statement from .update()
src/helpers/VertexNormalsHelper.js
@@ -145,8 +145,6 @@ VertexNormalsHelper.prototype.update = ( function () { position.needsUpdate = true; - return this; - }; }() );
false
Other
mrdoob
three.js
f3258e2d0b91b1bd65a4ace0e8abfb829699c1cb.json
Remove unintelligible part of explanation Not sure if the points are added to or replace present content of the curve?
docs/api/extras/core/Path.html
@@ -98,7 +98,7 @@ <h3>[method:null fromPoints]( [page:Array vector2s] )</h3> <div> points -- array of [page:Vector2 Vector2s].<br /><br /> - Adds to the from the points. Points are added to the [page:CurvePath.curves curves] + Points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves]. </div>
false
Other
mrdoob
three.js
89a944794d2021876feaa2ab316b589006d1de6a.json
fix index error in example
docs/api/core/Geometry.html
@@ -159,8 +159,8 @@ <h3>[property:Array skinIndices]</h3> In code another example could look like this: <code> // e.g. - geometry.skinIndices[15] = new THREE.Vector4( 0, 5, 9, 0 ); - geometry.skinWeights[15] = new THREE.Vector4( 0.2, 0.5, 0.3, 0 ); + geometry.skinIndices[15] = new THREE.Vector4( 0, 5, 9, 10 ); + geometry.skinWeights[15] = new THREE.Vector4( 0.2, 0.5, 0.3, 0 ); // corresponds with the following vertex geometry.vertices[15];
false
Other
mrdoob
three.js
f095b7979d1dfbd3fd38f15dffd944629f0e66f3.json
fix typo Mixin => Mixing
docs/api/core/EventDispatcher.html
@@ -1,100 +1,100 @@ -<!DOCTYPE html> -<html lang="en"> - <head> +<!DOCTYPE html> +<html lang="en"> + <head> <meta charset="utf-8" /> - <base href="../../" /> - <script src="list.js"></script> - <script src="page.js"></script> - <link type="text/css" rel="stylesheet" href="page.css" /> - </head> - <body> - <h1>[name]</h1> - - <div class="desc"> - JavaScript events for custom objects.<br /> - [link:https://github.com/mrdoob/eventdispatcher.js Eventdispatcher on GitHub] - </div> - - <h2>Example</h2> - - <code> -// Adding events to a custom object - -var Car = function () { - - this.start = function () { - - this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } ); - - }; - -}; - -// Mixin the EventDispatcher.prototype with the custom object prototype - -Object.assign( Car.prototype, EventDispatcher.prototype ); - -// Using events with the custom object - -var car = new Car(); - -car.addEventListener( 'start', function ( event ) { - - alert( event.message ); - -} ); - -car.start(); - </code> - - <h2>Constructor</h2> - - <h3>[name]()</h3> - <div> - Creates EventDispatcher object. - </div> - - - <h2>Methods</h2> - - <h3>[method:null addEventListener]( [page:String type], [page:Function listener] )</h3> - <div> - type - The type of event to listen to.<br /> - listener - The function that gets called when the event is fired. - </div> - <div> - Adds a listener to an event type. - </div> - - <h3>[method:Boolean hasEventListener]( [page:String type], [page:Function listener] )</h3> - <div> - type - The type of event to listen to.<br /> - listener - The function that gets called when the event is fired. - </div> - <div> - Checks if listener is added to an event type. - </div> - - <h3>[method:null removeEventListener]( [page:String type], [page:Function listener] )</h3> - <div> - type - The type of the listener that gets removed.<br /> - listener - The listener function that gets removed. - </div> - <div> - Removes a listener from an event type. - </div> - - <h3>[method:null dispatchEvent]( [page:object event] )</h3> - <div> - event - The event that gets fired. - </div> - <div> - Fire an event type. - </div> - - - <h2>Source</h2> - - [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] - </body> -</html> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + <h1>[name]</h1> + + <div class="desc"> + JavaScript events for custom objects.<br /> + [link:https://github.com/mrdoob/eventdispatcher.js Eventdispatcher on GitHub] + </div> + + <h2>Example</h2> + + <code> +// Adding events to a custom object + +var Car = function () { + + this.start = function () { + + this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } ); + + }; + +}; + +// Mixing the EventDispatcher.prototype with the custom object prototype + +Object.assign( Car.prototype, EventDispatcher.prototype ); + +// Using events with the custom object + +var car = new Car(); + +car.addEventListener( 'start', function ( event ) { + + alert( event.message ); + +} ); + +car.start(); + </code> + + <h2>Constructor</h2> + + <h3>[name]()</h3> + <div> + Creates EventDispatcher object. + </div> + + + <h2>Methods</h2> + + <h3>[method:null addEventListener]( [page:String type], [page:Function listener] )</h3> + <div> + type - The type of event to listen to.<br /> + listener - The function that gets called when the event is fired. + </div> + <div> + Adds a listener to an event type. + </div> + + <h3>[method:Boolean hasEventListener]( [page:String type], [page:Function listener] )</h3> + <div> + type - The type of event to listen to.<br /> + listener - The function that gets called when the event is fired. + </div> + <div> + Checks if listener is added to an event type. + </div> + + <h3>[method:null removeEventListener]( [page:String type], [page:Function listener] )</h3> + <div> + type - The type of the listener that gets removed.<br /> + listener - The listener function that gets removed. + </div> + <div> + Removes a listener from an event type. + </div> + + <h3>[method:null dispatchEvent]( [page:object event] )</h3> + <div> + event - The event that gets fired. + </div> + <div> + Fire an event type. + </div> + + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + </body> +</html>
false
Other
mrdoob
three.js
40b030addac577fd823bf1997d546ce63bb3241b.json
remove duplicate verticesNeedUpdate
docs/api/core/DirectGeometry.html
@@ -82,9 +82,6 @@ <h3>[property:Boolean verticesNeedUpdate]</h3> <h3>[property:Boolean normalsNeedUpdate]</h3> <div>Default is false.</div> - <h3>[property:Boolean verticesNeedUpdate]</h3> - <div>Default is false.</div> - <h3>[property:Boolean colorsNeedUpdate]</h3> <div>Default is false.</div>
false
Other
mrdoob
three.js
57a483cfb8dbeb3e7a33af69f07bf10e6ec92e7d.json
remove unicode character from EllipseCurve.js
src/extras/curves/EllipseCurve.js
@@ -14,7 +14,7 @@ function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockw this.xRadius = xRadius || 1; this.yRadius = yRadius || 1; - this.aStartAngle = aStartAngle || 0; + this.aStartAngle = aStartAngle || 0; this.aEndAngle = aEndAngle || 2 * Math.PI; this.aClockwise = aClockwise || false;
false
Other
mrdoob
three.js
0c37de10c09937193fec289d29eaea4edb33c81a.json
Generalize Reflector geometry
examples/js/objects/Reflector.js
@@ -2,9 +2,9 @@ * @author Slayvin / http://slayvin.net */ -THREE.Reflector = function ( width, height, options ) { +THREE.Reflector = function ( geometry, options ) { - THREE.Mesh.call( this, new THREE.PlaneBufferGeometry( width, height ) ); + THREE.Mesh.call( this, geometry ); this.type = 'Reflector'; @@ -65,15 +65,15 @@ THREE.Reflector = function ( width, height, options ) { this.material = material; - this.onBeforeRender = function ( renderer, scene, camera ) { - - if ( 'recursion' in camera.userData ) { - - if ( camera.userData.recursion === recursion ) return; - - camera.userData.recursion ++; - - } + this.onBeforeRender = function ( renderer, scene, camera ) { + + if ( 'recursion' in camera.userData ) { + + if ( camera.userData.recursion === recursion ) return; + + camera.userData.recursion ++; + + } reflectorWorldPosition.setFromMatrixPosition( scope.matrixWorld ); cameraWorldPosition.setFromMatrixPosition( camera.matrixWorld );
true
Other
mrdoob
three.js
0c37de10c09937193fec289d29eaea4edb33c81a.json
Generalize Reflector geometry
examples/webgl_mirror.html
@@ -86,9 +86,10 @@ var planeGeo = new THREE.PlaneBufferGeometry( 100.1, 100.1 ); - // reflector/mirror planes + // reflectors/mirrors - var groundMirror = new THREE.Reflector( 100, 100, { + var geometry = new THREE.PlaneBufferGeometry( 100, 100 ); + var groundMirror = new THREE.Reflector( geometry, { clipBias: 0.003, textureWidth: WIDTH * window.devicePixelRatio, textureHeight: HEIGHT * window.devicePixelRatio, @@ -98,14 +99,15 @@ groundMirror.rotateX( - Math.PI / 2 ); scene.add( groundMirror ); - var verticalMirror = new THREE.Reflector( 60, 60, { + var geometry = new THREE.CircleBufferGeometry( 40, 6 ); + var verticalMirror = new THREE.Reflector( geometry, { clipBias: 0.003, textureWidth: WIDTH * window.devicePixelRatio, textureHeight: HEIGHT * window.devicePixelRatio, color: 0x889999, recursion: 1 } ); - verticalMirror.position.y = 35; + verticalMirror.position.y = 50; verticalMirror.position.z = -45; scene.add( verticalMirror );
true
Other
mrdoob
three.js
0ebf4a2669354109f449aca431abddaf8cb49439.json
Prevent needsUpdate true every frame
examples/webgl_materials_channels.html
@@ -63,6 +63,12 @@ side: 'double' }; + var sides = { + 'front': THREE.FrontSide, + 'back': THREE.BackSide, + 'double': THREE.DoubleSide + }; + var cameraOrtho, cameraPerspective; var controlsOrtho, controlsPerspective; @@ -277,7 +283,7 @@ } - if ( params.side !== material.side ) { + if ( sides[ params.side ] !== material.side ) { switch ( params.side ) {
false
Other
mrdoob
three.js
9be2ae09e964443672dc014ced3378283fa81bf0.json
Set local path like in GLTFLoader
examples/js/loaders/ColladaLoader.js
@@ -19,7 +19,7 @@ THREE.ColladaLoader.prototype = { var scope = this; - scope.path = scope.path === undefined ? THREE.Loader.prototype.extractUrlBase( url ) : scope.path; + var path = scope.path === undefined ? THREE.Loader.prototype.extractUrlBase( url ) : scope.path; var loader = new THREE.FileLoader( scope.manager ); loader.setPath( scope.path );
false
Other
mrdoob
three.js
24acde9a7581a1529e5a0452b1d80899b4bf8f8b.json
Add envmap to glTF 2.0 demo.
examples/webgl_loader_gltf2.html
@@ -253,6 +253,25 @@ if (sceneInfo.objectScale) object.scale.copy(sceneInfo.objectScale); + if ( sceneInfo.addEnvMap ) { + + var envMap = getEnvMap(); + + object.traverse( function( node ) { + + if ( node.material && node.material.isMeshStandardMaterial ) { + + node.material.envMap = envMap; + node.material.needsUpdate = true; + + } + + } ); + + scene.background = envMap; + + } + cameraIndex = 0; cameras = []; cameraNames = []; @@ -367,13 +386,38 @@ } + var envMap; + + function getEnvMap() { + + if ( envMap ) { + + return envMap; + + } + + var path = 'textures/cube/Park2/'; + var format = '.jpg'; + var urls = [ + path + 'posx' + format, path + 'negx' + format, + path + 'posy' + format, path + 'negy' + format, + path + 'posz' + format, path + 'negz' + format + ]; + + envMap = new THREE.CubeTextureLoader().load( urls ); + envMap.format = THREE.RGBFormat; + return envMap; + + } + var sceneList = [ { name : "BoomBox (PBR)", url : "./models/gltf/BoomBox/%s/BoomBox.gltf", cameraPos: new THREE.Vector3(2, 1, 3), objectRotation: new THREE.Euler(0, Math.PI, 0), addLights:true, - extensions: ["glTF", "glTF-Binary"] + extensions: ["glTF", "glTF-Binary"], + addEnvMap: true } ];
false
Other
mrdoob
three.js
abdd1713c606135bc35028c6021698b52f27872b.json
Remove resetPose functionality. Will be removed from spec going forward (handled at Platform level (or app)), better if just not present and relied upon. See: https://github.com/w3c/webvr/issues/189 https://bugs.chromium.org/p/chromium/issues/detail?id=706561
examples/js/controls/VRControls.js
@@ -140,30 +140,6 @@ THREE.VRControls = function ( object, onError ) { }; - this.resetPose = function () { - - if ( vrDisplay ) { - - vrDisplay.resetPose(); - - } - - }; - - this.resetSensor = function () { - - console.warn( 'THREE.VRControls: .resetSensor() is now .resetPose().' ); - this.resetPose(); - - }; - - this.zeroSensor = function () { - - console.warn( 'THREE.VRControls: .zeroSensor() is now .resetPose().' ); - this.resetPose(); - - }; - this.dispose = function () { vrDisplay = null;
false
Other
mrdoob
three.js
e2256a3132e2cd9afaf96b336fbd61dd1e0ea6f9.json
Add module import doc
README.md
@@ -19,7 +19,7 @@ The aim of the project is to create an easy to use, lightweight, 3D library. The ### Usage ### -Download the [minified library](http://threejs.org/build/three.min.js) and include it in your html. +Download the [minified library](http://threejs.org/build/three.min.js) and include it in your html, or install and import it as a [module](http://threejs.org/docs/#manual/introduction/Import-via-modules), Alternatively see [how to build the library yourself](https://github.com/mrdoob/three.js/wiki/Build-instructions). ```html
true
Other
mrdoob
three.js
e2256a3132e2cd9afaf96b336fbd61dd1e0ea6f9.json
Add module import doc
docs/list.js
@@ -4,6 +4,7 @@ var list = { "Getting Started": { "Creating a scene": "manual/introduction/Creating-a-scene", + "Import via modules": "manual/introduction/Import-via-modules", "WebGL compatibility check": "manual/introduction/WebGL-compatibility-check", "How to run things locally": "manual/introduction/How-to-run-thing-locally", "Drawing Lines": "manual/introduction/Drawing-lines",
true
Other
mrdoob
three.js
e2256a3132e2cd9afaf96b336fbd61dd1e0ea6f9.json
Add module import doc
docs/manual/introduction/Import-via-modules.html
@@ -0,0 +1,72 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + <h1>[name]</h1><br /> + + <div> + While importing three.js via script tags is a great way to get up and running fast, it has a few drawbacks for longer lived projects, for example: + <ul> + <li>You have to manually fetch and include a copy of the library as part of your project's source code</li> + <li>Updating the library's version is a manual process</li> + <li>When checking in a new version of the library your version control diffs are cluttered by the many lines of the build file</li> + </ul> + </div> + + <div>Using a dependency manager like npm avoids these caveats by allowing you to simply download and import your desired version of the libarary onto your machine.</div> + + <h2>Installation via npm</h2> + + <div>Three.js is published as an npm module, see: <a href="https://www.npmjs.com/package/three" target="_blank">npm</a>. This means all you need to do to include three.js into your project is run "npm install three"</div> + + <h2>Importing the module</h2> + + <div>Assuming that you're bundling your files with a tool such as <a href="https://webpack.github.io/" target="_blank">Webpack</a> or <a href="https://github.com/substack/node-browserify" target="_blank">Browserify</a>, which allow you to "require('modules') in the browser by bundling up all of your dependencies."</div> + + <div> + You should now be able to import the module into your source files and continue to use it as per normal. + </div> + + <code> + var THREE = require('three'); + + var scene = new THREE.Scene(); + ... + </code> + + <div> + You're also able to leverage <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import" target="_blank">ES6 import syntax</a>: + </div> + + <code> + import * as THREE from 'three'; + + const scene = new THREE.Scene(); + ... + </code> + + <div> + or if you wish to import only select parts of three.js library, for example Scene: + </div> + + <code> + import { Scene } from 'three'; + + const scene = new Scene(); + ... + </code> + + <h2>Caveats</h2> + + <div> + Currenlty it's not possible to import the files within the "examples/js" directroy in this way. + This is due to some of the files relying on global namespace pollution of THREE. For more information see <a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank">Transform `examples/js` to support modules #9562</a>. + </div> + </body> +</html>
true
Other
mrdoob
three.js
c39c1c6fdf8db8921a8eb6a9279537fba9150c44.json
Fix basic grammar mistake http://data.grammarbook.com/blog/pronouns/1-grammar-error/
docs/api/objects/Group.html
@@ -13,7 +13,7 @@ <h1>[name]</h1> <div class="desc"> - This is almost identical to an [page:Object3D Object3D]. It's purpose is to make working + This is almost identical to an [page:Object3D Object3D]. Its purpose is to make working with groups of objects syntactically clearer. </div>
false
Other
mrdoob
three.js
6161ab5733c23e7a7d77c97d093d6bbfa31cdc53.json
Fix clear color bug
src/renderers/webgl/WebGLState.js
@@ -13,7 +13,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) { var color = new Vector4(); var currentColorMask = null; - var currentColorClear = new Vector4(); + var currentColorClear = new Vector4( 0, 0, 0, 0 ); return { @@ -58,7 +58,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) { locked = false; currentColorMask = null; - currentColorClear.set( 0, 0, 0, 1 ); + currentColorClear.set( - 1, 0, 0, 0 ); }
false
Other
mrdoob
three.js
06d8dc87199a2ac6c74e2ea6ed7703cf2fcdcb1b.json
remove self written clone non recursive
examples/js/loaders/GLTF2Loader.js
@@ -2653,10 +2653,7 @@ THREE.GLTF2Loader = ( function () { } //do not clone children as they will be replaced anyway - var children = group.children - group.children=[]; - var clonedgroup = group.clone(); - group.children=children; + var clonedgroup = group.clone( false ); for ( var childrenId in group.children ) { var child = group.children[ childrenId ];
false
Other
mrdoob
three.js
228257762a865c00a2463de1275d1dba8099b4f6.json
Add tracks length check for MMDHelper
examples/js/loaders/MMDLoader.js
@@ -2304,7 +2304,8 @@ THREE.MMDHelper.prototype = { // the name of them begins with "_". mesh.mixer.addEventListener( 'loop', function ( e ) { - if ( e.action._clip.tracks[ 0 ].name.indexOf( '.bones' ) !== 0 ) return; + if ( e.action._clip.tracks.length > 0 && + e.action._clip.tracks[ 0 ].name.indexOf( '.bones' ) !== 0 ) return; var mesh = e.target._root; mesh.looped = true; @@ -2320,7 +2321,7 @@ THREE.MMDHelper.prototype = { var action = mesh.mixer.clipAction( clip ); - if ( clip.tracks[ 0 ].name.indexOf( '.morphTargetInfluences' ) === 0 ) { + if ( clip.tracks.length > 0 && clip.tracks[ 0 ].name.indexOf( '.morphTargetInfluences' ) === 0 ) { if ( ! foundMorphAnimation ) {
false
Other
mrdoob
three.js
dafc784003c43e4c4e76573da2b61b8981828db8.json
Fix markup typos in WebGLRenderTarget doc
docs/api/renderers/WebGLRenderTarget.html
@@ -1,134 +1,134 @@ -<!DOCTYPE html> -<html lang="en"> - <head> +<!DOCTYPE html> +<html lang="en"> + <head> <meta charset="utf-8" /> - <base href="../../" /> - <script src="list.js"></script> - <script src="page.js"></script> - <link type="text/css" rel="stylesheet" href="page.css" /> - </head> - <body> - <h1>[name]</h1> - - <div class="desc"> - A [link:https://msdn.microsoft.com/en-us/library/bb976073.aspx render target] is a buffer - where the video card draws pixels for a scene that is being rendered in the background. - It is used in different effects, such as applying postprocessing to a rendered image - before displaying it on the screen. - </div> - - - <h2>Constructor</h2> - - - <h3>[name]([page:Number width], [page:Number height], [page:Object options])</h3> - - <div> - [page:Float width] - The width of the renderTarget. <br /> - [page:Float height] - The height of the renderTarget.<br /> - options - (optional0 object that holds texture parameters for an auto-generated target - texture and depthBuffer/stencilBuffer booleans. - - For an explanation of the texture parameters see [page:Texture Texture]. The following are - valid options:<br /><br /> - - [page:Constant wrapS] - default is [page:Textures ClampToEdgeWrapping]. <br /> - [page:Constant wrapT] - default is [page:Textures ClampToEdgeWrapping]. <br /> - [page:Constant magFilter] - default is [page:Textures .LinearFilter]. <br /> - [page:Constant minFilter] - default is [page:Textures LinearFilter]. <br /> - [page:Constant format] - default is [page:Textures RGBAFormat]. <br /> - [page:Constant type] - default is [page:Textures UnsignedByteType]. <br /> - [page:Number anisotropy] - default is *1*. See [page:Texture.anistropy]<br /> - [page:Constant encoding] - default is [page:Textures LinearEncoding]. <br /> - [page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it. <br /> - [page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.<br /><br /> - - Creates a new [name]] - </div> - - <h2>Properties</h2> - - <h3>[property:number uuid]</h3> - <div> - A unique number for this render target instance. - </div> - - <h3>[property:number width]</h3> - <div> - The width of the render target. - </div> - - <h3>[property:number height]</h3> - <div> - The height of the render target. - </div> - - <h3>[property:Vector4 scissor]</h3> - <div> - A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. - </div> - - <h3>[property:boolean scissorTest]</h3> - <div> - Indicates whether the scissor test is active or not. - </div> - - <h3>[property:Vector4 viewport]</h3> - <div> - The viewport of this render target. - </div> - - <h3>[property:Texture texture]</h3> - <div> - This texture instance holds the rendered pixels. Use it as input for further processing. - </div> - - <h3>[property:boolean depthBuffer]</h3> - <div> - Renders to the depth buffer. Default is true. - </div> - - <h3>[property:boolean stencilBuffer]</h3> - <div> - Renders to the stencil buffer. Default is true. - </div> - - <h3>[property:DepthTexture depthTexture]</h3> - <div> - If set, the scene depth will be rendered to this texture. Default is null. - </div> - - - <h2>Methods</h2> - - <h3>[method:null setSize]( [page:Number width], [page:Number height] )</h3> - <div> - Sets the size of the render target. - </div> - - <h3>[method:WebGLRenderTarget clone]()</h3> - <div> - Creates a copy of this render target. - </div> - - <h3>[method:WebGLRenderTarget copy]( [page:WebGLRenderTarget source] )</h3> - <div> - Adopts the settings of the given render target. - </div> - - <h3>[method:null dispose]()</h3> - <div> - Dispatches a dispose event. - </div> - - - - - - <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3> - - <h2>Source</h2> - - [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] - </body> -</html> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + <h1>[name]</h1> + + <div class="desc"> + A [link:https://msdn.microsoft.com/en-us/library/bb976073.aspx render target] is a buffer + where the video card draws pixels for a scene that is being rendered in the background. + It is used in different effects, such as applying postprocessing to a rendered image + before displaying it on the screen. + </div> + + + <h2>Constructor</h2> + + + <h3>[name]([page:Number width], [page:Number height], [page:Object options])</h3> + + <div> + [page:Float width] - The width of the renderTarget. <br /> + [page:Float height] - The height of the renderTarget.<br /> + options - (optional object that holds texture parameters for an auto-generated target + texture and depthBuffer/stencilBuffer booleans. + + For an explanation of the texture parameters see [page:Texture Texture]. The following are + valid options:<br /><br /> + + [page:Constant wrapS] - default is [page:Textures ClampToEdgeWrapping]. <br /> + [page:Constant wrapT] - default is [page:Textures ClampToEdgeWrapping]. <br /> + [page:Constant magFilter] - default is [page:Textures .LinearFilter]. <br /> + [page:Constant minFilter] - default is [page:Textures LinearFilter]. <br /> + [page:Constant format] - default is [page:Textures RGBAFormat]. <br /> + [page:Constant type] - default is [page:Textures UnsignedByteType]. <br /> + [page:Number anisotropy] - default is *1*. See [page:Texture.anistropy]<br /> + [page:Constant encoding] - default is [page:Textures LinearEncoding]. <br /> + [page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it. <br /> + [page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.<br /><br /> + + Creates a new [name] + </div> + + <h2>Properties</h2> + + <h3>[property:number uuid]</h3> + <div> + A unique number for this render target instance. + </div> + + <h3>[property:number width]</h3> + <div> + The width of the render target. + </div> + + <h3>[property:number height]</h3> + <div> + The height of the render target. + </div> + + <h3>[property:Vector4 scissor]</h3> + <div> + A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. + </div> + + <h3>[property:boolean scissorTest]</h3> + <div> + Indicates whether the scissor test is active or not. + </div> + + <h3>[property:Vector4 viewport]</h3> + <div> + The viewport of this render target. + </div> + + <h3>[property:Texture texture]</h3> + <div> + This texture instance holds the rendered pixels. Use it as input for further processing. + </div> + + <h3>[property:boolean depthBuffer]</h3> + <div> + Renders to the depth buffer. Default is true. + </div> + + <h3>[property:boolean stencilBuffer]</h3> + <div> + Renders to the stencil buffer. Default is true. + </div> + + <h3>[property:DepthTexture depthTexture]</h3> + <div> + If set, the scene depth will be rendered to this texture. Default is null. + </div> + + + <h2>Methods</h2> + + <h3>[method:null setSize]( [page:Number width], [page:Number height] )</h3> + <div> + Sets the size of the render target. + </div> + + <h3>[method:WebGLRenderTarget clone]()</h3> + <div> + Creates a copy of this render target. + </div> + + <h3>[method:WebGLRenderTarget copy]( [page:WebGLRenderTarget source] )</h3> + <div> + Adopts the settings of the given render target. + </div> + + <h3>[method:null dispose]()</h3> + <div> + Dispatches a dispose event. + </div> + + + + + + <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3> + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + </body> +</html>
false
Other
mrdoob
three.js
3d6694b1e90bdb4eaea0cf7d53601dff2e482888.json
Remove imported constant FlatShading
src/renderers/WebGLRenderer.js
@@ -1,4 +1,4 @@ -import { REVISION, MaxEquation, MinEquation, RGB_ETC1_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, RGB_S3TC_DXT1_Format, SrcAlphaSaturateFactor, OneMinusDstColorFactor, DstColorFactor, OneMinusDstAlphaFactor, DstAlphaFactor, OneMinusSrcAlphaFactor, SrcAlphaFactor, OneMinusSrcColorFactor, SrcColorFactor, OneFactor, ZeroFactor, ReverseSubtractEquation, SubtractEquation, AddEquation, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RGBAFormat, RGBFormat, AlphaFormat, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedShort565Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestFilter, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, FrontFaceDirectionCW, NoBlending, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, NoColors, FlatShading, LinearToneMapping } from '../constants'; +import { REVISION, MaxEquation, MinEquation, RGB_ETC1_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, RGB_S3TC_DXT1_Format, SrcAlphaSaturateFactor, OneMinusDstColorFactor, DstColorFactor, OneMinusDstAlphaFactor, DstAlphaFactor, OneMinusSrcAlphaFactor, SrcAlphaFactor, OneMinusSrcColorFactor, SrcColorFactor, OneFactor, ZeroFactor, ReverseSubtractEquation, SubtractEquation, AddEquation, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RGBAFormat, RGBFormat, AlphaFormat, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedShort565Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestFilter, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, FrontFaceDirectionCW, NoBlending, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, NoColors, LinearToneMapping } from '../constants'; import { _Math } from '../math/Math'; import { Matrix4 } from '../math/Matrix4'; import { DataTexture } from '../textures/DataTexture';
false
Other
mrdoob
three.js
ab8a00dcc6b191136b73ca838f8ee82e46627fb9.json
Remove preferred shading option
docs/examples/loaders/ColladaLoader.html
@@ -86,15 +86,6 @@ <h3>[method:Object parse]( [page:Document doc], [page:Function callBack], [page: Parse an <em>XML Document</em> and return an [page:Object object] that contain loaded parts: .[page:Scene scene], .[page:Array morphs], .[page:Array skins], .[page:Array animations], .[page:Object dae] </div> - <h3>[method:null setPreferredShading]( [page:Integer shading] )</h3> - <div> - [page:Integer shading] — required - </div> - <div> - Set the .[page:Integer shading] property on the resource's materials.<br /> - Options are [page:Materials THREE.SmoothShading], [page:Materials THREE.FlatShading]. - </div> - <h3>[method:null applySkin]( [page:Geometry geometry], [page:Object instanceCtrl], [page:Integer frame] )</h3> <div> [page:Geometry geometry] — required<br />
true
Other
mrdoob
three.js
ab8a00dcc6b191136b73ca838f8ee82e46627fb9.json
Remove preferred shading option
examples/js/loaders/ColladaLoader.js
@@ -31,7 +31,6 @@ THREE.ColladaLoader = function () { var skins; var flip_uv = true; - var preferredShading = THREE.SmoothShading; var options = { // Force Geometry to always be centered at the local origin of the @@ -213,12 +212,6 @@ THREE.ColladaLoader = function () { } - function setPreferredShading ( shading ) { - - preferredShading = shading; - - } - function parseAsset () { var elements = COLLADA.querySelectorAll('asset'); @@ -3817,7 +3810,6 @@ THREE.ColladaLoader = function () { } - props[ 'shading' ] = preferredShading; props[ 'side' ] = this.effect.doubleSided ? THREE.DoubleSide : THREE.FrontSide; if ( props.diffuse !== undefined ) { @@ -5536,7 +5528,6 @@ THREE.ColladaLoader = function () { load: load, parse: parse, - setPreferredShading: setPreferredShading, applySkin: applySkin, geometries : geometries, options: options
true
Other
mrdoob
three.js
fd6fe6ef1d2e307d837d8e876384a4f64e6e1f14.json
Update GLTF2Loader docs.
docs/examples/loaders/GLTF2Loader.html
@@ -14,13 +14,12 @@ <h1>[name]</h1> <div class="desc"> A loader for *glTF* 2.0 resources. <br /><br /> - <a href="https://www.khronos.org/gltf">glTF</a> (GL Transmission Format) is an open format - specification for efficient delivery and loading of 3D content. Assets may be provided either - in JSON (.gltf) or binary (.glb) format. External files store textures (.jpg, .png, ...) and - additional binary data (.bin). A glTF asset may deliver one or more scenes, including meshes, - materials, textures, shaders, skins, skeletons, animations, lights, and/or cameras. Morph target - animations are not yet finalized in the - <a href="https://github.com/KhronosGroup/glTF/tree/master/specification">glTF specification</a>. + <a href="https://www.khronos.org/gltf">glTF</a> (GL Transmission Format) is an + <a href="https://github.com/KhronosGroup/glTF/tree/master/specification/2.0">open format specification</a> + for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf) + or binary (.glb) format. External files store textures (.jpg, .png, ...) and additional binary + data (.bin). A glTF asset may deliver one or more scenes, including meshes, materials, + textures, shaders, skins, skeletons, morph targets, animations, lights, and/or cameras. </div> <h2>Extensions</h2> @@ -31,17 +30,15 @@ <h2>Extensions</h2> <ul> <li> - <a target="_blank" href="https://github.com/KhronosGroup/glTF/blob/master/extensions/Khronos/KHR_binary_glTF"> - KHR_binary_glTF - </a> + KHR_lights </li> <li> <a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_common"> KHR_materials_common </a> </li> <li> - <a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/2.0/extensions/Khronos/KHR_materials_pbrSpecularGlossiness"> + <a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness"> KHR_materials_pbrSpecularGlossiness </a> </li>
false
Other
mrdoob
three.js
0f93f98b350cfa4e7e1db9faad92d7ba37311515.json
apply mrdoob style on PRWM example
examples/webgl_loader_prwm.html
@@ -95,7 +95,8 @@ function init() { - document.getElementById('endianness').innerHTML = THREE.PRWMLoader.isBigEndianPlatform() ? 'big-endian' : 'little-endian'; + + document.getElementById( 'endianness' ).innerHTML = THREE.PRWMLoader.isBigEndianPlatform() ? 'big-endian' : 'little-endian'; container = document.createElement( 'div' ); document.body.appendChild( container ); @@ -116,54 +117,68 @@ // model var loader = new THREE.PRWMLoader(); - var material = new THREE.MeshPhongMaterial({}); + var material = new THREE.MeshPhongMaterial( {} ); var busy = false; var mesh = null; var onProgress = function ( xhr ) { + if ( xhr.lengthComputable ) { + var percentComplete = xhr.loaded / xhr.total * 100; - console.log( Math.round(percentComplete, 2) + '% downloaded' ); + console.log( Math.round( percentComplete, 2 ) + '% downloaded' ); + + if ( xhr.loaded === xhr.total ) { + + console.log( 'File size: ' + ( xhr.total / 1024 ).toFixed( 2 ) + 'kB' ); + console.timeEnd( 'Download' ); - if (xhr.loaded === xhr.total) { - console.log('File size: ' + (xhr.total / 1024).toFixed(2) + 'kB'); - console.timeEnd('Download'); } + } + }; var onError = function ( xhr ) { + busy = false; + }; - function loadGeometry (url) { - if (busy) return; + function loadGeometry( url ) { + + if ( busy ) return; busy = true; - if (mesh !== null) { - scene.remove(mesh); + if ( mesh !== null ) { + + scene.remove( mesh ); mesh.geometry.dispose(); + } - console.log('-- Loading', url); - console.time('Download'); + console.log( '-- Loading', url ); + console.time( 'Download' ); + loader.load( url, function ( geometry ) { - mesh = new THREE.Mesh(geometry, material); - mesh.scale.set(50,50,50); + + mesh = new THREE.Mesh( geometry, material ); + mesh.scale.set( 50, 50, 50 ); scene.add( mesh ); - console.log(geometry.index ? 'indexed geometry' : 'non-indexed geometry'); - console.log('# of vertices: ' + geometry.attributes.position.count); - console.log('# of polygons: ' + (geometry.index ? geometry.index.count / 3 : geometry.attributes.position.count / 3)); + console.log( geometry.index ? 'indexed geometry' : 'non-indexed geometry' ); + console.log( '# of vertices: ' + geometry.attributes.position.count ); + console.log( '# of polygons: ' + ( geometry.index ? geometry.index.count / 3 : geometry.attributes.position.count / 3 ) ); busy = false; + }, onProgress, onError ); - } + } // - renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setPixelRatio( 1 ); renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); @@ -172,17 +187,21 @@ // - document.querySelectorAll('a.model').forEach(function (anchor) { - anchor.addEventListener('click', function (e) { + document.querySelectorAll( 'a.model' ).forEach( function ( anchor ) { + + anchor.addEventListener( 'click', function ( e ) { + e.preventDefault(); - loadGeometry(anchor.href); - }); - }); + loadGeometry( anchor.href ); + + } ); + + } ); // - loadGeometry('./models/prwm/smooth-suzanne-LE.prwm'); + loadGeometry( './models/prwm/smooth-suzanne-LE.prwm' ); window.addEventListener( 'resize', onWindowResize, false );
false
Other
mrdoob
three.js
cace41463410b9e97f6900731d341206f9b28466.json
Add lights to duck example for good measure.
examples/js/loaders/GLTF2Loader.js
@@ -310,8 +310,7 @@ THREE.GLTF2Loader = ( function () { var light = lights[ lightId ]; var lightNode; - var lightParams = light[ light.type ]; - var color = new THREE.Color().fromArray( lightParams.color ); + var color = new THREE.Color().fromArray( light.color ); switch ( light.type ) { @@ -337,6 +336,7 @@ THREE.GLTF2Loader = ( function () { if ( lightNode ) { + lightNode.name = light.name || ( 'light_' + lightId ); this.lights[ lightId ] = lightNode; }
true
Other
mrdoob
three.js
cace41463410b9e97f6900731d341206f9b28466.json
Add lights to duck example for good measure.
examples/models/gltf/Duck/glTF-MaterialsCommon/Duck.gltf
@@ -141,11 +141,47 @@ "type" : "perspective" } ], + "extensions" : { + "KHR_lights" : { + "lights" : [ + { + "color" : [ + 1.0, + 1.0, + 1.0 + ], + "name" : "directionalLightShape1", + "type" : "directional" + }, + { + "color" : [ + 1.0, + 1.0, + 1.0 + ], + "name" : "Lamp", + "quadraticAttenuation" : 0.03333335240683057, + "type" : "point" + }, + { + "color" : [ + 0.0, + 0.0, + 0.0 + ], + "name" : "Ambient_Scene", + "type" : "ambient" + } + ] + } + }, "extensionsRequired" : [ - "KHR_materials_common" + "KHR_materials_common", + "KHR_lights" ], "extensionsUsed" : [ - "KHR_materials_common" + "KHR_materials_common", + "KHR_lights" ], "images" : [ { @@ -266,6 +302,23 @@ ] }, { + "extensions" : { + "KHR_lights" : { + "light" : 0 + } + }, + "name" : "Correction_directionalLight1", + "rotation" : [ + -0.7071067690849304, + -0.0, + 0.0, + 0.7071067690849304 + ] + }, + { + "children" : [ + 4 + ], "name" : "directionalLight1", "rotation" : [ 0.14142043888568878, @@ -285,6 +338,23 @@ ] }, { + "extensions" : { + "KHR_lights" : { + "light" : 1 + } + }, + "name" : "Correction_Lamp", + "rotation" : [ + -0.7071067690849304, + -0.0, + 0.0, + 0.7071067690849304 + ] + }, + { + "children" : [ + 6 + ], "name" : "Lamp", "rotation" : [ 0.16907575726509094, @@ -325,12 +395,17 @@ "scene" : 0, "scenes" : [ { + "extensions" : { + "KHR_lights" : { + "light" : 2 + } + }, "name" : "Scene", "nodes" : [ - 4, - 3, - 6, 5, + 3, + 8, + 7, 1 ] }
true
Other
mrdoob
three.js
cace41463410b9e97f6900731d341206f9b28466.json
Add lights to duck example for good measure.
examples/webgl_loader_gltf2.html
@@ -437,8 +437,8 @@ addLights:true, addGround:true, shadows:true, - // TODO: 'glTF-MaterialsCommon', 'glTF-techniqueWebGL' - extensions: ['glTF', 'glTF-Embedded', 'glTF-pbrSpecularGlossiness', 'glTF-Binary'] + // TODO: 'glTF-techniqueWebGL' + extensions: ['glTF', 'glTF-Embedded', 'glTF-MaterialsCommon', 'glTF-pbrSpecularGlossiness', 'glTF-Binary'] }, { name : "Monster", url : "./models/gltf/Monster/%s/Monster.gltf",
true
Other
mrdoob
three.js
3abec128f1177b1515ecc13fd605a352f8bdbbf7.json
Accept primitive.indices=0 in GLTFLoader
examples/js/loaders/GLTF2Loader.js
@@ -1632,7 +1632,7 @@ THREE.GLTF2Loader = ( function () { } - if ( primitive.indices ) { + if ( primitive.indices !== undefined ) { geometry.setIndex( dependencies.accessors[ primitive.indices ] ); @@ -1682,7 +1682,7 @@ THREE.GLTF2Loader = ( function () { var meshNode; - if ( primitive.indices ) { + if ( primitive.indices !== undefined ) { geometry.setIndex( dependencies.accessors[ primitive.indices ] );
true
Other
mrdoob
three.js
3abec128f1177b1515ecc13fd605a352f8bdbbf7.json
Accept primitive.indices=0 in GLTFLoader
examples/js/loaders/GLTFLoader.js
@@ -1644,7 +1644,7 @@ THREE.GLTFLoader = ( function () { } - if ( primitive.indices ) { + if ( primitive.indices !== undefined ) { geometry.setIndex( dependencies.accessors[ primitive.indices ] ); @@ -1694,7 +1694,7 @@ THREE.GLTFLoader = ( function () { var meshNode; - if ( primitive.indices ) { + if ( primitive.indices !== undefined ) { geometry.setIndex( dependencies.accessors[ primitive.indices ] );
true
Other
mrdoob
three.js
42e26f906d1f25a701a345fd24bf9b209446fac4.json
Remove material.skinning from WebGLShadowMap
src/renderers/webgl/WebGLShadowMap.js
@@ -71,7 +71,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) { var depthMaterial = depthMaterialTemplate.clone(); depthMaterial.morphTargets = useMorphing; - depthMaterial.skinning = useSkinning; _depthMaterials[ i ] = depthMaterial; @@ -83,7 +82,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) { vertexShader: distanceShader.vertexShader, fragmentShader: distanceShader.fragmentShader, morphTargets: useMorphing, - skinning: useSkinning, clipping: true } );
false
Other
mrdoob
three.js
3bc8d4f997cb82076a4febf8ac83ebca390d3832.json
add draw range for instanced geometry
src/renderers/webgl/WebGLBufferRenderer.js
@@ -23,7 +23,7 @@ function WebGLBufferRenderer( gl, extensions, infoRender ) { } - function renderInstances( geometry ) { + function renderInstances( geometry, start, count ) { var extension = extensions.get( 'ANGLE_instanced_arrays' ); @@ -36,8 +36,6 @@ function WebGLBufferRenderer( gl, extensions, infoRender ) { var position = geometry.attributes.position; - var count = 0; - if ( position.isInterleavedBufferAttribute ) { count = position.data.count; @@ -46,9 +44,7 @@ function WebGLBufferRenderer( gl, extensions, infoRender ) { } else { - count = position.count; - - extension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount ); + extension.drawArraysInstancedANGLE( mode, start, count, geometry.maxInstancedCount ); }
false
Other
mrdoob
three.js
49eeb97c60a783377be842e2e2a1132a124f42e6.json
fix ios9 TypedArray.subarray(from, undefined) bug
src/animation/AnimationUtils.js
@@ -11,7 +11,9 @@ var AnimationUtils = { if ( AnimationUtils.isTypedArray( array ) ) { - return new array.constructor( array.subarray( from, to ) ); + // in ios9 array.subarray(from, undefined) will return empty array + // but array.subarray(from) or array.subarray(from, len) is correct + return new array.constructor( array.subarray( from, to || array.length ) ); }
false
Other
mrdoob
three.js
8349b07b5d3d1ebb55c7ee01ff27544604facd2e.json
Remove MultiMaterial from WebGLDeferredRenderer
examples/js/renderers/WebGLDeferredRenderer.js
@@ -67,8 +67,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { var _lightPrePass = false; var _cacheKeepAlive = false; - var _invisibleMaterial = new THREE.ShaderMaterial( { visible: false } ); - + var _tmpMaterial = new THREE.ShaderMaterial( { visible: false } ); var _tmpVector3 = new THREE.Vector3(); // scene/material/light cache for deferred rendering. @@ -80,13 +79,12 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { var _lightScenesCache = {}; var _lightFullscreenScenesCache = {}; - // originalMaterial.uuid -> deferredMaterial - // (no mapping from children of MultiMaterial) + // object.material.uuid -> deferredMaterial or + // object.material[ n ].uuid -> deferredMaterial var _normalDepthMaterialsCache = {}; var _normalDepthShininessMaterialsCache = {}; var _colorMaterialsCache = {}; var _reconstructionMaterialsCache = {}; - var _invisibleMultiMaterialsCache = {}; // originalLight.uuid -> deferredLight var _deferredLightsCache = {}; @@ -97,15 +95,20 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { var _removeThresholdCount = 60; - // object.uuid -> originalMaterial - // deferred materials.uuid -> originalMaterial + // deferredMaterials.uuid -> object.material or + // deferredMaterials.uuid -> object.material[ n ] // save before render and release after render. var _originalMaterialsTable = {}; // object.uuid -> originalOnBeforeRender // save before render and release after render. var _originalOnBeforeRendersTable = {}; + // object.material.uuid -> object.material.visible or + // object.material[ i ].uuid -> object.material[ i ].visible or + // save before render and release after render. + var _originalVisibleTable = {}; + // external properties this.renderer = undefined; @@ -328,70 +331,73 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { } - function getMaterialFromCacheOrCreate( originalMaterial, cache, func ) { + function getMaterialFromCacheOrCreate( originalMaterial, cache, createFunc, updateFunc ) { var data = cache[ originalMaterial.uuid ]; if ( data === undefined ) { data = createCacheData(); + data.material = createFunc( originalMaterial ); + cache[ originalMaterial.uuid ] = data; - var material; + } - if ( originalMaterial.isMultiMaterial === true ) { + data.used = true; - var materials = []; + updateFunc( data.material, originalMaterial ); - for ( var i = 0, il = originalMaterial.materials.length; i < il; i ++ ) { + _originalMaterialsTable[ data.material.uuid ] = originalMaterial; - materials.push( func( originalMaterial.materials[ i ] ) ); + return data.material; - } + } - material = new THREE.MultiMaterial( materials ); + function overrideMaterialAndOnBeforeRender( object, getMaterialFunc, onBeforeRender ) { - } else { + if ( object.material === undefined ) return; + + if ( Array.isArray( object.material ) ) { - material = func( originalMaterial ); + for ( var i = 0, il = object.material.length; i < il; i ++ ) { + + object.material[ i ] = getMaterialFunc( object.material[ i ] ); } - data.material = material; + } else { - cache[ originalMaterial.uuid ] = data; + object.material = getMaterialFunc( object.material ); } - return data.material; + object.onBeforeRender = onBeforeRender; } - function setMaterialNormalDepth( object ) { + function restoreOriginalMaterial( object ) { if ( object.material === undefined ) return; - var originalMaterial = _originalMaterialsTable[ object.uuid ]; - var material = getNormalDepthMaterial( originalMaterial ); - - _originalMaterialsTable[ material.uuid ] = originalMaterial; + if ( Array.isArray( object.material ) ) { - if ( material.isMultiMaterial === true ) { + for ( var i = 0, il = object.material.length; i < il; i ++ ) { - for ( var i = 0, il = material.materials.length; i < il; i ++ ) { - - _originalMaterialsTable[ material.materials[ i ].uuid ] = originalMaterial.materials[ i ]; - updateDeferredNormalDepthMaterial( material.materials[ i ], originalMaterial.materials[ i ] ); + object.material[ i ] = _originalMaterialsTable[ object.material[ i ].uuid ]; } } else { - updateDeferredNormalDepthMaterial( material, originalMaterial ); + object.material = _originalMaterialsTable[ object.material.uuid ]; } - object.material = material; - object.onBeforeRender = updateDeferredNormalDepthUniforms; + } + + function setMaterialNormalDepth( object ) { + + overrideMaterialAndOnBeforeRender( object, getNormalDepthMaterial, updateDeferredNormalDepthUniforms ); } @@ -400,7 +406,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { return getMaterialFromCacheOrCreate( originalMaterial, ( _lightPrePass ) ? _normalDepthShininessMaterialsCache : _normalDepthMaterialsCache, - createDeferredNormalDepthMaterial + createDeferredNormalDepthMaterial, + updateDeferredNormalDepthMaterial ); } @@ -448,30 +455,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { function setMaterialColor( object ) { - if ( object.material === undefined ) return; - - var originalMaterial = _originalMaterialsTable[ object.uuid ]; - var material = getColorMaterial( originalMaterial ); - - _originalMaterialsTable[ material.uuid ] = originalMaterial; - - if ( originalMaterial.isMultiMaterial === true ) { - - for ( var i = 0, il = originalMaterial.materials.length; i < il; i ++ ) { - - _originalMaterialsTable[ material.materials[ i ].uuid ] = originalMaterial.materials[ i ]; - updateDeferredColorMaterial( material.materials[ i ], originalMaterial.materials[ i ] ); - - } - - } else { - - updateDeferredColorMaterial( material, originalMaterial ); - - } - - object.material = material; - object.onBeforeRender = updateDeferredColorUniforms; + overrideMaterialAndOnBeforeRender( object, getColorMaterial, updateDeferredColorUniforms ); } @@ -480,7 +464,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { return getMaterialFromCacheOrCreate( originalMaterial, _colorMaterialsCache, - createDeferredColorMaterial + createDeferredColorMaterial, + updateDeferredColorMaterial ); } @@ -551,48 +536,24 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { function setMaterialReconstruction( object ) { - if ( object.material === undefined ) return; - - var originalMaterial = _originalMaterialsTable[ object.uuid ]; - - if ( originalMaterial.transparent === true ) { - - object.material = originalMaterial; - object.onBeforeRender = _originalOnBeforeRendersTable[ object.uuid ]; - - return; - - } - - var material = getReconstructionMaterial( originalMaterial ); - _originalMaterialsTable[ material.uuid ] = originalMaterial; + overrideMaterialAndOnBeforeRender( object, getReconstructionMaterial, updateDeferredReconstructionUniforms ); - if ( originalMaterial.isMultiMaterial === true ) { - - for ( var i = 0, il = originalMaterial.materials.length; i < il; i ++ ) { - - _originalMaterialsTable[ material.materials[ i ].uuid ] = originalMaterial.materials[ i ]; - updateDeferredReconstructionMaterial( material.materials[ i ], originalMaterial.materials[ i ] ); + } - } + function getReconstructionMaterial( originalMaterial ) { - } else { + if ( originalMaterial.transparent === true ) { - updateDeferredReconstructionMaterial( material, originalMaterial ); + _originalMaterialsTable[ originalMaterial.uuid ] = originalMaterial; + return originalMaterial; } - object.material = material; - object.onBeforeRender = updateDeferredReconstructionUniforms; - - } - - function getReconstructionMaterial( originalMaterial ) { - return getMaterialFromCacheOrCreate( originalMaterial, _reconstructionMaterialsCache, - createDeferredReconstructionMaterial + createDeferredReconstructionMaterial, + updateDeferredReconstructionMaterial ); } @@ -622,65 +583,72 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { function updateDeferredReconstructionUniforms( renderer, scene, camera, geometry, material, group ) { + if ( material.transparent === true ) { + + // 'this' is object here because this method is set as object.onBefore() + var onBeforeRender = _originalOnBeforeRendersTable[ this.uuid ]; + + if ( onBeforeRender ) { + + onBeforeRender.call( this, renderer, scene, camera, geometry, material, group ); + + } + + return; + + } + updateDeferredColorUniforms( renderer, scene, camera, geometry, material, group ); material.uniforms.samplerLight.value = _compLight.renderTarget2.texture; } - function setMaterialForwardRendering( object ) { + function setVisibleForForwardRendering( object ) { if ( object.material === undefined ) return; - var originalMaterial = _originalMaterialsTable[ object.uuid ]; + if ( Array.isArray( object.material ) ) { - if ( originalMaterial.isMultiMaterial === true ) { + for ( var i = 0, il = object.material.length; i < il; i ++ ) { - var material = getInvisibleMultiMaterial( originalMaterial ); + if ( _originalVisibleTable[ object.material[ i ].uuid ] === undefined ) { - for ( var i = 0, il = originalMaterial.materials.length; i < il; i ++ ) { + _originalVisibleTable[ object.material[ i ].uuid ] = object.material[ i ].visible; + object.material[ i ].visible = object.material[ i ].transparent && object.material[ i ].visible; - material.materials[ i ] = getForwardRenderingMaterial( originalMaterial.materials[ i ] ); + } } - object.material = material; - } else { - object.material = getForwardRenderingMaterial( originalMaterial ); + if ( _originalVisibleTable[ object.material.uuid ] === undefined ) { - } + _originalVisibleTable[ object.material.uuid ] = object.material.visible; + object.material.visible = object.material.transparent && object.material.visible; - object.onBeforeRender = _originalOnBeforeRendersTable[ object.uuid ]; - - } - - function getInvisibleMultiMaterial( originalMaterial ) { + } - return getMaterialFromCacheOrCreate( - originalMaterial, - _invisibleMultiMaterialsCache, - createInvisibleMaterial - ); + } } - function createInvisibleMaterial( originalMaterial ) { + function restoreVisible( object ) { - return _invisibleMaterial; + if ( object.material === undefined ) return; - } + if ( Array.isArray( object.material ) ) { - function getForwardRenderingMaterial( originalMaterial ) { + for ( var i = 0, il = object.material.length; i < il; i ++ ) { - if ( originalMaterial.transparent === true && originalMaterial.visible === true ) { + object.material[ i ].visible = _originalVisibleTable[ object.material[ i ].uuid ]; - return originalMaterial; + } } else { - return _invisibleMaterial; + object.material.visible = _originalVisibleTable[ object.material.uuid ]; } @@ -761,11 +729,12 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { data = createCacheData(); data.material = createDeferredLightMaterial( light.userData.originalLight ); - cache[ light.uuid ] = data; } + data.used = true; + return data.material; } @@ -784,7 +753,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { function createDeferredLightMesh( light, geometry ) { - var mesh = new THREE.Mesh( geometry, _invisibleMaterial ); + var mesh = new THREE.Mesh( geometry, _tmpMaterial ); mesh.userData.originalLight = light; @@ -973,21 +942,22 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { } - function saveOriginalMaterialAndCheckTransparency( object ) { + function saveOriginalOnBeforeRenderAndCheckTransparency( object ) { if ( object.material === undefined ) return; - _originalMaterialsTable[ object.uuid ] = object.material; _originalOnBeforeRendersTable[ object.uuid ] = object.onBeforeRender; // _hasTransparentObject is used only for Classic Deferred Rendering if ( _hasTransparentObject || _lightPrePass ) return; - if ( object.material.isMultiMaterial === true ) { + if ( ! object.visible ) return; + + if ( Array.isArray( object.material ) ) { - for ( var i = 0, il = object.material.materials.length; i < il; i ++ ) { + for ( var i = 0, il = object.material.length; i < il; i ++ ) { - if ( object.material.materials[ i ].transparent === true ) { + if ( object.material[ i ].visible === true && object.material[ i ].transparent === true ) { _hasTransparentObject = true; break; @@ -998,17 +968,16 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { } else { - if ( object.material.transparent === true ) _hasTransparentObject = true; + if ( object.material.visible === true && object.material.transparent === true ) _hasTransparentObject = true; } } - function restoreOriginalMaterial( object ) { + function restoreOriginalOnBeforeRender( object ) { if ( object.material === undefined ) return; - object.material = _originalMaterialsTable[ object.uuid ]; object.onBeforeRender = _originalOnBeforeRendersTable[ object.uuid ]; } @@ -1023,11 +992,12 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { data = createCacheData(); data.light = createDeferredLight( object ); - _deferredLightsCache[ object.uuid ] = data; } + data.used = true; + var light = data.light; if ( light === null ) return; @@ -1225,7 +1195,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { function cleanupTable( table ) { - var keys = Object.keys( cache ); + var keys = Object.keys( table ); for ( var i = 0, il = keys.length; i < il; i ++ ) { @@ -1245,13 +1215,13 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { cleanupCache( _normalDepthShininessMaterialsCache ); cleanupCache( _colorMaterialsCache ); cleanupCache( _reconstructionMaterialsCache ); - cleanupCache( _invisibleMultiMaterialsCache ); cleanupCache( _classicDeferredLightMaterialsCache ); cleanupCache( _lightPrePassMaterialsCache ); cleanupCache( _deferredLightsCache ); cleanupTable( _originalMaterialsTable ); cleanupTable( _originalOnBeforeRendersTable ); + cleanupTable( _originalVisibleTable ); } @@ -1289,6 +1259,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { _compNormalDepth.render(); + scene.traverse( restoreOriginalMaterial ); + } /* @@ -1317,6 +1289,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { _compColor.render(); + scene.traverse( restoreOriginalMaterial ); + } /* @@ -1397,6 +1371,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { _gl.disable( _gl.STENCIL_TEST ); + scene.traverse( restoreOriginalMaterial ); + } /* @@ -1426,7 +1402,8 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { if ( ! _lightPrePass && _hasTransparentObject ) { - scene.traverse( setMaterialForwardRendering ); + scene.traverse( setVisibleForForwardRendering ); + scene.traverse( restoreOriginalOnBeforeRender ); _passForward.scene = scene; _passForward.camera = camera; @@ -1440,6 +1417,12 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { _compFinal.render(); + if ( ! _lightPrePass && _hasTransparentObject ) { + + scene.traverse( restoreVisible ); + + } + } // external APIs @@ -1504,7 +1487,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { _hasTransparentObject = false; - scene.traverse( saveOriginalMaterialAndCheckTransparency ); + scene.traverse( saveOriginalOnBeforeRenderAndCheckTransparency ); updateDeferredCommonUniforms( camera ); @@ -1524,7 +1507,9 @@ THREE.WebGLDeferredRenderer = function ( parameters ) { renderFinal( scene, camera ); - scene.traverse( restoreOriginalMaterial ); + scene.traverse( restoreOriginalOnBeforeRender ); + + cleanupCaches(); scene.autoUpdate = currentSceneAutoUpdate; this.renderer.autoClearColor = currentAutoClearColor;
false
Other
mrdoob
three.js
c37c43ebb544044c04ca6a9bfab0984b8283efb5.json
Remove xMove function, tidy shapes array size
examples/webgl_geometry_text_shapes.html
@@ -65,12 +65,6 @@ side: THREE.DoubleSide } ); - var xMove = function( shape, shapeMid ) { - - return shape.translate( shapeMid, 0, 0 ); - - } - var message = " Three.js\nSimple text."; var shapes = font.generateShapes( message, 100, 2 ); @@ -81,7 +75,7 @@ xMid = - 0.5 * ( geometry.boundingBox.max.x - geometry.boundingBox.min.x ); - xMove( geometry, xMid ); + geometry.translate( xMid, 0, 0 ); // make shape ( N.B. edge view not visible ) @@ -93,32 +87,42 @@ // make line shape ( N.B. edge view remains visible ) - var lineText = new THREE.Object3D(); + var holeShapes = []; for ( var i = 0; i < shapes.length; i ++ ) { var shape = shapes[ i ]; - var lineGeometry = shape.createPointsGeometry(); - - xMove( lineGeometry, xMid ); - - var lineMesh = new THREE.Line( lineGeometry, matDark ); - lineText.add( lineMesh ); - if ( shape.holes && shape.holes.length > 0 ) { for ( var j = 0; j < shape.holes.length; j ++ ) { var hole = shape.holes[ j ]; - shapes.push( hole ); + holeShapes.push( hole ); } } } + shapes.push.apply( shapes, holeShapes ); + + var lineText = new THREE.Object3D(); + + for ( var i = 0; i < shapes.length; i ++ ) { + + var shape = shapes[ i ]; + + var lineGeometry = shape.createPointsGeometry(); + + lineGeometry.translate( xMid, 0, 0 ); + + var lineMesh = new THREE.Line( lineGeometry, matDark ); + lineText.add( lineMesh ); + + } + scene.add( lineText ); } ); //end load function
false