Showing preview only (1,756K chars total). Download the full file or copy to clipboard to get everything.
Repository: peterqliu/threebox
Branch: master
Commit: 6e6a1ae3878c
Files: 54
Total size: 1.7 MB
Directory structure:
gitextract_b5dgj9ng/
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── dist/
│ └── threebox.js
├── docs/
│ ├── SymbolLayer3D.md
│ └── Threebox.md
├── examples/
│ ├── Object3D.html
│ ├── basic.html
│ ├── config_template.js
│ ├── line.html
│ ├── logistics.html
│ ├── mercator.html
│ ├── models/
│ │ ├── Truck.mtl
│ │ └── Truck.obj
│ ├── old/
│ │ ├── basic.html
│ │ ├── flocking.html
│ │ └── orientation.html
│ ├── raycaster.html
│ └── tube.html
├── exports.js
├── main.js
├── package.json
├── src/
│ ├── Animation/
│ │ └── AnimationManager.js
│ ├── Camera/
│ │ └── CameraSync.js
│ ├── Threebox.js
│ ├── Utils/
│ │ ├── Utils.js
│ │ └── ValueGenerator.js
│ ├── objects/
│ │ ├── Object3D.js
│ │ ├── customLines/
│ │ │ ├── Line2.js
│ │ │ ├── LineGeometry.js
│ │ │ ├── LineMaterial.js
│ │ │ ├── LineSegments2.js
│ │ │ ├── LineSegmentsGeometry.js
│ │ │ ├── Wireframe.js
│ │ │ └── WireframeGeometry2.js
│ │ ├── line.js
│ │ ├── loadObj.js
│ │ ├── loaders/
│ │ │ ├── MTLLoader.js
│ │ │ └── OBJLoader.js
│ │ ├── objects.js
│ │ ├── sphere.js
│ │ └── tube.js
│ ├── three.js
│ └── utils/
│ ├── constants.js
│ ├── material.js
│ └── validate.js
└── tests/
├── threebox-tests-bundle.js
├── threebox-tests.html
├── threebox-tests.js
└── unit/
├── camera.test.js
├── material.test.js
├── object.test.js
├── utilities.test.js
└── validate.test.js
================================================
FILE CONTENTS
================================================
================================================
FILE: CHANGELOG.md
================================================
## 0.3.0
#### Enhancements
- Add an Object class: convenience methods to produce lines, spheres, tubes, and imported OBJ/MTL meshes, as well as a method to bring in THREE.Object3D's produced elsewhere with vanilla Three.js. Most of these are moveable, and have methods to move/rotate/rescale
- No need to call `tb.update()` after putting it in the custom layer's `render()` function.
#### Bug fixes
- Automatically adjust for viewport size (https://github.com/peterqliu/threebox/issues/43)
#### Deprecated (but still functional)
- `.setupDefaultLights()` has moved to an optional `defaultLights` parameter, in the third argument for Threebox().
- `tb.addAtCoordinate()` and `tb.moveToCoordinate()` have been deprecated. `tb.add(Object)` and `Object.setCoords()` replace them
================================================
FILE: LICENSE.txt
================================================
MIT License
Copyright (c) 2017 Peter Liu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# `threebox`
A three.js plugin for Mapbox GL JS, using the custom layer feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.
<img alt="threebox" src="docs/gallery.jpg">
### Compatibility/Dependencies
- Mapbox v.0.50.0 and later (for custom layer support)
- Three.r94 (already bundled into the Threebox build). If desired, other versions can be swapped in and rebuilt [here](https://github.com/peterqliu/threebox/blob/master/src/three.js), though compatibility is not guaranteed.
### Getting started
Download the bundle from [`dist/threebox.js`](dist/threebox.js) and add include it in a `<script>` tag on your page.
Several introductory examples are [here](https://github.com/peterqliu/threebox/tree/master/examples). To run them, create a `config.js` file with your Mapbox access token, alongside and in the format of [the template](https://github.com/peterqliu/threebox/blob/master/examples/config_template.js).
[Documentation lives here](docs/Threebox.md).
### Contributing
Build the library with `npm run build`, or `npm run dev` to rebuild continuously as you develop. Both commands will output a bundle in `/dist/threebox.js`.
Tests live [here](tests/) -- run `index.html` and check the console for test results.
================================================
FILE: dist/threebox.js
================================================
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
window.Threebox = require('./src/Threebox.js'),
window.THREE = require('./src/three.js')
},{"./src/Threebox.js":2,"./src/three.js":16}],2:[function(require,module,exports){
var THREE = require("./three.js");
var CameraSync = require("./camera/CameraSync.js");
var utils = require("./utils/utils.js");
var AnimationManager = require("./animation/AnimationManager.js");
var ThreeboxConstants = require("./utils/constants.js");
var Objects = require("./objects/objects.js");
var material = require("./utils/material.js");
var sphere = require("./objects/sphere.js");
var loadObj = require("./objects/loadObj.js");
var Object3D = require("./objects/Object3D.js");
var line = require("./objects/line.js");
var tube = require("./objects/tube.js");
function Threebox(map, glContext, options){
this.init(map, glContext, options);
};
Threebox.prototype = {
repaint: function(){
this.map.repaint = true;
},
init: function (map, glContext, options){
this.map = map;
// Set up a THREE.js scene
this.renderer = new THREE.WebGLRenderer( {
alpha: true,
antialias: true,
canvas: map.getCanvas(),
context: glContext
} );
this.renderer.shadowMap.enabled = true;
this.renderer.autoClear = false;
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera( 28, window.innerWidth / window.innerHeight, 0.000000000001, Infinity);
// The CameraSync object will keep the Mapbox and THREE.js camera movements in sync.
// It requires a world group to scale as we zoom in. Rotation is handled in the camera's
// projection matrix itself (as is field of view and near/far clipping)
// It automatically registers to listen for move events on the map so we don't need to do that here
this.world = new THREE.Group();
this.scene.add(this.world);
this.cameraSync = new CameraSync(this.map, this.camera, this.world);
//raycaster for mouse events
this.raycaster = new THREE.Raycaster();
// apply starter options
this.options = utils._validate(options || {}, defaultOptions);
if (this.options.defaultLights) this.defaultLights();
},
// Objects
objects: new Objects(AnimationManager),
sphere: sphere,
line: line,
tube: function(obj){
return tube(obj, this.world)
},
Object3D: function(obj, o) {
return Object3D(obj, o)
},
loadObj: loadObj,
// Material
material: function(o){
return material(o)
},
utils: utils,
projectToWorld: function(coords) {
return this.utils.projectToWorld(coords)
},
unprojectFromWorld: function(v3) {
return this.utils.unprojectFromWorld(v3)
},
projectedUnitsPerMeter: function(lat) {
return this.utils.projectedUnitsPerMeter(lat)
},
queryRenderedFeatures: function(point){
var mouse = new THREE.Vector2();
// // scale mouse pixel position to a percentage of the screen's width and height
mouse.x = ( point.x / this.map.transform.width ) * 2 - 1;
mouse.y = 1 - ( point.y / this.map.transform.height ) * 2;
this.raycaster.setFromCamera(mouse, this.camera);
// calculate objects intersecting the picking ray
var intersects = this.raycaster.intersectObjects(this.world.children, true);
return intersects
},
update: function() {
if (this.map.repaint) this.map.repaint = false
var timestamp = Date.now();
// Update any animations
this.objects.animationManager.update(timestamp);
this.renderer.state.reset();
// Render the scene and repaint the map
this.renderer.render( this.scene, this.camera );
if (this.options.passiveRendering === false) this.map.triggerRepaint();
},
add: function(obj) {
this.world.add(obj);
},
remove: function(obj) {
this.world.remove(obj);
},
defaultLights: function(){
this.scene.add( new THREE.AmbientLight( 0xffffff ) );
var sunlight = new THREE.DirectionalLight(0xffffff, 0.25);
sunlight.position.set(0,80000000,100000000);
sunlight.matrixWorldNeedsUpdate = true;
this.world.add(sunlight);
},
memory: function (){ return this.renderer.info.memory},
version: '0.3.0',
// DEPRECATED METHODS
setupDefaultLights: function() {
console.warn('.setupDefaultLights() has been moved to a "defaultLights" option inside Threebox()')
this.defaultLights();
},
addAtCoordinate: function(obj, lnglat, options) {
console.warn('addAtCoordinate() has been deprecated. Check out the and threebox.add() Object.setCoords() methods instead.')
obj = this.Object3D({obj:obj});
obj.setCoords(lnglat)
this.add(obj);
return obj;
},
moveToCoordinate: function(obj, lnglat, options) {
console.warn('addAtCoordinate() has been deprecated. Check out the Object.setCoords() and threebox.add() methods instead.')
if (!obj.setCoords) obj = this.Object3D(obj);
obj.setCoords(lnglat, options);
return obj;
}
}
var defaultOptions = {
defaultLights: false,
passiveRendering: true
}
module.exports = exports = Threebox;
},{"./animation/AnimationManager.js":6,"./camera/CameraSync.js":7,"./objects/Object3D.js":8,"./objects/line.js":9,"./objects/loadObj.js":10,"./objects/objects.js":13,"./objects/sphere.js":14,"./objects/tube.js":15,"./three.js":16,"./utils/constants.js":17,"./utils/material.js":18,"./utils/utils.js":19}],3:[function(require,module,exports){
var THREE = require("../three.js");
var Constants = require("./constants.js");
var validate = require("./validate.js");
var utils = {
prettyPrintMatrix: function(uglymatrix){
for (var s=0; s<4; s++){
var quartet=[uglymatrix[s],
uglymatrix[s+4],
uglymatrix[s+8],
uglymatrix[s+12]];
console.log(quartet.map(function(num){return num.toFixed(4)}))
}
},
makePerspectiveMatrix: function(fovy, aspect, near, far) {
var out = new THREE.Matrix4();
var f = 1.0 / Math.tan(fovy / 2),
nf = 1 / (near - far);
var newMatrix = [
f / aspect, 0, 0, 0,
0, f, 0, 0,
0, 0, (far + near) * nf, -1,
0, 0, (2 * far * near) * nf, 0
]
out.elements = newMatrix
return out;
},
//gimme radians
radify: function(deg){
function convert(degrees){
degrees = degrees || 0;
return Math.PI*2*degrees/360
}
if (typeof deg === 'object'){
//if [x,y,z] array of rotations
if (deg.length > 0){
return deg.map(function(degree){
return convert(degree)
})
}
// if {x: y: z:} rotation object
else {
return [convert(deg.x), convert(deg.y), convert(deg.z)]
}
}
//if just a number
else return convert(deg)
},
//gimme degrees
degreeify: function(rad){
function convert(radians){
radians = radians || 0;
return radians * 360/(Math.PI*2)
}
if (typeof rad === 'object') {
return [convert(rad.x), convert(rad.y), convert(rad.z)]
}
else return convert(rad)
},
projectToWorld: function(coords){
// Spherical mercator forward projection, re-scaling to WORLD_SIZE
var projected = [
-Constants.MERCATOR_A * Constants.DEG2RAD* coords[0] * Constants.PROJECTION_WORLD_SIZE,
-Constants.MERCATOR_A * Math.log(Math.tan((Math.PI*0.25) + (0.5 * Constants.DEG2RAD * coords[1]) )) * Constants.PROJECTION_WORLD_SIZE
];
//z dimension, defaulting to 0 if not provided
if (!coords[2]) projected.push(0)
else {
var pixelsPerMeter = this.projectedUnitsPerMeter(coords[1]);
projected.push( coords[2] * pixelsPerMeter );
}
var result = new THREE.Vector3(projected[0], projected[1], projected[2]);
return result;
},
projectedUnitsPerMeter: function(latitude) {
return Math.abs( Constants.WORLD_SIZE / Math.cos( Constants.DEG2RAD * latitude ) / Constants.EARTH_CIRCUMFERENCE );
},
_scaleVerticesToMeters: function(centerLatLng, vertices) {
var pixelsPerMeter = this.projectedUnitsPerMeter(centerLatLng[1]);
var centerProjected = this.projectToWorld(centerLatLng);
for (var i = 0; i < vertices.length; i++) {
vertices[i].multiplyScalar(pixelsPerMeter);
}
return vertices;
},
projectToScreen: function(coords) {
console.log("WARNING: Projecting to screen coordinates is not yet implemented");
},
unprojectFromScreen: function (pixel) {
console.log("WARNING: unproject is not yet implemented");
},
//world units to lnglat
unprojectFromWorld: function (worldUnits) {
var unprojected = [
-worldUnits.x / (Constants.MERCATOR_A * Constants.DEG2RAD * Constants.PROJECTION_WORLD_SIZE),
2*(Math.atan(Math.exp(worldUnits.y/(Constants.PROJECTION_WORLD_SIZE*(-Constants.MERCATOR_A))))-Math.PI/4)/Constants.DEG2RAD
];
var pixelsPerMeter = this.projectedUnitsPerMeter(unprojected[1]);
//z dimension
var height = worldUnits.z || 0;
unprojected.push( height / pixelsPerMeter );
return unprojected;
},
_flipMaterialSides: function(obj) {
},
// to improve precision, normalize a series of vector3's to their collective center, and move the resultant mesh to that center
normalizeVertices(vertices) {
var geometry = new THREE.Geometry();
for (v3 of vertices) {
geometry.vertices.push(v3)
}
geometry.computeBoundingSphere();
var center = geometry.boundingSphere.center;
var radius = geometry.boundingSphere.radius;
var scaled = vertices.map(function(v3){
var normalized = v3.sub(center);
return normalized;
});
return {vertices: scaled, position: center}
},
//flatten an array of Vector3's into a shallow array of values in x-y-z order, for bufferGeometry
flattenVectors(vectors) {
var flattenedArray = [];
for (vertex of vectors) {
flattenedArray.push(vertex.x, vertex.y, vertex.z);
}
return flattenedArray
},
//convert a line/polygon to Vector3's
lnglatsToWorld: function(coords){
var vector3 = coords.map(
function(pt){
var p = utils.projectToWorld(pt);
var v3 = new THREE.Vector3(p.x, p.y, p.z);
return v3
}
);
return vector3
},
extend: function(original, addition) {
for (key in addition) original[key] = addition[key];
},
clone: function(original) {
var clone = {};
for (key in original) clone[key] = original[key];
return clone;
},
// retrieve object parameters from an options object
types: {
rotation: function(r, currentRotation){
// if number provided, rotate only in Z by that amount
if (typeof r === 'number') r = {z:r};
var degrees = this.applyDefault([r.x, r.y, r.z], currentRotation);
var radians = utils.radify(degrees);
return radians;
},
scale: function(s, currentScale){
if (typeof s === 'number') return s = [s,s,s];
else return this.applyDefault([s.x, s.y, s.z], currentScale);
},
applyDefault: function(array, current){
var output = array.map(function(item, index){
item = item || current[index];
return item
})
return output
}
},
_validate: function(userInputs, defaults){
userInputs = userInputs || {};
var validatedOutput = {};
utils.extend(validatedOutput, userInputs);
for (key of Object.keys(defaults)){
if (userInputs[key] === undefined) {
//make sure required params are present
if (defaults[key] === null) {
console.error(key + ' is required')
return;
}
else validatedOutput[key] = defaults[key]
}
else validatedOutput[key] = userInputs[key]
}
return validatedOutput
},
Validator: new validate(),
exposedMethods: ['projectToWorld', 'projectedUnitsPerMeter', 'extend', 'unprojectFromWorld']
}
module.exports = exports = utils
},{"../three.js":16,"./constants.js":4,"./validate.js":5}],4:[function(require,module,exports){
const WORLD_SIZE = 1024000;
const MERCATOR_A = 6378137.0;
module.exports = exports = {
WORLD_SIZE: WORLD_SIZE,
PROJECTION_WORLD_SIZE: WORLD_SIZE / (MERCATOR_A * Math.PI * 2),
MERCATOR_A: MERCATOR_A, // 900913 projection property
DEG2RAD: Math.PI / 180,
RAD2DEG: 180 / Math.PI,
EARTH_CIRCUMFERENCE: 40075000, // In meters
}
},{}],5:[function(require,module,exports){
// Type validator
function Validate(){
};
Validate.prototype = {
Coords: function(input) {
if (input.constructor !== Array) {
console.error("Coords must be an array")
return
}
if (input.length < 2) {
console.error("Coords length must be at least 2")
return
}
for (member of input) {
if (member.constructor !== Number) {
console.error("Coords values must be numbers")
return
}
}
if (Math.abs(input[1]) > 90) {
console.error("Latitude must be between -90 and 90")
return
}
return input
},
Line: function(input) {
var scope = this;
if (input.constructor !== Array) {
console.error("Line must be an array")
return
}
for (coord of input){
if (!scope.Coords(coord)) {
console.error("Each coordinate in a line must be a valid Coords type")
return
}
}
return input
},
Rotation: function(input) {
if (input.constructor === Number) input = {z: input}
else if (input.constructor === Object) {
for (key of Object.keys(input)){
if (!['x', 'y', 'z'].includes(key)) {
console.error('Rotation parameters must be x, y, or z')
return
}
if (input[key].constructor !== Number) {
console.error('Individual rotation values must be numbers')
return
}
}
}
else {
console.error('Rotation must be an object or a number')
return
}
return input
},
Scale: function(input) {
if (input.constructor === Number) {
input = {x:input, y:input, z: input}
}
else if (input.constructor === Object) {
for (key of Object.keys(input)){
if (!['x', 'y', 'z'].includes(key)) {
console.error('Scale parameters must be x, y, or z')
return
}
if (input[key].constructor !== Number) {
console.error('Individual scale values must be numbers')
return
}
}
}
else {
console.error('Scale must be an object or a number')
return
}
return input
}
}
module.exports = exports = Validate;
},{}],6:[function(require,module,exports){
var threebox = require('../Threebox.js');
var utils = require("../utils/utils.js");
var validate = require("../utils/validate.js");
function AnimationManager(map) {
this.map = map
this.enrolledObjects = [];
this.previousFrameTime;
};
AnimationManager.prototype = {
enroll: function(obj) {
/* Extend the provided object with animation-specific properties and track in the animation manager */
this.enrolledObjects.push(obj);
// Give this object its own internal animation queue
obj.animationQueue = [];
obj.set = function(options) {
//if duration is set, animate to the new state
if (options.duration > 0 ){
var newParams = {
start: Date.now(),
expiration: Date.now() + options.duration,
endState: {}
}
utils.extend(options, newParams);
var translating = options.coords;
var rotating = options.rotation;
var scaling = options.scale || options.scaleX || options.scaleY || options.scaleZ;
if (rotating) {
var r = obj.rotation;
options.startRotation = [r.x, r.y, r.z];
options.endState.rotation = utils.types.rotation(options.rotation, options.startRotation);
options.rotationPerMs = options.endState.rotation
.map(function(angle, index){
return (angle-options.startRotation[index])/options.duration;
})
}
if (scaling) {
var s = obj.scale;
options.startScale = [s.x, s.y, s.z];
options.endState.scale = utils.types.scale(options.scale, options.startScale);
options.scalePerMs = options.endState.scale
.map(function(scale, index){
return (scale-options.startScale[index])/options.duration;
})
}
if (translating) options.pathCurve = new THREE.CatmullRomCurve3(utils.lnglatsToWorld([obj.coordinates, options.coords]));
var entry = {
type:'set',
parameters: options
}
this.animationQueue
.push(entry);
map.repaint = true;
}
//if no duration set, stop object's existing animations and go to that state immediately
else {
this.stop();
options.rotation = utils.radify(options.rotation);
this._setObject(options);
}
return this
};
obj.stop = function(){
this.animationQueue = [];
return this;
}
obj.followPath = function (options, cb){
var entry = {
type: 'followPath',
parameters: utils._validate(options, defaults.followPath)
};
utils.extend(
entry.parameters,
{
pathCurve: new THREE.CatmullRomCurve3(
utils.lnglatsToWorld(options.path)
),
start: Date.now(),
expiration: Date.now() + entry.parameters.duration,
cb: cb
}
);
this.animationQueue
.push(entry);
map.repaint = true;
return this;
};
obj._setObject = function (options){
var p = options.position; // lnglat
var r = options.rotation; // radians
var s = options.scale; //
var w = options.worldCoordinates; //Vector3
var q = options.quaternion // [axis, angle]
if (p) {
this.coordinates = p;
var c = utils.projectToWorld(p);
this.position.copy(c)
}
if (r) this.rotation.set(r[0], r[1], r[2]);
if (s) this.scale.set(s[0], s[1], s[2]);
if (q) this.quaternion.setFromAxisAngle(q[0], q[1]);
if (w) this.position.copy(w);
map.repaint = true
}
},
update: function(now) {
if (this.previousFrameTime === undefined) this.previousFrameTime = now;
var dimensions = ['X','Y','Z'];
//iterate through objects in queue. count in reverse so we can cull objects without frame shifting
for (var a = this.enrolledObjects.length-1; a>=0; a--){
var object = this.enrolledObjects[a];
if(!object.animationQueue || object.animationQueue.length === 0) continue;
//focus on first item in queue
var item = object.animationQueue[0];
var options = item.parameters;
// if an animation is past its expiration date, cull it
if (!options.expiration) {
// console.log('culled')
object.animationQueue.splice(0,1);
// set the start time of the next animation
if (object.animationQueue[0]) object.animationQueue[0].parameters.start = now;
return
}
//if finished, jump to end state and flag animation entry for removal next time around. Execute callback if there is one
var expiring = now >= options.expiration;
if (expiring) {
options.expiration = false;
if (options.endState) object._setObject(options.endState);
options.cb();
}
else {
var timeProgress = (now - options.start) / options.duration;
if (item.type === 'set'){
var objectState = {};
if (options.pathCurve) objectState.worldCoordinates = options.pathCurve.getPoint(timeProgress);
if (options.rotationPerMs) {
objectState.rotation = options.startRotation.map(function(rad, index){
return rad + options.rotationPerMs[index] * timeProgress * options.duration
})
}
if (options.scalePerMs) {
objectState.scale = options.startScale.map(function(scale, index){
return scale + options.scalePerMs[index]*timeProgress * options.duration
})
}
object._setObject(objectState);
}
if (item.type === 'followPath'){
var position = options.pathCurve.getPointAt(timeProgress);
objectState = {worldCoordinates: position};
// if we need to track heading
if (options.trackHeading){
var tangent = options.pathCurve
.getTangentAt(timeProgress)
.normalize();
var axis = new THREE.Vector3(0,0,0);
var up = new THREE.Vector3(0,1,0);
axis
.crossVectors(up, tangent)
.normalize();
var radians = Math.acos(up.dot(tangent));
objectState.quaternion = [axis, radians];
}
object._setObject(objectState);
}
}
}
this.previousFrameTime = now;
}
}
const defaults = {
followPath: {
path: null,
duration: 1000,
trackHeading: true
}
}
module.exports = exports = AnimationManager;
},{"../Threebox.js":2,"../utils/utils.js":19,"../utils/validate.js":20}],7:[function(require,module,exports){
var THREE = require("../three.js");
var utils = require("../utils/utils.js");
var ThreeboxConstants = require("../utils/constants.js");
function CameraSync(map, camera, world) {
this.map = map;
this.camera = camera;
this.active = true;
this.camera.matrixAutoUpdate = false; // We're in charge of the camera now!
// Postion and configure the world group so we can scale it appropriately when the camera zooms
this.world = world || new THREE.Group();
this.world.position.x = this.world.position.y = ThreeboxConstants.WORLD_SIZE/2
this.world.matrixAutoUpdate = false;
//set up basic camera state
this.state = {
fov: 0.6435011087932844,
translateCenter: new THREE.Matrix4,
worldSizeRatio: 512/ThreeboxConstants.WORLD_SIZE
};
this.state.translateCenter.makeTranslation(ThreeboxConstants.WORLD_SIZE/2, -ThreeboxConstants.WORLD_SIZE / 2, 0);
// Listen for move events from the map and update the Three.js camera. Some attributes only change when viewport resizes, so update those accordingly
var _this = this;
this.map
.on('move', function() {
_this.updateCamera()
})
.on('resize', function(){
_this.setupCamera();
})
this.setupCamera();
}
CameraSync.prototype = {
setupCamera: function() {
var t = this.map.transform
const halfFov = this.state.fov / 2;
var cameraToCenterDistance = 0.5 / Math.tan(halfFov) * t.height;
const groundAngle = Math.PI / 2 + t._pitch;
this.state.cameraToCenterDistance = cameraToCenterDistance;
this.state.cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,cameraToCenterDistance);
this.state.topHalfSurfaceDistance = Math.sin(halfFov) * cameraToCenterDistance / Math.sin(Math.PI - groundAngle - halfFov);
this.updateCamera();
},
updateCamera: function(ev) {
if(!this.camera) {
console.log('nocamera')
return;
}
var t = this.map.transform
// Calculate z distance of the farthest fragment that should be rendered.
const furthestDistance = Math.cos(Math.PI / 2 - t._pitch) * this.state.topHalfSurfaceDistance + this.state.cameraToCenterDistance;
// Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`
const farZ = furthestDistance * 1.01;
this.camera.projectionMatrix = utils.makePerspectiveMatrix(this.state.fov, t.width / t.height, 1, farZ);
var cameraWorldMatrix = new THREE.Matrix4();
var cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,this.state.cameraToCenterDistance);
var rotatePitch = new THREE.Matrix4().makeRotationX(t._pitch);
var rotateBearing = new THREE.Matrix4().makeRotationZ(t.angle);
// Unlike the Mapbox GL JS camera, separate camera translation and rotation out into its world matrix
// If this is applied directly to the projection matrix, it will work OK but break raycasting
cameraWorldMatrix
.premultiply(this.state.cameraTranslateZ)
.premultiply(rotatePitch)
.premultiply(rotateBearing)
this.camera.matrixWorld.copy(cameraWorldMatrix);
var zoomPow = t.scale * this.state.worldSizeRatio;
// Handle scaling and translation of objects in the map in the world's matrix transform, not the camera
var scale = new THREE.Matrix4;
var translateCenter = new THREE.Matrix4;
var translateMap = new THREE.Matrix4;
var rotateMap = new THREE.Matrix4;
scale
.makeScale( zoomPow, zoomPow , zoomPow );
var x = -this.map.transform.x || -this.map.transform.point.x;
var y = this.map.transform.y || this.map.transform.point.y;
translateMap
.makeTranslation(x, y, 0);
rotateMap
.makeRotationZ(Math.PI);
this.world.matrix = new THREE.Matrix4;
this.world.matrix
.premultiply(rotateMap)
.premultiply(this.state.translateCenter)
.premultiply(scale)
.premultiply(translateMap)
// utils.prettyPrintMatrix(this.camera.projectionMatrix.elements);
}
}
module.exports = exports = CameraSync;
},{"../three.js":16,"../utils/constants.js":17,"../utils/utils.js":19}],8:[function(require,module,exports){
var Objects = require('./objects.js');
var utils = require("../utils/utils.js");
function Object3D(options) {
options = utils._validate(options, Objects.prototype._defaults.Object3D);
var obj = options.obj;
if (options.units === 'meters') obj = Objects.prototype._makeGroup(options.obj, options);
obj = Objects.prototype._addMethods(obj);
return obj
}
module.exports = exports = Object3D;
},{"../utils/utils.js":19,"./objects.js":13}],9:[function(require,module,exports){
var THREE = require("../three.js");
var utils = require("../utils/utils.js");
var Objects = require('./objects.js');
function line(obj){
obj = utils._validate(obj, Objects.prototype._defaults.line);
// Geometry
var straightProject = utils.lnglatsToWorld(obj.geometry);
var normalized = utils.normalizeVertices(straightProject);
var flattenedArray = utils.flattenVectors(normalized.vertices);
console.log('line', normalized.vertices)
var geometry = new THREE.LineGeometry();
geometry.setPositions( flattenedArray );
// geometry.setColors( colors );
// Material
matLine = new THREE.LineMaterial( {
color: obj.color,
linewidth: obj.width, // in pixels
dashed: false,
opacity: obj.opacity
} );
matLine.resolution.set( window.innerWidth, window.innerHeight );
matLine.isMaterial = true;
matLine.transparent = true;
matLine.depthWrite = false;
// Mesh
line = new THREE.Line2( geometry, matLine );
line.position.copy(normalized.position)
line.computeLineDistances();
return line
}
module.exports = exports = line;
/**
* custom line shader by WestLangley, sourced from https://github.com/mrdoob/three.js/tree/master/examples/js/lines
*
*/
THREE.LineSegmentsGeometry = function () {
THREE.InstancedBufferGeometry.call( this );
this.type = 'LineSegmentsGeometry';
var plane = new THREE.BufferGeometry();
var positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];
var uvs = [ 0, 1, 1, 1, 0, .5, 1, .5, 0, .5, 1, .5, 0, 0, 1, 0 ];
var index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];
this.setIndex( index );
this.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
this.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );
};
THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.InstancedBufferGeometry.prototype ), {
constructor: THREE.LineSegmentsGeometry,
isLineSegmentsGeometry: true,
applyMatrix: function ( matrix ) {
var start = this.attributes.instanceStart;
var end = this.attributes.instanceEnd;
if ( start !== undefined ) {
matrix.applyToBufferAttribute( start );
matrix.applyToBufferAttribute( end );
start.data.needsUpdate = true;
}
if ( this.boundingBox !== null ) {
this.computeBoundingBox();
}
if ( this.boundingSphere !== null ) {
this.computeBoundingSphere();
}
return this;
},
setPositions: function ( array ) {
var lineSegments;
if ( array instanceof Float32Array ) {
lineSegments = array;
} else if ( Array.isArray( array ) ) {
lineSegments = new Float32Array( array );
}
var instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz
this.addAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz
this.addAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz
//
this.computeBoundingBox();
this.computeBoundingSphere();
return this;
},
setColors: function ( array ) {
var colors;
if ( array instanceof Float32Array ) {
colors = array;
} else if ( Array.isArray( array ) ) {
colors = new Float32Array( array );
}
var instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb
this.addAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb
this.addAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb
return this;
},
fromWireframeGeometry: function ( geometry ) {
this.setPositions( geometry.attributes.position.array );
return this;
},
fromEdgesGeometry: function ( geometry ) {
this.setPositions( geometry.attributes.position.array );
return this;
},
fromMesh: function ( mesh ) {
this.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) );
// set colors, maybe
return this;
},
fromLineSegements: function ( lineSegments ) {
var geometry = lineSegments.geometry;
if ( geometry.isGeometry ) {
this.setPositions( geometry.vertices );
} else if ( geometry.isBufferGeometry ) {
this.setPositions( geometry.position.array ); // assumes non-indexed
}
// set colors, maybe
return this;
},
computeBoundingBox: function () {
var box = new THREE.Box3();
return function computeBoundingBox() {
if ( this.boundingBox === null ) {
this.boundingBox = new THREE.Box3();
}
var start = this.attributes.instanceStart;
var end = this.attributes.instanceEnd;
if ( start !== undefined && end !== undefined ) {
this.boundingBox.setFromBufferAttribute( start );
box.setFromBufferAttribute( end );
this.boundingBox.union( box );
}
};
}(),
computeBoundingSphere: function () {
var vector = new THREE.Vector3();
return function computeBoundingSphere() {
if ( this.boundingSphere === null ) {
this.boundingSphere = new THREE.Sphere();
}
if ( this.boundingBox === null ) {
this.computeBoundingBox();
}
var start = this.attributes.instanceStart;
var end = this.attributes.instanceEnd;
if ( start !== undefined && end !== undefined ) {
var center = this.boundingSphere.center;
this.boundingBox.getCenter( center );
var maxRadiusSq = 0;
for ( var i = 0, il = start.count; i < il; i ++ ) {
vector.fromBufferAttribute( start, i );
maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );
vector.fromBufferAttribute( end, i );
maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );
}
this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
if ( isNaN( this.boundingSphere.radius ) ) {
console.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );
}
}
};
}(),
toJSON: function () {
// todo
},
clone: function () {
// todo
},
copy: function ( source ) {
// todo
return this;
}
} );
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.LineGeometry = function () {
THREE.LineSegmentsGeometry.call( this );
this.type = 'LineGeometry';
};
THREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {
constructor: THREE.LineGeometry,
isLineGeometry: true,
setPositions: function ( array ) {
// converts [ x1, y1, z1, x2, y2, z2, ... ] to pairs format
var length = array.length - 3;
var points = new Float32Array( 2 * length );
for ( var i = 0; i < length; i += 3 ) {
points[ 2 * i ] = array[ i ];
points[ 2 * i + 1 ] = array[ i + 1 ];
points[ 2 * i + 2 ] = array[ i + 2 ];
points[ 2 * i + 3 ] = array[ i + 3 ];
points[ 2 * i + 4 ] = array[ i + 4 ];
points[ 2 * i + 5 ] = array[ i + 5 ];
}
THREE.LineSegmentsGeometry.prototype.setPositions.call( this, points );
return this;
},
setColors: function ( array ) {
// converts [ r1, g1, b1, r2, g2, b2, ... ] to pairs format
var length = array.length - 3;
var colors = new Float32Array( 2 * length );
for ( var i = 0; i < length; i += 3 ) {
colors[ 2 * i ] = array[ i ];
colors[ 2 * i + 1 ] = array[ i + 1 ];
colors[ 2 * i + 2 ] = array[ i + 2 ];
colors[ 2 * i + 3 ] = array[ i + 3 ];
colors[ 2 * i + 4 ] = array[ i + 4 ];
colors[ 2 * i + 5 ] = array[ i + 5 ];
}
THREE.LineSegmentsGeometry.prototype.setColors.call( this, colors );
return this;
},
fromLine: function ( line ) {
var geometry = line.geometry;
if ( geometry.isGeometry ) {
this.setPositions( geometry.vertices );
} else if ( geometry.isBufferGeometry ) {
this.setPositions( geometry.position.array ); // assumes non-indexed
}
// set colors, maybe
return this;
},
copy: function ( source ) {
// todo
return this;
}
} );
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.WireframeGeometry2 = function ( geometry ) {
THREE.LineSegmentsGeometry.call( this );
this.type = 'WireframeGeometry2';
this.fromWireframeGeometry( new THREE.WireframeGeometry( geometry ) );
// set colors, maybe
};
THREE.WireframeGeometry2.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {
constructor: THREE.WireframeGeometry2,
isWireframeGeometry2: true,
copy: function ( source ) {
// todo
return this;
}
} );
/**
* @author WestLangley / http://github.com/WestLangley
*
* parameters = {
* color: <hex>,
* linewidth: <float>,
* dashed: <boolean>,
* dashScale: <float>,
* dashSize: <float>,
* gapSize: <float>,
* resolution: <Vector2>, // to be set by renderer
* }
*/
THREE.UniformsLib.line = {
linewidth: { value: 1 },
resolution: { value: new THREE.Vector2( 1, 1 ) },
dashScale: { value: 1 },
dashSize: { value: 1 },
gapSize: { value: 1 } // todo FIX - maybe change to totalSize
};
THREE.ShaderLib[ 'line' ] = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib.common,
THREE.UniformsLib.fog,
THREE.UniformsLib.line
] ),
vertexShader:
`
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
uniform float linewidth;
uniform vec2 resolution;
attribute vec3 instanceStart;
attribute vec3 instanceEnd;
attribute vec3 instanceColorStart;
attribute vec3 instanceColorEnd;
varying vec2 vUv;
#ifdef USE_DASH
uniform float dashScale;
attribute float instanceDistanceStart;
attribute float instanceDistanceEnd;
varying float vLineDistance;
#endif
void trimSegment( const in vec4 start, inout vec4 end ) {
// trim end segment so it terminates between the camera plane and the near plane
// conservative estimate of the near plane
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
float nearEstimate = - 0.5 * b / a;
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
end.xyz = mix( start.xyz, end.xyz, alpha );
}
void main() {
#ifdef USE_COLOR
vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
#endif
#ifdef USE_DASH
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
#endif
float aspect = resolution.x / resolution.y;
vUv = uv;
// camera space
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
// perhaps there is a more elegant solution -- WestLangley
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
if ( perspective ) {
if ( start.z < 0.0 && end.z >= 0.0 ) {
trimSegment( start, end );
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
trimSegment( end, start );
}
}
// clip space
vec4 clipStart = projectionMatrix * start;
vec4 clipEnd = projectionMatrix * end;
// ndc space
vec2 ndcStart = clipStart.xy / clipStart.w;
vec2 ndcEnd = clipEnd.xy / clipEnd.w;
// direction
vec2 dir = ndcEnd - ndcStart;
// account for clip-space aspect ratio
dir.x *= aspect;
dir = normalize( dir );
// perpendicular to dir
vec2 offset = vec2( dir.y, - dir.x );
// undo aspect ratio adjustment
dir.x /= aspect;
offset.x /= aspect;
// sign flip
if ( position.x < 0.0 ) offset *= - 1.0;
// endcaps
if ( position.y < 0.0 ) {
offset += - dir;
} else if ( position.y > 1.0 ) {
offset += dir;
}
// adjust for linewidth
offset *= linewidth;
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
offset /= resolution.y;
// select end
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
// back to clip space
offset *= clip.w;
clip.xy += offset;
gl_Position = clip;
#include <logdepthbuf_vertex>
#include <worldpos_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}
`,
fragmentShader:
`
uniform vec3 diffuse;
uniform float opacity;
#ifdef USE_DASH
uniform float dashSize;
uniform float gapSize;
#endif
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vUv;
void main() {
#include <clipping_planes_fragment>
#ifdef USE_DASH
if ( vUv.y < 0.5 || vUv.y > 0.5 ) discard; // discard endcaps
if ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
#endif
if ( vUv.y < 0.5 || vUv.y > 0.5 ) {
float a = vUv.x - 0.5;
float b = vUv.y - 0.5;
float len2 = a * a + b * b;
if ( len2 > 0.25 ) discard;
}
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <color_fragment>
gl_FragColor = vec4( diffuseColor.rgb, opacity );
#include <premultiplied_alpha_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}
`
};
THREE.LineMaterial = function ( parameters ) {
var lineUniforms = THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms );
lineUniforms.opacity.value = parameters.opacity;
THREE.ShaderMaterial.call( this, {
type: 'LineMaterial',
uniforms: lineUniforms,
vertexShader: THREE.ShaderLib[ 'line' ].vertexShader,
fragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader
} );
this.dashed = false;
Object.defineProperties( this, {
color: {
enumerable: true,
get: function () {
return this.uniforms.diffuse.value;
},
set: function ( value ) {
this.uniforms.diffuse.value = value;
}
},
linewidth: {
enumerable: true,
get: function () {
return this.uniforms.linewidth.value;
},
set: function ( value ) {
this.uniforms.linewidth.value = value;
}
},
dashScale: {
enumerable: true,
get: function () {
return this.uniforms.dashScale.value;
},
set: function ( value ) {
this.uniforms.dashScale.value = value;
}
},
dashSize: {
enumerable: true,
get: function () {
return this.uniforms.dashSize.value;
},
set: function ( value ) {
this.uniforms.dashSize.value = value;
}
},
gapSize: {
enumerable: true,
get: function () {
return this.uniforms.gapSize.value;
},
set: function ( value ) {
this.uniforms.gapSize.value = value;
}
},
resolution: {
enumerable: true,
get: function () {
return this.uniforms.resolution.value;
},
set: function ( value ) {
this.uniforms.resolution.value.copy( value );
}
}
} );
this.setValues( parameters );
};
THREE.LineMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype );
THREE.LineMaterial.prototype.constructor = THREE.LineMaterial;
THREE.LineMaterial.prototype.isLineMaterial = true;
THREE.LineMaterial.prototype.copy = function ( source ) {
THREE.ShaderMaterial.prototype.copy.call( this, source );
this.color.copy( source.color );
this.linewidth = source.linewidth;
this.resolution = source.resolution;
// todo
return this;
};
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.LineSegments2 = function ( geometry, material ) {
THREE.Mesh.call( this );
this.type = 'LineSegments2';
this.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();
this.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );
};
THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
constructor: THREE.LineSegments2,
isLineSegments2: true,
computeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...
var start = new THREE.Vector3();
var end = new THREE.Vector3();
return function computeLineDistances() {
var geometry = this.geometry;
var instanceStart = geometry.attributes.instanceStart;
var instanceEnd = geometry.attributes.instanceEnd;
var lineDistances = new Float32Array( 2 * instanceStart.data.count );
for ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {
start.fromBufferAttribute( instanceStart, i );
end.fromBufferAttribute( instanceEnd, i );
lineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];
lineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );
}
var instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1
geometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0
geometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1
return this;
};
}() ),
copy: function ( source ) {
// todo
return this;
}
} );
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.Line2 = function ( geometry, material ) {
THREE.LineSegments2.call( this );
this.type = 'Line2';
this.geometry = geometry !== undefined ? geometry : new THREE.LineGeometry();
this.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );
};
THREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.prototype ), {
constructor: THREE.Line2,
isLine2: true,
copy: function ( source ) {
// todo
return this;
}
} );
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.Wireframe = function ( geometry, material ) {
THREE.Mesh.call( this );
this.type = 'Wireframe';
this.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();
this.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );
};
THREE.Wireframe.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
constructor: THREE.Wireframe,
isWireframe: true,
computeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...
var start = new THREE.Vector3();
var end = new THREE.Vector3();
return function computeLineDistances() {
var geometry = this.geometry;
var instanceStart = geometry.attributes.instanceStart;
var instanceEnd = geometry.attributes.instanceEnd;
var lineDistances = new Float32Array( 2 * instanceStart.data.count );
for ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {
start.fromBufferAttribute( instanceStart, i );
end.fromBufferAttribute( instanceEnd, i );
lineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];
lineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );
}
var instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1
geometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0
geometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1
return this;
};
}() ),
copy: function ( source ) {
// todo
return this;
}
} );
},{"../three.js":16,"../utils/utils.js":19,"./objects.js":13}],10:[function(require,module,exports){
var utils = require("../utils/utils.js");
var Objects = require('./objects.js');
const OBJLoader = require("./loaders/OBJLoader.js");
const MTLLoader = require("./loaders/MTLLoader.js");
function loadObj(options, cb){
if (options === undefined) return console.error("Invalid options provided to loadObj()");
this.loaded = false;
const modelComplete = (m) => {
console.log("Model complete!", m);
if(--remaining === 0) this.loaded = true;
}
// TODO: Support formats other than OBJ/MTL
const objLoader = new OBJLoader();
const materialLoader = new MTLLoader();
materialLoader.load(options.mtl, loadObject, () => (null), error => {
console.warn("No material file found for SymbolLayer3D model " + m);
});
function loadObject(materials) {
if (materials) {
materials.preload();
objLoader.setMaterials( materials );
}
objLoader.load(options.obj, obj => {
var r = utils.types.rotation(options, [0, 0, 0]);
var s = utils.types.scale(options, [1, 1, 1]);
obj = obj.children[0];
obj.rotation.set(r[0] + Math.PI/2, r[1] + Math.PI, r[2]);
obj.scale.set(s[0], s[1], s[2]);
var projScaleGroup = new THREE.Group();
projScaleGroup.add(obj)
var userScaleGroup = Objects.prototype._makeGroup(projScaleGroup, options);
Objects.prototype._addMethods(userScaleGroup);
cb(userScaleGroup);
}, () => (null), error => {
console.error("Could not load model file.");
} );
};
}
module.exports = exports = loadObj;
},{"../utils/utils.js":19,"./loaders/MTLLoader.js":11,"./loaders/OBJLoader.js":12,"./objects.js":13}],11:[function(require,module,exports){
/**
* Loads a Wavefront .mtl file specifying materials
*
* @author angelxuanchang
*/
const THREE = require('../../three.js');
const MTLLoader = function ( manager ) {
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
};
MTLLoader.prototype = {
constructor: MTLLoader,
/**
* Loads and parses a MTL asset from a URL.
*
* @param {String} url - URL to the MTL file.
* @param {Function} [onLoad] - Callback invoked with the loaded object.
* @param {Function} [onProgress] - Callback for download progress.
* @param {Function} [onError] - Callback for download errors.
*
* @see setPath setTexturePath
*
* @note In order for relative texture references to resolve correctly
* you must call setPath and/or setTexturePath explicitly prior to load.
*/
load: function ( url, onLoad, onProgress, onError ) {
var scope = this;
var loader = new THREE.FileLoader( this.manager );
loader.setPath( this.path );
loader.load( url, function ( text ) {
onLoad( scope.parse( text ) );
}, onProgress, onError );
},
/**
* Set base path for resolving references.
* If set this path will be prepended to each loaded and found reference.
*
* @see setTexturePath
* @param {String} path
*
* @example
* mtlLoader.setPath( 'assets/obj/' );
* mtlLoader.load( 'my.mtl', ... );
*/
setPath: function ( path ) {
this.path = path;
},
/**
* Set base path for resolving texture references.
* If set this path will be prepended found texture reference.
* If not set and setPath is, it will be used as texture base path.
*
* @see setPath
* @param {String} path
*
* @example
* mtlLoader.setPath( 'assets/obj/' );
* mtlLoader.setTexturePath( 'assets/textures/' );
* mtlLoader.load( 'my.mtl', ... );
*/
setTexturePath: function ( path ) {
this.texturePath = path;
},
setBaseUrl: function ( path ) {
console.warn( 'THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead.' );
this.setTexturePath( path );
},
setCrossOrigin: function ( value ) {
this.crossOrigin = value;
},
setMaterialOptions: function ( value ) {
this.materialOptions = value;
},
/**
* Parses a MTL file.
*
* @param {String} text - Content of MTL file
* @return {THREE.MTLLoader.MaterialCreator}
*
* @see setPath setTexturePath
*
* @note In order for relative texture references to resolve correctly
* you must call setPath and/or setTexturePath explicitly prior to parse.
*/
parse: function ( text ) {
var lines = text.split( '\n' );
var info = {};
var delimiter_pattern = /\s+/;
var materialsInfo = {};
for ( var i = 0; i < lines.length; i ++ ) {
var line = lines[ i ];
line = line.trim();
if ( line.length === 0 || line.charAt( 0 ) === '#' ) {
// Blank line or comment ignore
continue;
}
var pos = line.indexOf( ' ' );
var key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;
key = key.toLowerCase();
var value = ( pos >= 0 ) ? line.substring( pos + 1 ) : '';
value = value.trim();
if ( key === 'newmtl' ) {
// New material
info = { name: value };
materialsInfo[ value ] = info;
} else if ( info ) {
if ( key === 'ka' || key === 'kd' || key === 'ks' ) {
var ss = value.split( delimiter_pattern, 3 );
info[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];
} else {
info[ key ] = value;
}
}
}
var materialCreator = new MTLLoader.MaterialCreator( this.texturePath || this.path, this.materialOptions );
materialCreator.setCrossOrigin( this.crossOrigin );
materialCreator.setManager( this.manager );
materialCreator.setMaterials( materialsInfo );
return materialCreator;
}
};
/**
* Create a new THREE-MTLLoader.MaterialCreator
* @param baseUrl - Url relative to which textures are loaded
* @param options - Set of options on how to construct the materials
* side: Which side to apply the material
* THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide
* wrap: What type of wrapping to apply for textures
* THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping
* normalizeRGB: RGBs need to be normalized to 0-1 from 0-255
* Default: false, assumed to be already normalized
* ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's
* Default: false
* @constructor
*/
MTLLoader.MaterialCreator = function ( baseUrl, options ) {
this.baseUrl = baseUrl || '';
this.options = options;
this.materialsInfo = {};
this.materials = {};
this.materialsArray = [];
this.nameLookup = {};
this.side = ( this.options && this.options.side ) ? this.options.side : THREE.FrontSide;
this.wrap = ( this.options && this.options.wrap ) ? this.options.wrap : THREE.RepeatWrapping;
};
MTLLoader.MaterialCreator.prototype = {
constructor: MTLLoader.MaterialCreator,
setCrossOrigin: function ( value ) {
this.crossOrigin = value;
},
setManager: function ( value ) {
this.manager = value;
},
setMaterials: function ( materialsInfo ) {
this.materialsInfo = this.convert( materialsInfo );
this.materials = {};
this.materialsArray = [];
this.nameLookup = {};
},
convert: function ( materialsInfo ) {
if ( ! this.options ) return materialsInfo;
var converted = {};
for ( var mn in materialsInfo ) {
// Convert materials info into normalized form based on options
var mat = materialsInfo[ mn ];
var covmat = {};
converted[ mn ] = covmat;
for ( var prop in mat ) {
var save = true;
var value = mat[ prop ];
var lprop = prop.toLowerCase();
switch ( lprop ) {
case 'kd':
case 'ka':
case 'ks':
// Diffuse color (color under white light) using RGB values
if ( this.options && this.options.normalizeRGB ) {
value = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];
}
if ( this.options && this.options.ignoreZeroRGBs ) {
if ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {
// ignore
save = false;
}
}
break;
default:
break;
}
if ( save ) {
covmat[ lprop ] = value;
}
}
}
return converted;
},
preload: function () {
for ( var mn in this.materialsInfo ) {
this.create( mn );
}
},
getIndex: function ( materialName ) {
return this.nameLookup[ materialName ];
},
getAsArray: function () {
var index = 0;
for ( var mn in this.materialsInfo ) {
this.materialsArray[ index ] = this.create( mn );
this.nameLookup[ mn ] = index;
index ++;
}
return this.materialsArray;
},
create: function ( materialName ) {
if ( this.materials[ materialName ] === undefined ) {
this.createMaterial_( materialName );
}
return this.materials[ materialName ];
},
createMaterial_: function ( materialName ) {
// Create material
var scope = this;
var mat = this.materialsInfo[ materialName ];
var params = {
name: materialName,
side: this.side
};
function resolveURL( baseUrl, url ) {
if ( typeof url !== 'string' || url === '' )
return '';
// Absolute URL
if ( /^https?:\/\//i.test( url ) ) return url;
return baseUrl + url;
}
function setMapForType( mapType, value ) {
if ( params[ mapType ] ) return; // Keep the first encountered texture
var texParams = scope.getTextureParams( value, params );
var map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );
map.repeat.copy( texParams.scale );
map.offset.copy( texParams.offset );
map.wrapS = scope.wrap;
map.wrapT = scope.wrap;
params[ mapType ] = map;
}
for ( var prop in mat ) {
var value = mat[ prop ];
if ( value === '' ) continue;
switch ( prop.toLowerCase() ) {
// Ns is material specular exponent
case 'kd':
// Diffuse color (color under white light) using RGB values
params.color = new THREE.Color().fromArray( value );
break;
case 'ks':
// Specular color (color when light is reflected from shiny surface) using RGB values
params.specular = new THREE.Color().fromArray( value );
break;
case 'map_kd':
// Diffuse texture map
setMapForType( "map", value );
break;
case 'map_ks':
// Specular map
setMapForType( "specularMap", value );
break;
case 'map_bump':
case 'bump':
// Bump texture map
setMapForType( "bumpMap", value );
break;
case 'ns':
// The specular exponent (defines the focus of the specular highlight)
// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.
params.shininess = parseFloat( value );
break;
case 'd':
if ( value < 1 ) {
params.opacity = value;
params.transparent = true;
}
break;
case 'Tr':
if ( value > 0 ) {
params.opacity = 1 - value;
params.transparent = true;
}
break;
default:
break;
}
}
this.materials[ materialName ] = new THREE.MeshPhongMaterial( params );
return this.materials[ materialName ];
},
getTextureParams: function ( value, matParams ) {
var texParams = {
scale: new THREE.Vector2( 1, 1 ),
offset: new THREE.Vector2( 0, 0 )
};
var items = value.split( /\s+/ );
var pos;
pos = items.indexOf( '-bm' );
if ( pos >= 0 ) {
matParams.bumpScale = parseFloat( items[ pos + 1 ] );
items.splice( pos, 2 );
}
pos = items.indexOf( '-s' );
if ( pos >= 0 ) {
texParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );
items.splice( pos, 4 ); // we expect 3 parameters here!
}
pos = items.indexOf( '-o' );
if ( pos >= 0 ) {
texParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );
items.splice( pos, 4 ); // we expect 3 parameters here!
}
texParams.url = items.join( ' ' ).trim();
return texParams;
},
loadTexture: function ( url, mapping, onLoad, onProgress, onError ) {
var texture;
var loader = THREE.Loader.Handlers.get( url );
var manager = ( this.manager !== undefined ) ? this.manager : THREE.DefaultLoadingManager;
if ( loader === null ) {
loader = new THREE.TextureLoader( manager );
}
if ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );
texture = loader.load( url, onLoad, onProgress, onError );
if ( mapping !== undefined ) texture.mapping = mapping;
return texture;
}
};
module.exports = exports = MTLLoader;
},{"../../three.js":16}],12:[function(require,module,exports){
/**
* @author mrdoob / http://mrdoob.com/
*/
const THREE = require('../../three.js');
const OBJLoader = function ( manager ) {
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
this.materials = null;
this.regexp = {
// v float float float
vertex_pattern : /^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
// vn float float float
normal_pattern : /^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
// vt float float
uv_pattern : /^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
// f vertex vertex vertex
face_vertex : /^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,
// f vertex/uv vertex/uv vertex/uv
face_vertex_uv : /^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,
// f vertex/uv/normal vertex/uv/normal vertex/uv/normal
face_vertex_uv_normal : /^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,
// f vertex//normal vertex//normal vertex//normal
face_vertex_normal : /^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,
// o object_name | g group_name
object_pattern : /^[og]\s*(.+)?/,
// s boolean
smoothing_pattern : /^s\s+(\d+|on|off)/,
// mtllib file_reference
material_library_pattern : /^mtllib /,
// usemtl material_name
material_use_pattern : /^usemtl /
};
};
OBJLoader.prototype = {
constructor: OBJLoader,
load: function ( url, onLoad, onProgress, onError ) {
var scope = this;
var loader = new THREE.FileLoader( scope.manager );
loader.setPath( this.path );
loader.load( url, function ( text ) {
onLoad( scope.parse( text ) );
}, onProgress, onError );
},
setPath: function ( value ) {
this.path = value;
},
setMaterials: function ( materials ) {
this.materials = materials;
},
_createParserState : function () {
var state = {
objects : [],
object : {},
vertices : [],
normals : [],
uvs : [],
materialLibraries : [],
startObject: function ( name, fromDeclaration ) {
// If the current object (initial from reset) is not from a g/o declaration in the parsed
// file. We need to use it for the first parsed g/o to keep things in sync.
if ( this.object && this.object.fromDeclaration === false ) {
this.object.name = name;
this.object.fromDeclaration = ( fromDeclaration !== false );
return;
}
var previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );
if ( this.object && typeof this.object._finalize === 'function' ) {
this.object._finalize( true );
}
this.object = {
name : name || '',
fromDeclaration : ( fromDeclaration !== false ),
geometry : {
vertices : [],
normals : [],
uvs : []
},
materials : [],
smooth : true,
startMaterial : function( name, libraries ) {
var previous = this._finalize( false );
// New usemtl declaration overwrites an inherited material, except if faces were declared
// after the material, then it must be preserved for proper MultiMaterial continuation.
if ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {
this.materials.splice( previous.index, 1 );
}
var material = {
index : this.materials.length,
name : name || '',
mtllib : ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),
smooth : ( previous !== undefined ? previous.smooth : this.smooth ),
groupStart : ( previous !== undefined ? previous.groupEnd : 0 ),
groupEnd : -1,
groupCount : -1,
inherited : false,
clone : function( index ) {
var cloned = {
index : ( typeof index === 'number' ? index : this.index ),
name : this.name,
mtllib : this.mtllib,
smooth : this.smooth,
groupStart : 0,
groupEnd : -1,
groupCount : -1,
inherited : false
};
cloned.clone = this.clone.bind(cloned);
return cloned;
}
};
this.materials.push( material );
return material;
},
currentMaterial : function() {
if ( this.materials.length > 0 ) {
return this.materials[ this.materials.length - 1 ];
}
return undefined;
},
_finalize : function( end ) {
var lastMultiMaterial = this.currentMaterial();
if ( lastMultiMaterial && lastMultiMaterial.groupEnd === -1 ) {
lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;
lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;
lastMultiMaterial.inherited = false;
}
// Ignore objects tail materials if no face declarations followed them before a new o/g started.
if ( end && this.materials.length > 1 ) {
for ( var mi = this.materials.length - 1; mi >= 0; mi-- ) {
if ( this.materials[mi].groupCount <= 0 ) {
this.materials.splice( mi, 1 );
}
}
}
// Guarantee at least one empty material, this makes the creation later more straight forward.
if ( end && this.materials.length === 0 ) {
this.materials.push({
name : '',
smooth : this.smooth
});
}
return lastMultiMaterial;
}
};
// Inherit previous objects material.
// Spec tells us that a declared material must be set to all objects until a new material is declared.
// If a usemtl declaration is encountered while this new object is being parsed, it will
// overwrite the inherited material. Exception being that there was already face declarations
// to the inherited material, then it will be preserved for proper MultiMaterial continuation.
if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === "function" ) {
var declared = previousMaterial.clone( 0 );
declared.inherited = true;
this.object.materials.push( declared );
}
this.objects.push( this.object );
},
finalize : function() {
if ( this.object && typeof this.object._finalize === 'function' ) {
this.object._finalize( true );
}
},
parseVertexIndex: function ( value, len ) {
var index = parseInt( value, 10 );
return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
},
parseNormalIndex: function ( value, len ) {
var index = parseInt( value, 10 );
return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
},
parseUVIndex: function ( value, len ) {
var index = parseInt( value, 10 );
return ( index >= 0 ? index - 1 : index + len / 2 ) * 2;
},
addVertex: function ( a, b, c ) {
var src = this.vertices;
var dst = this.object.geometry.vertices;
dst.push( src[ a + 0 ] );
dst.push( src[ a + 1 ] );
dst.push( src[ a + 2 ] );
dst.push( src[ b + 0 ] );
dst.push( src[ b + 1 ] );
dst.push( src[ b + 2 ] );
dst.push( src[ c + 0 ] );
dst.push( src[ c + 1 ] );
dst.push( src[ c + 2 ] );
},
addVertexLine: function ( a ) {
var src = this.vertices;
var dst = this.object.geometry.vertices;
dst.push( src[ a + 0 ] );
dst.push( src[ a + 1 ] );
dst.push( src[ a + 2 ] );
},
addNormal : function ( a, b, c ) {
var src = this.normals;
var dst = this.object.geometry.normals;
dst.push( src[ a + 0 ] );
dst.push( src[ a + 1 ] );
dst.push( src[ a + 2 ] );
dst.push( src[ b + 0 ] );
dst.push( src[ b + 1 ] );
dst.push( src[ b + 2 ] );
dst.push( src[ c + 0 ] );
dst.push( src[ c + 1 ] );
dst.push( src[ c + 2 ] );
},
addUV: function ( a, b, c ) {
var src = this.uvs;
var dst = this.object.geometry.uvs;
dst.push( src[ a + 0 ] );
dst.push( src[ a + 1 ] );
dst.push( src[ b + 0 ] );
dst.push( src[ b + 1 ] );
dst.push( src[ c + 0 ] );
dst.push( src[ c + 1 ] );
},
addUVLine: function ( a ) {
var src = this.uvs;
var dst = this.object.geometry.uvs;
dst.push( src[ a + 0 ] );
dst.push( src[ a + 1 ] );
},
addFace: function ( a, b, c, d, ua, ub, uc, ud, na, nb, nc, nd ) {
var vLen = this.vertices.length;
var ia = this.parseVertexIndex( a, vLen );
var ib = this.parseVertexIndex( b, vLen );
var ic = this.parseVertexIndex( c, vLen );
var id;
if ( d === undefined ) {
this.addVertex( ia, ib, ic );
} else {
id = this.parseVertexIndex( d, vLen );
this.addVertex( ia, ib, id );
this.addVertex( ib, ic, id );
}
if ( ua !== undefined ) {
var uvLen = this.uvs.length;
ia = this.parseUVIndex( ua, uvLen );
ib = this.parseUVIndex( ub, uvLen );
ic = this.parseUVIndex( uc, uvLen );
if ( d === undefined ) {
this.addUV( ia, ib, ic );
} else {
id = this.parseUVIndex( ud, uvLen );
this.addUV( ia, ib, id );
this.addUV( ib, ic, id );
}
}
if ( na !== undefined ) {
// Normals are many times the same. If so, skip function call and parseInt.
var nLen = this.normals.length;
ia = this.parseNormalIndex( na, nLen );
ib = na === nb ? ia : this.parseNormalIndex( nb, nLen );
ic = na === nc ? ia : this.parseNormalIndex( nc, nLen );
if ( d === undefined ) {
this.addNormal( ia, ib, ic );
} else {
id = this.parseNormalIndex( nd, nLen );
this.addNormal( ia, ib, id );
this.addNormal( ib, ic, id );
}
}
},
addLineGeometry: function ( vertices, uvs ) {
this.object.geometry.type = 'Line';
var vLen = this.vertices.length;
var uvLen = this.uvs.length;
for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {
this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );
}
for ( var uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {
this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );
}
}
};
state.startObject( '', false );
return state;
},
parse: function ( text ) {
//console.time( 'OBJLoader' );
var state = this._createParserState();
if ( text.indexOf( '\r\n' ) !== - 1 ) {
// This is faster than String.split with regex that splits on both
text = text.replace( /\r\n/g, '\n' );
}
if ( text.indexOf( '\\\n' ) !== - 1) {
// join lines separated by a line continuation character (\)
text = text.replace( /\\\n/g, '' );
}
var lines = text.split( '\n' );
var line = '', lineFirstChar = '', lineSecondChar = '';
var lineLength = 0;
var result = [];
// Faster to just trim left side of the line. Use if available.
var trimLeft = ( typeof ''.trimLeft === 'function' );
for ( var i = 0, l = lines.length; i < l; i ++ ) {
line = lines[ i ];
line = trimLeft ? line.trimLeft() : line.trim();
lineLength = line.length;
if ( lineLength === 0 ) continue;
lineFirstChar = line.charAt( 0 );
// @todo invoke passed in handler if any
if ( lineFirstChar === '#' ) continue;
if ( lineFirstChar === 'v' ) {
lineSecondChar = line.charAt( 1 );
if ( lineSecondChar === ' ' && ( result = this.regexp.vertex_pattern.exec( line ) ) !== null ) {
// 0 1 2 3
// ["v 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
state.vertices.push(
parseFloat( result[ 1 ] ),
parseFloat( result[ 2 ] ),
parseFloat( result[ 3 ] )
);
} else if ( lineSecondChar === 'n' && ( result = this.regexp.normal_pattern.exec( line ) ) !== null ) {
// 0 1 2 3
// ["vn 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
state.normals.push(
parseFloat( result[ 1 ] ),
parseFloat( result[ 2 ] ),
parseFloat( result[ 3 ] )
);
} else if ( lineSecondChar === 't' && ( result = this.regexp.uv_pattern.exec( line ) ) !== null ) {
// 0 1 2
// ["vt 0.1 0.2", "0.1", "0.2"]
state.uvs.push(
parseFloat( result[ 1 ] ),
parseFloat( result[ 2 ] )
);
} else {
throw new Error( "Unexpected vertex/normal/uv line: '" + line + "'" );
}
} else if ( lineFirstChar === "f" ) {
if ( ( result = this.regexp.face_vertex_uv_normal.exec( line ) ) !== null ) {
// f vertex/uv/normal vertex/uv/normal vertex/uv/normal
// 0 1 2 3 4 5 6 7 8 9 10 11 12
// ["f 1/1/1 2/2/2 3/3/3", "1", "1", "1", "2", "2", "2", "3", "3", "3", undefined, undefined, undefined]
state.addFace(
result[ 1 ], result[ 4 ], result[ 7 ], result[ 10 ],
result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ],
result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ]
);
} else if ( ( result = this.regexp.face_vertex_uv.exec( line ) ) !== null ) {
// f vertex/uv vertex/uv vertex/uv
// 0 1 2 3 4 5 6 7 8
// ["f 1/1 2/2 3/3", "1", "1", "2", "2", "3", "3", undefined, undefined]
state.addFace(
result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
);
} else if ( ( result = this.regexp.face_vertex_normal.exec( line ) ) !== null ) {
// f vertex//normal vertex//normal vertex//normal
// 0 1 2 3 4 5 6 7 8
// ["f 1//1 2//2 3//3", "1", "1", "2", "2", "3", "3", undefined, undefined]
state.addFace(
result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
undefined, undefined, undefined, undefined,
result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
);
} else if ( ( result = this.regexp.face_vertex.exec( line ) ) !== null ) {
// f vertex vertex vertex
// 0 1 2 3 4
// ["f 1 2 3", "1", "2", "3", undefined]
state.addFace(
result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ]
);
} else {
throw new Error( "Unexpected face line: '" + line + "'" );
}
} else if ( lineFirstChar === "l" ) {
var lineParts = line.substring( 1 ).trim().split( " " );
var lineVertices = [], lineUVs = [];
if ( line.indexOf( "/" ) === - 1 ) {
lineVertices = lineParts;
} else {
for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {
var parts = lineParts[ li ].split( "/" );
if ( parts[ 0 ] !== "" ) lineVertices.push( parts[ 0 ] );
if ( parts[ 1 ] !== "" ) lineUVs.push( parts[ 1 ] );
}
}
state.addLineGeometry( lineVertices, lineUVs );
} else if ( ( result = this.regexp.object_pattern.exec( line ) ) !== null ) {
// o object_name
// or
// g group_name
// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
// var name = result[ 0 ].substr( 1 ).trim();
var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
state.startObject( name );
} else if ( this.regexp.material_use_pattern.test( line ) ) {
// material
state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );
} else if ( this.regexp.material_library_pattern.test( line ) ) {
// mtl file
state.materialLibraries.push( line.substring( 7 ).trim() );
} else if ( ( result = this.regexp.smoothing_pattern.exec( line ) ) !== null ) {
// smooth shading
// @todo Handle files that have varying smooth values for a set of faces inside one geometry,
// but does not define a usemtl for each face set.
// This should be detected and a dummy material created (later MultiMaterial and geometry groups).
// This requires some care to not create extra material on each smooth value for "normal" obj files.
// where explicit usemtl defines geometry groups.
// Example asset: examples/models/obj/cerberus/Cerberus.obj
var value = result[ 1 ].trim().toLowerCase();
state.object.smooth = ( value === '1' || value === 'on' );
var material = state.object.currentMaterial();
if ( material ) {
material.smooth = state.object.smooth;
}
} else {
// Handle null terminated files without exception
if ( line === '\0' ) continue;
throw new Error( "Unexpected line: '" + line + "'" );
}
}
state.finalize();
var container = new THREE.Group();
container.materialLibraries = [].concat( state.materialLibraries );
for ( var i = 0, l = state.objects.length; i < l; i ++ ) {
var object = state.objects[ i ];
var geometry = object.geometry;
var materials = object.materials;
var isLine = ( geometry.type === 'Line' );
// Skip o/g line declarations that did not follow with any faces
if ( geometry.vertices.length === 0 ) continue;
var buffergeometry = new THREE.BufferGeometry();
buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );
if ( geometry.normals.length > 0 ) {
buffergeometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( geometry.normals ), 3 ) );
} else {
buffergeometry.computeVertexNormals();
}
if ( geometry.uvs.length > 0 ) {
buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );
}
// Create materials
var createdMaterials = [];
for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
var sourceMaterial = materials[mi];
var material = undefined;
if ( this.materials !== null ) {
material = this.materials.create( sourceMaterial.name );
// mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.
if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {
var materialLine = new THREE.LineBasicMaterial();
materialLine.copy( material );
materialLine.lights = false;
material = materialLine;
}
}
if ( ! material ) {
material = ( ! isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial() );
material.name = sourceMaterial.name;
}
material.shading = sourceMaterial.smooth ? THREE.SmoothShading : THREE.FlatShading;
createdMaterials.push(material);
}
// Create mesh
var mesh;
if ( createdMaterials.length > 1 ) {
for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
var sourceMaterial = materials[mi];
buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );
}
var multiMaterial = new THREE.MultiMaterial( createdMaterials );
mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, multiMaterial ) : new THREE.LineSegments( buffergeometry, multiMaterial ) );
} else {
mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ) : new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ) );
}
mesh.name = object.name;
container.add( mesh );
}
//console.timeEnd( 'OBJLoader' );
return container;
}
};
module.exports = exports = OBJLoader;
},{"../../three.js":16}],13:[function(require,module,exports){
var utils = require("../utils/utils.js");
var material = require("../utils/material.js");
const AnimationManager = require("../animation/AnimationManager.js");
function Objects(){
}
Objects.prototype = {
// standard 1px line with gl
line: function(obj){
obj = utils._validate(obj, this._defaults.line);
//project to world and normalize
var straightProject = utils.lnglatsToWorld(obj.geometry);
var normalized = utils.normalizeVertices(straightProject);
//flatten array for buffergeometry
var flattenedArray = utils.flattenVectors(normalized.vertices);
var positions = new Float32Array(flattenedArray); // 3 vertices per point
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
// material
var material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 21 } );
var line = new THREE.Line( geometry, material );
line.options = options || {};
line.position.copy(normalized.position)
return line
},
extrusion: function(options){
},
_addMethods: function(obj, static){
var root = this;
if (static) {
}
else {
if (!obj.coordinates) obj.coordinates = [0,0,0];
// Bestow this mesh with animation superpowers and keeps track of its movements in the global animation queue
root.animationManager.enroll(obj);
obj.setCoords = function(lnglat){
/** Place the given object on the map, centered around the provided longitude and latitude
The object's internal coordinates are assumed to be in meter-offset format, meaning
1 unit represents 1 meter distance away from the provided coordinate.
*/
// If object already added, scale the model so that its units are interpreted as meters at the given latitude
if (obj.userData.units === 'meters'){
var s = utils.projectedUnitsPerMeter(lnglat[1]);
obj.scale.set(s,s,s);
}
obj.coordinates = lnglat;
obj.set({position:lnglat})
return obj;
}
obj.setRotation = function(xyz) {
if (typeof xyz === 'number') xyz = {z: xyz}
var r = {
x: utils.radify(xyz.x) || obj.rotation.x,
y: utils.radify(xyz.y) || obj.rotation.y,
z: utils.radify(xyz.z) || obj.rotation.z
}
obj._setObject({rotation: [r.x, r.y, r.z]})
}
}
obj.add = function(){
root.world.add(obj);
if (!static) obj.set({position:obj.coordinates});
return obj;
}
obj.remove = function(){
root.world.remove(obj);
root.map.repaint = true;
}
obj.duplicate = function(a) {
var dupe = obj.clone();
dupe.userData = obj.userData;
root._addMethods(dupe);
return dupe
}
return obj
},
_makeGroup: function(obj, options){
var geoGroup = new THREE.Group();
geoGroup.userData = options || {};
geoGroup.userData.isGeoGroup = true;
var isArrayOfObjects = obj.length;
if (isArrayOfObjects) for (o of obj) geoGroup.add(o)
else geoGroup.add(obj);
utils._flipMaterialSides(obj);
return geoGroup
},
animationManager: new AnimationManager,
_defaults: {
line: {
geometry: null,
color: 'black',
width:1,
opacity:1
},
sphere: {
position: [0,0,0],
radius: 1,
sides: 20,
units: 'scene',
material: 'MeshBasicMaterial'
},
tube: {
geometry: null,
radius: 1,
sides:6,
material: 'MeshBasicMaterial'
},
extrusion:{
footprint: null,
base: 0,
top: 100,
color:'black',
material: 'MeshBasicMaterial',
scaleToLatitude: false
},
loadObj:{
obj: null,
mtl: null,
rotation: 0,
scale: 1,
units: 'scene'
},
Object3D: {
obj: null,
units: 'scene'
}
},
geometries:{
line: ['LineString'],
tube: ['LineString'],
sphere: ['Point'],
}
}
module.exports = exports = Objects;
},{"../animation/AnimationManager.js":6,"../utils/material.js":18,"../utils/utils.js":19}],14:[function(require,module,exports){
var utils = require("../utils/utils.js");
var material = require("../utils/material.js");
var Objects = require('./objects.js');
function Sphere(obj){
obj = utils._validate(obj, Objects.prototype._defaults.sphere);
var geometry = new THREE.SphereBufferGeometry( obj.radius, obj.sides, obj.sides );
var mat = material(obj)
var output = new THREE.Mesh( geometry, mat );
if (obj.units === 'meters') output = Objects.prototype._makeGroup(output, obj);
Objects.prototype._addMethods(output);
return output
}
module.exports = exports = Sphere;
},{"../utils/material.js":18,"../utils/utils.js":19,"./objects.js":13}],15:[function(require,module,exports){
var utils = require("../utils/utils.js");
var material = require("../utils/material.js");
var Objects = require('./objects.js');
var THREE = require("../three.js");
function tube(obj, world){
// validate and prep input geometry
var obj = utils._validate(obj, Objects.prototype._defaults.tube);
var straightProject = utils.lnglatsToWorld(obj.geometry);
var normalized = utils.normalizeVertices(straightProject);
var crossSection = tube.prototype.defineCrossSection(obj);
var vertices = tube.prototype.buildVertices(crossSection, normalized.vertices, world);
var geom = tube.prototype.buildFaces(vertices, normalized.vertices, obj);
var mat = material(obj);
var mesh = new THREE.Mesh( geom, mat );
mesh.position.copy(normalized.position);
return mesh
}
tube.prototype = {
buildVertices: function (crossSection, spine, world){
//create reusable plane for intersection calculations
var geometry = new THREE.PlaneBufferGeometry(99999999999, 9999999999);
var m = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
m.opacity = 0
var plane = new THREE.Mesh( geometry, m );
// world.add( plane );
var geom = new THREE.Geometry();
var lastElbow = false;
// BUILD VERTICES: iterate through points in spine and position each vertex in cross section
// get normalized vectors for each spine segment
var spineSegments = [spine[0].clone().normalize()];
for (i in spine) {
i = parseFloat(i);
var segment;
if (spine[i+1]){
segment = new THREE.Vector3()
.subVectors( spine[i+1], spine[i])
.normalize();
}
spineSegments.push(segment);
}
spineSegments.push(new THREE.Vector3());
for (i in spine) {
i = parseFloat(i);
var lineVertex = spine[i];
// ROTATE cross section
var humerus = spineSegments[i]
var forearm = spineSegments[i+1]
var midpointToLookAt = humerus.clone()
.add(forearm)
.normalize();
if (i === 0) midpointToLookAt = forearm;
else if (i === spine.length - 1) midpointToLookAt = humerus;
// if first point in input line, rotate and translate it to position
if (!lastElbow) {
var elbow = crossSection.clone();
elbow
.lookAt(midpointToLookAt)
elbow.vertices.forEach(function(vertex){
geom.vertices
.push(vertex.add(lineVertex));
})
lastElbow = elbow.vertices;
}
else {
var elbow = [];
plane.position.copy(lineVertex);
plane.lookAt(midpointToLookAt.clone().add(lineVertex));
plane.updateMatrixWorld();
lastElbow.forEach(function(v3){
var raycaster = new THREE.Raycaster(v3, humerus);
var intersection = raycaster
.intersectObject(plane)[0];
if (intersection) {
geom.vertices.push(intersection.point);
elbow.push(intersection.point);
}
else console.error('Tube geometry failed at vertex '+i+'. Consider reducing tube radius, or smoothening out the sharp angle at this vertex')
})
lastElbow = elbow
}
}
world.remove(plane);
return geom
},
defineCrossSection: function(obj){
var crossSection = new THREE.Geometry();
var count = obj.sides;
for ( var i = 0; i < count; i ++ ) {
var l = obj.radius;
var a = (i+0.5) / count * Math.PI;
crossSection.vertices.push(
new THREE.Vector3 (
-Math.sin( 2 * a ),
Math.cos( 2 * a ),
0
)
.multiplyScalar(l)
);
}
return crossSection
},
//build faces between vertices
buildFaces: function(geom, spine, obj){
for (var i in spine) {
i = parseFloat(i);
var vertex = spine[i];
if (i < spine.length - 1) {
for (var p = 0; p < obj.sides; p++) {
var b1 = i * obj.sides + p;
var b2 = i * obj.sides + (p+1) % obj.sides
var t1 = b1 + obj.sides
var t2 = b2 + obj.sides;
var triangle1 = new THREE.Face3(t1, b1, b2);
var triangle2 = new THREE.Face3(t1, b2, t2);
geom.faces.push(triangle1, triangle2)
}
}
}
//add endcaps
var v = geom.vertices.length;
for (var c = 0; c+2<obj.sides; c++) {
var tri1 = new THREE.Face3(0, c+2, c+1);
var tri2 = new THREE.Face3(v-1, v-1-(c+2), v-1-(c+1))
geom.faces.push(tri1, tri2)
}
//compute normals to get shading to work properly
geom.computeFaceNormals();
var bufferGeom = new THREE.BufferGeometry().fromGeometry(geom);
return geom
}
}
module.exports = exports = tube;
},{"../three.js":16,"../utils/material.js":18,"../utils/utils.js":19,"./objects.js":13}],16:[function(require,module,exports){
// threejs.org/license
(function(k,za){"object"===typeof exports&&"undefined"!==typeof module?za(exports):"function"===typeof define&&define.amd?define(["exports"],za):za(k.THREE={})})(this,function(k){function za(){}function B(a,b){this.x=a||0;this.y=b||0}function R(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function ca(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function p(a,
b,c){this.x=a||0;this.y=b||0;this.z=c||0}function la(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function ea(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,"id",{value:Ff++});this.uuid=J.generateUUID();this.name="";this.image=void 0!==a?a:ea.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:ea.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==
e?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.type=void 0!==h?h:1009;this.offset=new B(0,0);this.repeat=new B(1,1);this.center=new B(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new la;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==m?m:3E3;this.version=0;this.onUpdate=null}function W(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function kb(a,
b,c){this.width=a;this.height=b;this.scissor=new W(0,0,a,b);this.scissorTest=!1;this.viewport=new W(0,0,a,b);c=c||{};void 0===c.minFilter&&(c.minFilter=1006);this.texture=new ea(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy,c.encoding);this.texture.generateMipmaps=void 0!==c.generateMipmaps?c.generateMipmaps:!0;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?
c.depthTexture:null}function Lb(a,b,c){kb.call(this,a,b,c);this.activeMipMapLevel=this.activeCubeFace=0}function lb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n);this.image={data:a,width:b,height:c};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1}function Xa(a,b){this.min=void 0!==a?a:new p(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new p(-Infinity,-Infinity,-Infinity)}function Ha(a,b){this.center=void 0!==
a?a:new p;this.radius=void 0!==b?b:0}function Ia(a,b){this.normal=void 0!==a?a:new p(1,0,0);this.constant=void 0!==b?b:0}function td(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ia,void 0!==b?b:new Ia,void 0!==c?c:new Ia,void 0!==d?d:new Ia,void 0!==e?e:new Ia,void 0!==f?f:new Ia]}function G(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function Vd(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),
c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function Gf(a){function b(b,c){var d=b.array,e=b.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,h=a.createBuffer();a.bindBuffer(c,h);a.bufferData(c,d,e);b.onUploadCallback();c=a.FLOAT;d instanceof Float32Array?c=a.FLOAT:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=a.UNSIGNED_SHORT:d instanceof Int16Array?c=a.SHORT:d instanceof
Uint32Array?c=a.UNSIGNED_INT:d instanceof Int32Array?c=a.INT:d instanceof Int8Array?c=a.BYTE:d instanceof Uint8Array&&(c=a.UNSIGNED_BYTE);return{buffer:h,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var c=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return c.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var d=c.get(b);d&&(a.deleteBuffer(d.buffer),c.delete(b))},update:function(d,e){d.isInterleavedBufferAttribute&&(d=d.data);
var f=c.get(d);if(void 0===f)c.set(d,b(d,e));else if(f.version<d.version){var g=d,h=g.array,l=g.updateRange;a.bindBuffer(e,f.buffer);!1===g.dynamic?a.bufferData(e,h,a.STATIC_DRAW):-1===l.count?a.bufferSubData(e,0,h):0===l.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(e,l.offset*h.BYTES_PER_ELEMENT,h.subarray(l.offset,l.offset+l.count)),l.count=
-1);f.version=d.version}}}}function mb(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||mb.DefaultOrder}function Wd(){this.mask=1}function H(){Object.defineProperty(this,"id",{value:Hf++});this.uuid=J.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=H.DefaultUp.clone();var a=new p,b=new mb,c=new ca,d=new p(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,
{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new R},normalMatrix:{value:new la}});this.matrix=new R;this.matrixWorld=new R;this.matrixAutoUpdate=H.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Wd;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function Ra(){H.call(this);this.type="Camera";this.matrixWorldInverse=
new R;this.projectionMatrix=new R}function Mb(a,b,c,d,e,f){Ra.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Ya(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isVector3?d:new p;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new G;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function P(){Object.defineProperty(this,
"id",{value:If+=2});this.uuid=J.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function L(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
this.name="";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function yc(a,b,c){L.call(this,new Int8Array(a),b,c)}function zc(a,b,c){L.call(this,new Uint8Array(a),b,c)}function Ac(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}function Bc(a,b,c){L.call(this,new Int16Array(a),b,c)}function nb(a,b,c){L.call(this,new Uint16Array(a),b,c)}function Cc(a,b,c){L.call(this,new Int32Array(a),b,c)}function ob(a,
b,c){L.call(this,new Uint32Array(a),b,c)}function z(a,b,c){L.call(this,new Float32Array(a),b,c)}function Dc(a,b,c){L.call(this,new Float64Array(a),b,c)}function Ge(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function He(a){if(0===a.length)return-Infinity;
for(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:Jf+=2});this.uuid=J.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function Nb(a,b,c,d,e,f){P.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,
depthSegments:f};this.fromBufferGeometry(new pb(a,b,c,d,e,f));this.mergeVertices()}function pb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,Q,M,Ob){var r=f/Q,u=g/M,O=f/2,y=g/2,x=k/2;g=Q+1;var w=M+1,C=f=0,A,B,z=new p;for(B=0;B<w;B++){var H=B*u-y;for(A=0;A<g;A++)z[a]=(A*r-O)*d,z[b]=H*e,z[c]=x,m.push(z.x,z.y,z.z),z[a]=0,z[b]=0,z[c]=0<k?1:-1,v.push(z.x,z.y,z.z),n.push(A/Q),n.push(1-B/M),f+=1}for(B=0;B<M;B++)for(A=0;A<Q;A++)a=t+A+g*(B+1),b=t+(A+1)+g*(B+1),c=t+(A+1)+g*B,l.push(t+A+g*B,a,c),l.push(a,b,c),C+=
6;h.addGroup(q,C,Ob);q+=C;t+=f}D.call(this);this.type="BoxBufferGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;a=a||1;b=b||1;c=c||1;d=Math.floor(d)||1;e=Math.floor(e)||1;f=Math.floor(f)||1;var l=[],m=[],v=[],n=[],t=0,q=0;g("z","y","x",-1,-1,c,b,a,f,e,0);g("z","y","x",1,-1,c,b,-a,f,e,1);g("x","z","y",1,1,a,c,b,d,f,2);g("x","z","y",1,-1,a,c,-b,d,f,3);g("x","y","z",1,-1,a,b,c,d,e,4);g("x","y","z",-1,-1,a,b,-c,d,e,5);this.setIndex(l);this.addAttribute("position",
new z(m,3));this.addAttribute("normal",new z(v,3));this.addAttribute("uv",new z(n,2))}function Fc(a,b,c,d){P.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new rb(a,b,c,d));this.mergeVertices()}function rb(a,b,c,d){D.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};a=a||1;b=b||1;var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,m=
b/d,v=[],n=[],t=[],q=[];for(a=0;a<h;a++){var r=a*m-f;for(b=0;b<g;b++)n.push(b*l-e,-r,0),t.push(0,0,1),q.push(b/c),q.push(1-a/d)}for(a=0;a<d;a++)for(b=0;b<c;b++)e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,v.push(b+g*a,e,h),v.push(e,f,h);this.setIndex(v);this.addAttribute("position",new z(n,3));this.addAttribute("normal",new z(t,3));this.addAttribute("uv",new z(q,2))}function I(){Object.defineProperty(this,"id",{value:Kf++});this.uuid=J.generateUUID();this.name="";this.type="Material";this.lights=this.fog=
!0;this.blending=1;this.side=0;this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;
this.alphaTest=0;this.premultipliedAlpha=!1;this.overdraw=0;this.visible=!0;this.userData={};this.needsUpdate=!0}function ua(a){I.call(this);this.type="MeshBasicMaterial";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=
this.morphTargets=this.skinning=!1;this.setValues(a)}function Fa(a){I.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions=
{derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(a))}function sb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==b?b:new p}function Qb(a,b){this.start=void 0!==a?a:new p;this.end=void 0!==b?b:new p}
function ta(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;this.c=void 0!==c?c:new p}function va(a,b){H.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new ua({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Lf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new G(0),g=0,h,l,m;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},
setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,t,q){d=d.background;null===d?e(f,g):d&&d.isColor&&(e(d,1),q=!0);(a.autoClear||q)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);d&&d.isCubeTexture?(void 0===m&&(m=new va(new pb(1,1,1),new Fa({uniforms:tb.cube.uniforms,vertexShader:tb.cube.vertexShader,fragmentShader:tb.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1})),m.geometry.removeAttribute("normal"),m.geometry.removeAttribute("uv"),m.onBeforeRender=function(a,
b,c){this.matrixWorld.copyPosition(c.matrixWorld)},c.update(m)),m.material.uniforms.tCube.value=d,b.push(m,m.geometry,m.material,0,null)):d&&d.isTexture&&(void 0===h&&(h=new Mb(-1,1,1,-1,0,1),l=new va(new rb(2,2),new ua({depthTest:!1,depthWrite:!1,fog:!1})),c.update(l)),l.material.map=d,a.renderBufferDirect(h,null,l.geometry,l.material,l,null))}}}function Mf(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,f){a.drawArrays(d,b,f);c.update(f,d)};this.renderInstances=function(a,f,g){var e=
b.get("ANGLE_instanced_arrays");null===e?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(e.drawArraysInstancedANGLE(d,f,g,a.maxInstancedCount),c.update(g,d,a.maxInstancedCount))}}function Nf(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===
b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?"mediump":"lowp"}var e,f=void 0!==c.precision?c.precision:"highp",g=d(f);g!==f&&(console.warn("THREE.WebGLRenderer:",f,"not supported, using",g,"instead."),f=g);c=!0===c.logarithmicDepthBuffer;g=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);var h=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=a.getParameter(a.MAX_TEXTURE_SIZE),m=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),
v=a.getParameter(a.MAX_VERTEX_ATTRIBS),n=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),t=a.getParameter(a.MAX_VARYING_VECTORS),q=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),r=0<h,k=!!b.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==e)return e;var c=b.get("EXT_texture_filter_anisotropic");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:f,logarithmicDepthBuffer:c,maxTextures:g,maxVertexTextures:h,maxTextureSize:l,maxCubemapSize:m,
maxAttributes:v,maxVertexUniforms:n,maxVaryings:t,maxFragmentUniforms:q,vertexTextures:r,floatFragmentTextures:k,floatVertexTextures:r&&k}}function Of(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=m.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;l.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,l),h.normal.toArray(g,
d),g[d+3]=h.constant}m.value=g;m.needsUpdate=!0}c.numPlanes=f;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new Ia,l=new la,m={value:null,needsUpdate:!1};this.uniform=m;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,l,q,r,k){if(!f||null===c||0===c.length||g&&!l)g?b(null):a();else{l=g?0:e;var n=4*l,v=r.clippingState||
null;m.value=v;v=b(c,q,n,k);for(c=0;c!==n;++c)v[c]=d[c];r.clippingState=v;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=l}}}function Pf(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];switch(c){case "WEBGL_depth_texture":var d=a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||
a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");
return b[c]=d}}}function Qf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index&&b.remove(g.index);for(var l in g.attributes)b.remove(g.attributes[l]);a.removeEventListener("dispose",d);delete e[a.id];if(l=f[a.id])b.remove(l),delete f[a.id];if(l=f[g.id])b.remove(l),delete f[g.id];c.memory.geometries--}var e={},f={};return{get:function(a,b){var f=e[b.id];if(f)return f;b.addEventListener("dispose",d);b.isBufferGeometry?f=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new D).setFromObject(a)),
f=b._bufferGeometry);e[b.id]=f;c.memory.geometries++;return f},update:function(c){var d=c.index,e=c.attributes;null!==d&&b.update(d,a.ELEMENT_ARRAY_BUFFER);for(var f in e)b.update(e[f],a.ARRAY_BUFFER);c=c.morphAttributes;for(f in c){d=c[f];e=0;for(var g=d.length;e<g;e++)b.update(d[e],a.ARRAY_BUFFER)}},getWireframeAttribute:function(c){var d=f[c.id];if(d)return d;d=[];var e=c.index,g=c.attributes;if(null!==e){e=e.array;g=0;for(var v=e.length;g<v;g+=3){var n=e[g+0],t=e[g+1],q=e[g+2];d.push(n,t,t,q,
q,n)}}else for(e=g.position.array,g=0,v=e.length/3-1;g<v;g+=3)n=g+0,t=g+1,q=g+2,d.push(n,t,t,q,q,n);d=new (65535<He(d)?ob:nb)(d,1);b.update(d,a.ELEMENT_ARRAY_BUFFER);return f[c.id]=d}}}function Rf(a,b,c){var d,e,f;this.setMode=function(a){d=a};this.setIndex=function(a){e=a.type;f=a.bytesPerElement};this.render=function(b,h){a.drawElements(d,h,e,b*f);c.update(h,d)};this.renderInstances=function(a,h,l){var g=b.get("ANGLE_instanced_arrays");null===g?console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):
(g.drawElementsInstancedANGLE(d,l,e,h*f,a.maxInstancedCount),c.update(l,d,a.maxInstancedCount))}}function Sf(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;b.triangles=0;b.points=0;b.lines=0},update:function(c,d,e){e=e||1;b.calls++;switch(d){case a.TRIANGLES:b.triangles+=c/3*e;break;case a.TRIANGLE_STRIP:case a.TRIANGLE_FAN:b.triangles+=e*(c-2);break;case a.LINES:b.lines+=c/2*
e;break;case a.LINE_STRIP:b.lines+=e*(c-1);break;case a.LINE_LOOP:b.lines+=e*c;break;case a.POINTS:b.points+=e*c;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",d)}}}}function Tf(a,b){return Math.abs(b[1])-Math.abs(a[1])}function Uf(a){var b={},c=new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=h.length;d=b[e.id];if(void 0===d){d=[];for(var m=0;m<l;m++)d[m]=[m,0];b[e.id]=d}var v=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;
for(m=0;m<l;m++){var n=d[m];0!==n[1]&&(v&&e.removeAttribute("morphTarget"+m),f&&e.removeAttribute("morphNormal"+m))}for(m=0;m<l;m++)n=d[m],n[0]=m,n[1]=h[m];d.sort(Tf);for(m=0;8>m;m++){if(n=d[m])if(h=n[0],l=n[1]){v&&e.addAttribute("morphTarget"+m,v[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function Vf(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),
a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];ea.call(this,a,void 0!==b?b:301,c,d,e,f,g,h,l,m);this.flipY=!1}function Rb(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ie[e];void 0===f&&(f=new Float32Array(e),Ie[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function da(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function qa(a,b){for(var c=
0,d=b.length;c<d;c++)a[c]=b[c]}function Je(a,b){var c=Ke[b];void 0===c&&(c=new Int32Array(b),Ke[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocTextureUnit();return c}function Wf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function Xf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function Yf(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else da(c,b)||(a.uniform2fv(this.addr,b),qa(c,b))}function Zf(a,
b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else da(c,b)||(a.uniform3fv(this.addr,b),qa(c,b))}function $f(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else da(c,b)||(a.uniform4fv(this.addr,
b),qa(c,b))}function ag(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Le.set(d),a.uniformMatrix2fv(this.addr,!1,Le),qa(c,d))}function bg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Me.set(d),a.uniformMatrix3fv(this.addr,!1,Me),qa(c,d))}function cg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Ne.set(d),a.uniformMatrix4fv(this.addr,
!1,Ne),qa(c,d))}function dg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2D(b||Oe,e)}function eg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTextureCube(b||Pe,e)}function Qe(a,b){var c=this.cache;da(c,b)||(a.uniform2iv(this.addr,b),qa(c,b))}function Re(a,b){var c=this.cache;da(c,b)||(a.uniform3iv(this.addr,b),qa(c,b))}function Se(a,b){var c=this.cache;da(c,b)||(a.uniform4iv(this.addr,b),qa(c,
b))}function fg(a){switch(a){case 5126:return Wf;case 35664:return Yf;case 35665:return Zf;case 35666:return $f;case 35674:return ag;case 35675:return bg;case 35676:return cg;case 35678:case 36198:return dg;case 35680:return eg;case 5124:case 35670:return Xf;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function gg(a,b){var c=this.cache;da(c,b)||(a.uniform1fv(this.addr,b),qa(c,b))}function hg(a,b){var c=this.cache;da(c,b)||(a.uniform1iv(this.addr,
b),qa(c,b))}function ig(a,b){var c=this.cache;b=Rb(b,this.size,2);da(c,b)||(a.uniform2fv(this.addr,b),this.updateCache(b))}function jg(a,b){var c=this.cache;b=Rb(b,this.size,3);da(c,b)||(a.uniform3fv(this.addr,b),this.updateCache(b))}function kg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniform4fv(this.addr,b),this.updateCache(b))}function lg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),this.updateCache(b))}function mg(a,b){var c=this.cache;b=
Rb(b,this.size,9);da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),this.updateCache(b))}function ng(a,b){var c=this.cache;b=Rb(b,this.size,16);da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),this.updateCache(b))}function og(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTexture2D(b[a]||Oe,f[a])}function pg(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTextureCube(b[a]||
Pe,f[a])}function qg(a){switch(a){case 5126:return gg;case 35664:return ig;case 35665:return jg;case 35666:return kg;case 35674:return lg;case 35675:return mg;case 35676:return ng;case 35678:return og;case 35680:return pg;case 5124:case 35670:return hg;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function rg(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=fg(b.type)}function Te(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;
this.setValue=qg(b.type)}function Ue(a){this.id=a;this.seq=[];this.map={}}function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS);for(var d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(Xd.lastIndex=0;;){var m=Xd.exec(h),v=Xd.lastIndex,n=m[1],t=m[3];"]"===m[2]&&(n|=0);if(void 0===t||"["===t&&v+2===l){h=g;e=void 0===t?new rg(n,e,f):new Te(n,e,f);h.seq.push(e);h.map[e.id]=e;break}else t=g.map[n],
void 0===t&&(t=new Ue(n),n=g,g=t,n.seq.push(g),n.map[g.id]=g),g=t}}}function sg(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function Ve(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);!1===a.getShaderParameter(d,a.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==a.getShaderInfoLog(d)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b===a.VERTEX_SHADER?"vertex":"fragment",a.getShaderInfoLog(d),
sg(c));return d}function We(a){switch(a){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+a);}}function Yd(a,b){b=We(b);return"vec4 "+a+"( vec4 value ) { return "+b[0]+"ToLinear"+b[1]+"; }"}function tg(a,
b){b=We(b);return"vec4 "+a+"( vec4 value ) { return LinearTo"+b[0]+b[1]+"; }"}function ug(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";break;case 3:b="Uncharted2";break;case 4:b="OptimizedCineon";break;default:throw Error("unsupported toneMapping: "+b);}return"vec3 "+a+"( vec3 color ) { return "+b+"ToneMapping( color ); }"}function vg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpMap||b.normalMap&&!b.objectSpaceNormalMap||b.flatShading?"#extension GL_OES_standard_derivatives : enable":
"",(a.fragDepth||b.logarithmicDepthBuffer)&&c.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",a.drawBuffers&&c.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(a.shaderTextureLOD||b.envMap)&&c.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Gc).join("\n")}function wg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}function Gc(a){return""!==a}function Xe(a,b){return a.replace(/NUM_DIR_LIGHTS/g,
b.numDirLights).replace(/NUM_SPOT_LIGHTS/g,b.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights)}function Ye(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}function Zd(a){return a.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(a,c){a=S[c];if(void 0===a)throw Error("Can not resolve #include <"+c+
">");return Zd(a)})}function Ze(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(a,c,d,e){a="";for(c=parseInt(c);c<parseInt(d);c++)a+=e.replace(/\[ i \]/g,"[ "+c+" ]");return a})}function xg(a,b,c,d,e,f){var g=a.context,h=d.defines,l=e.vertexShader,m=e.fragmentShader,v="SHADOWMAP_TYPE_BASIC";1===f.shadowMapType?v="SHADOWMAP_TYPE_PCF":2===f.shadowMapType&&(v="SHADOWMAP_TYPE_PCF_SOFT");var n="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",
q="ENVMAP_BLENDING_MULTIPLY";if(f.envMap){switch(d.envMap.mapping){case 301:case 302:n="ENVMAP_TYPE_CUBE";break;case 306:case 307:n="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:n="ENVMAP_TYPE_EQUIREC";break;case 305:n="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}switch(d.combine){case 0:q="ENVMAP_BLENDING_MULTIPLY";break;case 1:q="ENVMAP_BLENDING_MIX";break;case 2:q="ENVMAP_BLENDING_ADD"}}var r=0<a.gammaFactor?a.gammaFactor:1,k=vg(d.extensions,f,b),p=
wg(h),w=g.createProgram();d.isRawShaderMaterial?(h=[p].filter(Gc).join("\n"),0<h.length&&(h+="\n"),b=[k,p].filter(Gc).join("\n"),0<b.length&&(b+="\n")):(h=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+e.name,p,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+r,"#define MAX_BONES "+f.maxBones,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":
"",f.envMap?"#define "+t:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.normalMap&&f.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",f.displacementMap&&f.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?
"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals&&!1===f.flatShading?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+v:"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",
f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&b.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;",
"\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;",
"#endif","\n"].filter(Gc).join("\n"),b=[k,"precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+e.name,p,f.alphaTest?"#define ALPHATEST "+f.alphaTest+(f.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+r,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+n:"",f.envMap?"#define "+t:"",f.envMap?"#define "+q:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":
"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.normalMap&&f.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.gradientMap?"#define USE_GRADIENTMAP":"",f.flatShading?"#define FLAT_SHADED":"",f.doubleSided?"#define DOUBLE_SIDED":
"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+v:"",f.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",f.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&b.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",f.envMap&&b.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",
0!==f.toneMapping?"#define TONE_MAPPING":"",0!==f.toneMapping?S.tonemapping_pars_fragment:"",0!==f.toneMapping?ug("toneMapping",f.toneMapping):"",f.dithering?"#define DITHERING":"",f.outputEncoding||f.mapEncoding||f.envMapEncoding||f.emissiveMapEncoding?S.encodings_pars_fragment:"",f.mapEncoding?Yd("mapTexelToLinear",f.mapEncoding):"",f.envMapEncoding?Yd("envMapTexelToLinear",f.envMapEncoding):"",f.emissiveMapEncoding?Yd("emissiveMapTexelToLinear",f.emissiveMapEncoding):"",f.outputEncoding?tg("linearToOutputTexel",
f.outputEncoding):"",f.depthPacking?"#define DEPTH_PACKING "+d.depthPacking:"","\n"].filter(Gc).join("\n"));l=Zd(l);l=Xe(l,f);l=Ye(l,f);m=Zd(m);m=Xe(m,f);m=Ye(m,f);l=Ze(l);m=Ze(m);m=b+m;l=Ve(g,g.VERTEX_SHADER,h+l);m=Ve(g,g.FRAGMENT_SHADER,m);g.attachShader(w,l);g.attachShader(w,m);void 0!==d.index0AttributeName?g.bindAttribLocation(w,0,d.index0AttributeName):!0===f.morphTargets&&g.bindAttribLocation(w,0,"position");g.linkProgram(w);f=g.getProgramInfoLog(w).trim();v=g.getShaderInfoLog(l).trim();n=
g.getShaderInfoLog(m).trim();q=t=!0;if(!1===g.getProgramParameter(w,g.LINK_STATUS))t=!1,console.error("THREE.WebGLProgram: shader error: ",g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(w,g.VALIDATE_STATUS),"gl.getProgramInfoLog",f,v,n);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===v||""===n)q=!1;q&&(this.diagnostics={runnable:t,material:d,programLog:f,vertexShader:{log:v,prefix:h},fragmentShader:{log:n,prefix:b}});g.deleteShader(l);g.deleteShader(m);
var x;this.getUniforms=function(){void 0===x&&(x=new eb(g,w,a));return x};var A;this.getAttributes=function(){if(void 0===A){for(var a={},b=g.getProgramParameter(w,g.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=g.getActiveAttrib(w,c).name;a[d]=g.getAttribLocation(w,d)}A=a}return A};this.destroy=function(){g.deleteProgram(w);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");
return this.getAttributes()}}});this.name=e.name;this.id=yg++;this.code=c;this.usedTimes=1;this.program=w;this.vertexShader=l;this.fragmentShader=m;return this}function zg(a,b,c){function d(a,b){if(a)a.isTexture?c=a.encoding:a.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),c=a.texture.encoding);else var c=3E3;3E3===c&&b&&(c=3007);return c}var e=[],f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",
MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},g="precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering".split(" ");
this.getParameters=function(b,e,g,v,n,t,q){var h=f[b.type];if(q.isSkinnedMesh){var l=q.skeleton.bones;if(c.floatVertexTextures)l=1024;else{var m=Math.min(Math.floor((c.maxVertexUniforms-20)/4),l.length);m<l.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+l.length+" bones. This GPU supports "+m+"."),l=0):l=m}}else l=0;m=c.precision;null!==b.precision&&(m=c.getMaxPrecision(b.precision),m!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",m,"instead."));
var k=a.getRenderTarget();return{shaderID:h,precision:m,supportsVertexTextures:c.vertexTextures,outputEncoding:d(k?k.texture:null,a.gammaOutput),map:!!b.map,mapEncoding:d(b.map,a.gammaInput),envMap:!!b.envMap,envMapMode:b.envMap&&b.envMap.mapping,envMapEncoding:d(b.envMap,a.gammaInput),envMapCubeUV:!!b.envMap&&(306===b.envMap.mapping||307===b.envMap.mapping),lightMap:!!b.lightMap,aoMap:!!b.aoMap,emissiveMap:!!b.emissiveMap,emissiveMapEncoding:d(b.emissiveMap,a.gammaInput),bumpMap:!!b.bumpMap,normalMap:!!b.normalMap,
objectSpaceNormalMap:1===b.normalMapType,displacementMap:!!b.displacementMap,roughnessMap:!!b.roughnessMap,metalnessMap:!!b.metalnessMap,specularMap:!!b.specularMap,alphaMap:!!b.alphaMap,gradientMap:!!b.gradientMap,combine:b.combine,vertexColors:b.vertexColors,fog:!!v,useFog:b.fog,fogExp:v&&v.isFogExp2,flatShading:b.flatShading,sizeAttenuation:b.sizeAttenuation,logarithmicDepthBuffer:c.logarithmicDepthBuffer,skinning:b.skinning&&0<l,maxBones:l,useVertexTexture:c.floatVertexTextures,morphTargets:b.morphTargets,
morphNormals:b.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:n,numClipIntersection:t,dithering:b.dithering,shadowMapEnabled:a.shadowMap.enabled&&q.receiveShadow&&0<g.length,shadowMapType:a.shadowMap.type,toneMapping:a.toneMapping,physicallyCorrectLights:a.physicallyCorrectLights,premultipliedAlpha:b.premultipliedAlpha,
alphaTest:b.alphaTest,doubleSided:2===b.side,flipSided:1===b.side,depthPacking:void 0!==b.depthPacking?b.depthPacking:!1}};this.getProgramCode=function(b,c){var d=[];c.shaderID?d.push(c.shaderID):(d.push(b.fragmentShader),d.push(b.vertexShader));if(void 0!==b.defines)for(var e in b.defines)d.push(e),d.push(b.defines[e]);for(e=0;e<g.length;e++)d.push(c[g[e]]);d.push(b.onBeforeCompile.toString());d.push(a.gammaOutput);return d.join()};this.acquireProgram=function(c,d,f,g){for(var h,l=0,m=e.length;l<
m;l++){var v=e[l];if(v.code===g){h=v;++h.usedTimes;break}}void 0===h&&(h=new xg(a,b,g,c,d,f),e.push(h));return h};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=e.indexOf(a);e[b]=e[e.length-1];e.pop();a.destroy()}};this.programs=e}function Ag(){var a=new WeakMap;return{get:function(b){var c=a.get(b);void 0===c&&(c={},a.set(b,c));return c},remove:function(b){a.delete(b)},update:function(b,c,d){a.get(b)[c]=d},dispose:function(){a=new WeakMap}}}function Bg(a,b){return a.renderOrder!==b.renderOrder?
a.renderOrder-b.renderOrder:a.program&&b.program&&a.program!==b.program?a.program.id-b.program.id:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function Cg(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function Dg(){var a=[],b=0,c=[],d=[];return{opaque:c,transparent:d,init:function(){b=0;c.length=0;d.length=0},push:function(e,f,g,h,l){var m=a[b];void 0===m?(m={id:e.id,object:e,geometry:f,material:g,program:g.program,
renderOrder:e.renderOrder,z:h,group:l},a[b]=m):(m.id=e.id,m.object=e,m.geometry=f,m.material=g,m.program=g.program,m.renderOrder=e.renderOrder,m.z=h,m.group=l);(!0===g.transparent?d:c).push(m);b++},sort:function(){1<c.length&&c.sort(Bg);1<d.length&&d.sort(Cg)}}}function Eg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];void 0===c&&(c=new Dg,a[b]=c);return c},dispose:function(){a={}}}}function Fg(){var a={};return{get:function(b){if(void 0!==a[b.id])return a[b.id];switch(b.type){case "DirectionalLight":var c=
{direction:new p,color:new G,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case "SpotLight":c={position:new p,direction:new p,color:new G,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case "PointLight":c={position:new p,color:new G,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B,shadowCameraNear:1,shadowCameraFar:1E3};break;case "HemisphereLight":c={direction:new p,skyColor:new G,groundColor:new G};
break;case "RectAreaLight":c={color:new G,position:new p,halfWidth:new p,halfHeight:new p}}return a[b.id]=c}}}function Gg(){var a=new Fg,b={id:Hg++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},c=new p,d=new R,e=new R;return{setup:function(f,g,h){var l=0,m=0,v=0,n=0,t=0,q=0,r=0,k=0;h=h.matrixWorldInverse;for(var p=0,w=f.length;p<w;p++){var x=
f[p],A=x.color,C=x.intensity,O=x.distance,Q=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)l+=A.r*C,m+=A.g*C,v+=A.b*C;else if(x.isDirectionalLight){var M=a.get(x);M.color.copy(x.color).multiplyScalar(x.intensity);M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.directionalShadowMap[n]=
Q;b.directionalShadowMatrix[n]=x.shadow.matrix;b.directional[n]=M;n++}else if(x.isSpotLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(A).multiplyScalar(C);M.distance=O;M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);M.coneCos=Math.cos(x.angle);M.penumbraCos=Math.cos(x.angle*(1-x.penumbra));M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=
x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.spotShadowMap[q]=Q;b.spotShadowMatrix[q]=x.shadow.matrix;b.spot[q]=M;q++}else if(x.isRectAreaLight)M=a.get(x),M.color.copy(A).multiplyScalar(C),M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(h),e.identity(),d.copy(x.matrixWorld),d.premultiply(h),e.extractRotation(d),M.halfWidth.set(.5*x.width,0,0),M.halfHeight.set(0,.5*x.height,0),M.halfWidth.applyMatrix4(e),M.halfHeight.applyMatrix4(e),b.rectArea[r]=
M,r++;else if(x.isPointLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(x.color).multiplyScalar(x.intensity);M.distance=x.distance;M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize,M.shadowCameraNear=A.camera.near,M.shadowCameraFar=A.camera.far;b.pointShadowMap[t]=Q;b.pointShadowMatrix[t]=x.shadow.matrix;b.point[t]=M;t++}else x.isHemisphereLight&&(M=a.get(x),
M.direction.setFromMatrixPosition(x.matrixWorld),M.direction.transformDirection(h),M.direction.normalize(),M.skyColor.copy(x.color).multiplyScalar(C),M.groundColor.copy(x.groundColor).multiplyScalar(C),b.hemi[k]=M,k++)}b.ambient[0]=l;b.ambient[1]=m;b.ambient[2]=v;b.directional.length=n;b.spot.length=q;b.rectArea.length=r;b.point.length=t;b.hemi.length=k;b.hash=b.id+","+n+","+t+","+q+","+r+","+k+","+g.length},state:b}}function Ig(){var a=new Gg,b=[],c=[],d=[];return{init:function(){b.length=0;c.length=
0;d.length=0},state:{lightsArray:b,shadowsArray:c,spritesArray:d,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)},pushSprite:function(a){d.push(a)}}}function Jg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];void 0===c&&(c=new Ig,a[b]=c);return c},dispose:function(){a={}}}}function fb(a){I.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=
this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function gb(a){I.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new p;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function $e(a,b,c){function d(b,c,d,e,f,g){var h=
b.geometry;var l=n;var m=b.customDepthMaterial;d&&(l=t,m=b.customDistanceMaterial);m?l=m:(m=!1,c.morphTargets&&(h&&h.isBufferGeometry?m=h.morphAttributes&&h.morphAttributes.position&&0<h.morphAttributes.position.length:h&&h.isGeometry&&(m=h.morphTargets&&0<h.morphTargets.length)),b.isSkinnedMesh&&!1===c.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",b),b=b.isSkinnedMesh&&c.skinning,h=0,m&&(h|=1),b&&(h|=2),l=l[h]);a.localClippingEnabled&&!0===
c.clipShadows&&0!==c.clippingPlanes.length&&(h=l.uuid,m=c.uuid,b=q[h],void 0===b&&(b={},q[h]=b),h=b[m],void 0===h&&(h=l.clone(),b[m]=h),l=h);l.visible=c.visible;l.wireframe=c.wireframe;l.side=null!=c.shadowSide?c.shadowSide:r[c.side];l.clipShadows=c.clipShadows;l.clippingPlanes=c.clippingPlanes;l.clipIntersection=c.clipIntersection;l.wireframeLinewidth=c.wireframeLinewidth;l.linewidth=c.linewidth;d&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(e),l.nearDistance=f,l.farDistance=g);return l}
function e(c,g,h,l){if(!1!==c.visible){if(c.layers.test(g.layers)&&(c.isMesh||c.isLine||c.isPoints)&&c.castShadow&&(!c.frustumCulled||f.intersectsObject(c))){c.modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,c.matrixWorld);var m=b.update(c),n=c.material;if(Array.isArray(n))for(var t=m.groups,q=0,r=t.length;q<r;q++){var k=t[q],O=n[k.materialIndex];O&&O.visible&&(O=d(c,O,l,v,h.near,h.far),a.renderBufferDirect(h,null,m,O,c,k))}else n.visible&&(O=d(c,n,l,v,h.near,h.far),a.renderBufferDirect(h,null,
m,O,c,null))}c=c.children;m=0;for(n=c.length;m<n;m++)e(c[m],g,h,l)}}var f=new td,g=new R,h=new B,l=new B(c,c),m=new p,v=new p,n=Array(4),t=Array(4),q={},r={0:1,1:0,2:2},k=[new p(1,0,0),new p(-1,0,0),new p(0,0,1),new p(0,0,-1),new p(0,1,0),new p(0,-1,0)],y=[new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,0,1),new p(0,0,-1)],w=[new W,new W,new W,new W,new W,new W];for(c=0;4!==c;++c){var x=0!==(c&1),A=0!==(c&2),C=new fb({depthPacking:3201,morphTargets:x,skinning:A});n[c]=C;x=new gb({morphTargets:x,
skinning:A});t[c]=x}var O=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(b,c,d){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==b.length){var n=a.state;n.disable(a.context.BLEND);n.buffers.color.setClear(1,1,1,1);n.buffers.depth.setTest(!0);n.setScissorTest(!1);for(var t,q=0,r=b.length;q<r;q++){var u=b[q];t=u.shadow;var p=u&&u.isPointLight;if(void 0===t)console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");else{var Q=t.camera;h.copy(t.mapSize);
h.min(l);if(p){var x=h.x,C=h.y;w[0].set(2*x,C,x,C);w[1].set(0,C,x,C);w[2].set(3*x,C,x,C);w[3].set(x,C,x,C);w[4].set(3*x,0,x,C);w[5].set(x,0,x,C);h.x*=4;h.y*=2}null===t.map&&(t.map=new kb(h.x,h.y,{minFilter:1003,magFilter:1003,format:1023}),t.map.texture.name=u.name+".shadowMap",Q.updateProjectionMatrix());t.isSpotLightShadow&&t.update(u);x=t.map;C=t.matrix;v.setFromMatrixPosition(u.matrixWorld);Q.position.copy(v);p?(t=6,C.makeTranslation(-v.x,-v.y,-v.z)):(t=1,m.setFromMatrixPosition(u.target.matrixWorld),
Q.lookAt(m),Q.updateMatrixWorld(),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(Q.projectionMatrix),C.multiply(Q.matrixWorldInverse));a.setRenderTarget(x);a.clear();for(u=0;u<t;u++)p&&(m.copy(Q.position),m.add(k[u]),Q.up.copy(y[u]),Q.lookAt(m),Q.updateMatrixWorld(),n.viewport(w[u])),g.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),f.setFromMatrix(g),e(c,d,Q,p)}}O.needsUpdate=!1}}}function Sb(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Kg(a,
b,c,d,e){var f,g,h,l,m,v,n,t,q,r,k,y,w,x,A,C,O,Q;function M(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:b.id-a.id}var B,qb,U,z,Ec=new p,H=new ca,D=new p;this.render=function(u,p,Ob){if(0!==u.length){if(void 0===U){var sa=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),Ca=new Uint16Array([0,1,2,0,2,3]);B=b.createBuffer();qb=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,B);b.bufferData(b.ARRAY_BUFFER,sa,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
qb);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Ca,b.STATIC_DRAW);sa=b.createProgram();Ca=b.createShader(b.VERTEX_SHADER);var G=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(Ca,["precision "+e.precision+" float;","#define SHADER_NAME SpriteMaterial\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 center;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float fogDepth;\nvoid main() {\n\tvUV = uvOffset + uv * uvScale;\n\tvec2 alignedPosition = ( position - center ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tvec4 mvPosition;\n\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\tfogDepth = - mvPosition.z;\n}"].join("\n"));
b.shaderSource(G,["precision "+e.precision+" float;","#define SHADER_NAME SpriteMaterial\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvarying float fogDepth;\nvoid main() {\n\tvec4 texture = texture2D( map, vUV );\n\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\n\tif ( gl_FragColor.a < alphaTest ) discard;\n\tif ( fogType > 0 ) {\n\t\tfloat fogFactor = 0.0;\n\t\tif ( fogType == 1 ) {\n\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t\t} else {\n\t\t\tconst float LOG2 = 1.442695;\n\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );\n\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t\t}\n\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\t}\n}"].join("\n"));
b.compileShader(Ca);b.compileShader(G);b.attachShader(sa,Ca);b.attachShader(sa,G);b.linkProgram(sa);U=sa;O=b.getAttribLocation(U,"position");Q=b.getAttribLocation(U,"uv");f=b.getUniformLocation(U,"uvOffset");g=b.getUniformLocation(U,"uvScale");h=b.getUniformLocation(U,"rotation");l=b.getUniformLocation(U,"center");m=b.getUniformLocation(U,"scale");v=b.getUniformLocation(U,"color");n=b.getUniformLocation(U,"map");t=b.getUniformLocation(U,"opacity");q=b.getUniformLocation(U,"modelViewMatrix");r=b.getUniformLocation(U,
"projectionMatrix");k=b.getUniformLocation(U,"fogType");y=b.getUniformLocation(U,"fogDensity");w=b.getUniformLocation(U,"fogNear");x=b.getUniformLocation(U,"fogFar");A=b.getUniformLocation(U,"fogColor");b.getUniformLocation(U,"fogDepth");C=b.getUniformLocation(U,"alphaTest");sa=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");sa.width=8;sa.height=8;Ca=sa.getContext("2d");Ca.fillStyle="white";Ca.fillRect(0,0,8,8);z=new Sb(sa)}c.useProgram(U);c.initAttributes();c.enableAttribute(O);
c.enableAttribute(Q);c.disableUnusedAttributes();c.disable(b.CULL_FACE);c.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,B);b.vertexAttribPointer(O,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(Q,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,qb);b.uniformMatrix4fv(r,!1,Ob.projectionMatrix.elements);c.activeTexture(b.TEXTURE0);b.uniform1i(n,0);Ca=sa=0;(G=p.fog)?(b.uniform3f(A,G.color.r,G.color.g,G.color.b),G.isFog?(b.uniform1f(w,G.near),b.uniform1f(x,G.far),b.uniform1i(k,1),Ca=sa=1):G.isFogExp2&&
(b.uniform1f(y,G.density),b.uniform1i(k,2),Ca=sa=2)):(b.uniform1i(k,0),Ca=sa=0);G=0;for(var K=u.length;G<K;G++){var E=u[G];E.modelViewMatrix.multiplyMatrices(Ob.matrixWorldInverse,E.matrixWorld);E.z=-E.modelViewMatrix.elements[14]}u.sort(M);var P=[],R=[];G=0;for(K=u.length;G<K;G++){E=u[G];var V=E.material;if(!1!==V.visible){E.onBeforeRender(a,p,Ob,void 0,V,void 0);b.uniform1f(C,V.alphaTest);b.uniformMatrix4fv(q,!1,E.modelViewMatrix.elements);E.matrixWorld.decompose(Ec,H,D);P[0]=D.x;P[1]=D.y;R[0]=
E.center.x-.5;R[1]=E.center.y-.5;var N=0;p.fog&&V.fog&&(N=Ca);sa!==N&&(b.uniform1i(k,N),sa=N);null!==V.map?(b.uniform2f(f,V.map.offset.x,V.map.offset.y),b.uniform2f(g,V.map.repeat.x,V.map.repeat.y)):(b.uniform2f(f,0,0),b.uniform2f(g,1,1));b.uniform1f(t,V.opacity);b.uniform3f(v,V.color.r,V.color.g,V.color.b);b.uniform1f(h,V.rotation);b.uniform2fv(l,R);b.uniform2fv(m,P);c.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.premultipliedAlpha);
c.buffers.depth.setTest(V.depthTest);c.buffers.depth.setMask(V.depthWrite);c.buffers.color.setMask(V.colorWrite);d.setTexture2D(V.map||z,0);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);E.onAfterRender(a,p,Ob,void 0,V,void 0)}}c.enable(b.CULL_FACE);c.reset()}}}function Lg(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b<d;b++)a.texImage2D(c+b,0,a.RGBA,
1,1,0,a.RGBA,a.UNSIGNED_BYTE,e);return f}function e(c,d){p[c]=1;0===w[c]&&(a.enableVertexAttribArray(c),w[c]=1);x[c]!==d&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,d),x[c]=d)}function f(b){!0!==A[b]&&(a.enable(b),A[b]=!0)}function g(b){!1!==A[b]&&(a.disable(b),A[b]=!1)}function h(b,d,e,h,l,m,n,v){0!==b?f(a.BLEND):g(a.BLEND);if(5!==b){if(b!==Q||v!==sa)switch(b){case 2:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE,a.ONE,a.ONE)):(a.blendEquation(a.FUNC_ADD),
a.blendFunc(a.SRC_ALPHA,a.ONE));break;case 3:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR));break;case 4:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.SRC_COLOR,a.ZERO,a.SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR));break;default:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,
a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA))}Ec=z=U=qb=B=M=null}else{l=l||d;m=m||e;n=n||h;if(d!==M||l!==U)a.blendEquationSeparate(c.convert(d),c.convert(l)),M=d,U=l;if(e!==B||h!==qb||m!==z||n!==Ec)a.blendFuncSeparate(c.convert(e),c.convert(h),c.convert(m),c.convert(n)),B=e,qb=h,z=m,Ec=n}Q=b;sa=v}function l(b){G!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),G=b)}
function m(b){0!==b?(f(a.CULL_FACE),b!==H&&(1===b?a.cullFace(a.BACK):2===b?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):g(a.CULL_FACE);H=b}function v(b,c,d){if(b){if(f(a.POLYGON_OFFSET_FILL),E!==c||K!==d)a.polygonOffset(c,d),E=c,K=d}else g(a.POLYGON_OFFSET_FILL)}function n(b){void 0===b&&(b=a.TEXTURE0+P-1);I!==b&&(a.activeTexture(b),I=b)}var t=new function(){var b=!1,c=new W,d=null,e=new W(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,
d,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},q=new function(){var b=!1,c=null,d=null,e=null;return{setTest:function(b){b?f(a.DEPTH_TEST):g(a.DEPTH_TEST)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(a.NEVER);break;case 1:a.depthFunc(a.ALWAYS);break;case 2:a.depthFunc(a.LESS);break;case 3:a.depthFunc(a.LEQUAL);break;case 4:a.depthFunc(a.EQUAL);
break;case 5:a.depthFunc(a.GEQUAL);break;case 6:a.depthFunc(a.GREATER);break;case 7:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);d=b}},setLocked:function(a){b=a},setClear:function(b){e!==b&&(a.clearDepth(b),e=b)},reset:function(){b=!1;e=d=c=null}}},k=new function(){var b=!1,c=null,d=null,e=null,h=null,l=null,m=null,n=null,v=null;return{setTest:function(b){b?f(a.STENCIL_TEST):g(a.STENCIL_TEST)},setMask:function(d){c===d||b||(a.stencilMask(d),c=d)},setFunc:function(b,
c,f){if(d!==b||e!==c||h!==f)a.stencilFunc(b,c,f),d=b,e=c,h=f},setOp:function(b,c,d){if(l!==b||m!==c||n!==d)a.stencilOp(b,c,d),l=b,m=c,n=d},setLocked:function(a){b=a},setClear:function(b){v!==b&&(a.clearStencil(b),v=b)},reset:function(){b=!1;v=n=m=l=h=e=d=c=null}}},u=a.getParameter(a.MAX_VERTEX_ATTRIBS),p=new Uint8Array(u),w=new Uint8Array(u),x=new Uint8Array(u),A={},C=null,O=null,Q=null,M=null,B=null,qb=null,U=null,z=null,Ec=null,sa=!1,G=null,H=null,D=null,E=null,K=null,P=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),
R=!1;u=0;u=a.getParameter(a.VERSION);-1!==u.indexOf("WebGL")?(u=parseFloat(/^WebGL ([0-9])/.exec(u)[1]),R=1<=u):-1!==u.indexOf("OpenGL ES")&&(u=parseFloat(/^OpenGL ES ([0-9])/.exec(u)[1]),R=2<=u);var I=null,L={},J=new W,fa=new W,V={};V[a.TEXTURE_2D]=d(a.TEXTURE_2D,a.TEXTURE_2D,1);V[a.TEXTURE_CUBE_MAP]=d(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6);t.setClear(0,0,0,1);q.setClear(1);k.setClear(0);f(a.DEPTH_TEST);q.setFunc(3);l(!1);m(1);f(a.CULL_FACE);f(a.BLEND);h(1);return{buffers:{color:t,depth:q,
stencil:k},initAttributes:function(){for(var a=0,b=p.length;a<b;a++)p[a]=0},enableAttribute:function(a){e(a,0)},enableAttributeAndDivisor:e,disableUnusedAttributes:function(){for(var b=0,c=w.length;b!==c;++b)w[b]!==p[b]&&(a.disableVertexAttribArray(b),w[b]=0)},enable:f,disable:g,getCompressedTextureFormats:function(){if(null===C&&(C=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")||b.get("WEBGL_compressed_texture_etc1")||b.get("WEBGL_compressed_texture_astc")))for(var c=
a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)C.push(c[d]);return C},useProgram:function(b){return O!==b?(a.useProgram(b),O=b,!0):!1},setBlending:h,setMaterial:function(b,c){2===b.side?g(a.CULL_FACE):f(a.CULL_FACE);var d=1===b.side;c&&(d=!d);l(d);1===b.blending&&!1===b.transparent?h(0):h(b.blending,b.blendEquation,b.blendSrc,b.blendDst,b.blendEquationAlpha,b.blendSrcAlpha,b.blendDstAlpha,b.premultipliedAlpha);q.setFunc(b.depthFunc);q.setTest(b.depthTest);q.setMask(b.depthWrite);
t.setMask(b.colorWrite);v(b.polygonOffset,b.polygonOffsetFactor,b.polygonOffsetUnits)},setFlipSided:l,setCullFace:m,setLineWidth:function(b){b!==D&&(R&&a.lineWidth(b),D=b)},setPolygonOffset:v,setScissorTest:function(b){b?f(a.SCISSOR_TEST):g(a.SCISSOR_TEST)},activeTexture:n,bindTexture:function(b,c){null===I&&n();var d=L[I];void 0===d&&(d={type:void 0,texture:void 0},L[I]=d);if(d.type!==b||d.texture!==c)a.bindTexture(b,c||V[b]),d.type=b,d.texture=c},compressedTexImage2D:function(){try{a.compressedTexImage2D.apply(a,
arguments)}catch(N){console.error("THREE.WebGLState:",N)}},texImage2D:function(){try{a.texImage2D.apply(a,arguments)}catch(N){console.error("THREE.WebGLState:",N)}},scissor:function(b){!1===J.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),J.copy(b))},viewport:function(b){!1===fa.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),fa.copy(b))},reset:function(){for(var b=0;b<w.length;b++)1===w[b]&&(a.disableVertexAttribArray(b),w[b]=0);A={};I=C=null;L={};H=G=Q=O=null;t.reset();q.reset();k.reset()}}}function Mg(a,b,c,d,
e,f,g){function h(a,b){if(a.width>b||a.height>b){if("data"in a){console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+a.width+"x"+a.height+").");return}b/=Math.max(a.width,a.height);var c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");c.width=Math.floor(a.width*b);c.height=Math.floor(a.height*b);c.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,c.width,c.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+c.width+
"x"+c.height,a);return c}return a}function l(a){return J.isPowerOfTwo(a.width)&&J.isPowerOfTwo(a.height)}function m(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function v(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function n(b){return 1003===b||1004===b||1005===b?a.NEAREST:a.LINEAR}function t(b){b=b.target;b.removeEventListener("dispose",t);a:{var c=d.get(b);if(b.image&&c.__image__webglTextureCube)a.deleteTexture(c.__image__webglTextureCube);
else{if(void 0===c.__webglInit)break a;a.deleteTexture(c.__webglTexture)}d.remove(b)}b.isVideoTexture&&delete A[b.id];g.memory.textures--}function q(b){b=b.target;b.removeEventListener("dispose",q);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),
c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function k(b,n){var q=d.get(b);if(b.isVideoTexture){var k=b.id,r=g.render.frame;A[k]!==r&&(A[k]=r,b.update())}if(0<b.version&&q.__version!==b.version)if(k=b.image,void 0===k)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",b);else if(!1===k.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",b);else{void 0===
q.__webglInit&&(q.__webglInit=!0,b.addEventListener("dispose",t),q.__webglTexture=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);a.pixelStorei(a.UNPACK_ALIGNMENT,b.unpackAlignment);n=h(b.image,e.maxTextureSize);(1001!==b.wrapS||1001!==b.wrapT||1003!==b.minFilter&&1006!==b.minFilter)&&!1===l(n)&&(n instanceof HTMLImageElement||
n instanceof HTMLCanvasElement||n instanceof ImageBitmap)&&(void 0===C&&(C=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),C.width=J.floorPowerOfTwo(n.width),C.height=J.floorPowerOfTwo(n.height),C.getContext("2d").drawImage(n,0,0,C.width,C.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+n.width+"x"+n.height+"). Resized to "+C.width+"x"+C.height,n),n=C);k=l(n);r=f.convert(b.format);var p=f.convert(b.type);u(a.TEXTURE_2D,b,k);var O=b.mipmaps;if(b.isDepthTexture){var y=
a.DEPTH_COMPONENT;if(1015===b.type){if(!x)throw Error("Float Depth Texture only supported in WebGL2.0");y=a.DEPTH_COMPONENT32F}else x&&(y=a.DEPTH_COMPONENT16);1026===b.format&&y===a.DEPTH_COMPONENT&&1012!==b.type&&1014!==b.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),b.type=1012,p=f.convert(b.type));1027===b.format&&(y=a.DEPTH_STENCIL,1020!==b.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),
b.type=1020,p=f.convert(b.type)));c.texImage2D(a.TEXTURE_2D,0,y,n.width,n.height,0,r,p,null)}else if(b.isDataTexture)if(0<O.length&&k){for(var Q=0,w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,n.width,n.height,0,r,p,n.data),q.__maxMipLevel=0;else if(b.isCompressedTexture){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(r)?
c.compressedTexImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);q.__maxMipLevel=O.length-1}else if(0<O.length&&k){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,r,p,y);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,r,p,n),q.__maxMipLevel=0;m(b,k)&&v(a.TEXTURE_2D,b,n.width,
n.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b);return}c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture)}function u(c,g,h){h?(a.texParameteri(c,a.TEXTURE_WRAP_S,f.convert(g.wrapS)),a.texParameteri(c,a.TEXTURE_WRAP_T,f.convert(g.wrapT)),a.texParameteri(c,a.TEXTURE_MAG_FILTER,f.convert(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,f.convert(g.minFilter))):(a.texParameteri(c,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(c,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),
1001===g.wrapS&&1001===g.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",g),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n(g.minFilter)),1003!==g.minFilter&&1006!==g.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",g));!(h=b.get("EXT_texture_filter_anisotropic"))||
1015===g.type&&null===b.get("OES_texture_float_linear")||1016===g.type&&null===b.get("OES_texture_half_float_linear")||!(1<g.anisotropy||d.get(g).__currentAnisotropy)||(a.texParameterf(c,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,e.getMaxAnisotropy())),d.get(g).__currentAnisotropy=g.anisotropy)}function p(b,e,g,h){var l=f.convert(e.texture.format),m=f.convert(e.texture.type);c.texImage2D(h,0,l,e.width,e.height,0,l,m,null);a.bindFramebuffer(a.FRAMEBUFFER,b);a.framebufferTexture2D(a.FRAMEBUFFER,
g,h,d.get(e.texture).__webglTexture,0);a.bindFramebuffer(a.FRAMEBUFFER,null)}function w(b,c){a.bindRenderbuffer(a.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,
b)):a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,c.width,c.height);a.bindRenderbuffer(a.RENDERBUFFER,null)}var x="undefined"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext,A={},C;this.setTexture2D=k;this.setTextureCube=function(b,n){var q=d.get(b);if(6===b.image.length)if(0<b.version&&q.__version!==b.version){q.__image__webglTextureCube||(b.addEventListener("dispose",t),q.__image__webglTextureCube=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_CUBE_MAP,
q.__image__webglTextureCube);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);n=b&&b.isCompressedTexture;for(var k=b.image[0]&&b.image[0].isDataTexture,r=[],p=0;6>p;p++)r[p]=n||k?k?b.image[p].image:b.image[p]:h(b.image[p],e.maxCubemapSize);var x=r[0],y=l(x),C=f.convert(b.format),w=f.convert(b.type);u(a.TEXTURE_CUBE_MAP,b,y);for(p=0;6>p;p++)if(n)for(var O,Q=r[p].mipmaps,A=0,B=Q.length;A<B;A++)O=Q[A],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(C)?c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+
p,A,C,O.width,O.height,0,O.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,A,C,O.width,O.height,0,C,w,O.data);else k?c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,r[p].width,r[p].height,0,C,w,r[p].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,C,w,r[p]);q.__maxMipLevel=n?Q.length-1:0;m(b,y)&&v(a.TEXTURE_CUBE_MAP,b,x.width,x.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b)}else c.activeTexture(a.TEXTURE0+
n),c.bindTexture(a.TEXTURE_CUBE_MAP,q.__image__webglTextureCube)};this.setTextureCubeDynamic=function(b,e){c.activeTexture(a.TEXTURE0+e);c.bindTexture(a.TEXTURE_CUBE_MAP,d.get(b).__webglTexture)};this.setupRenderTarget=function(b){var e=d.get(b),f=d.get(b.texture);b.addEventListener("dispose",q);f.__webglTexture=a.createTexture();g.memory.textures++;var h=!0===b.isWebGLRenderTargetCube,n=l(b);if(h){e.__webglFramebuffer=[];for(var t=0;6>t;t++)e.__webglFramebuffer[t]=a.createFramebuffer()}else e.__webglFramebuffer=
a.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);u(a.TEXTURE_CUBE_MAP,b.texture,n);for(t=0;6>t;t++)p(e.__webglFramebuffer[t],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t);m(b.texture,n)&&v(a.TEXTURE_CUBE_MAP,b.texture,b.width,b.height);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),u(a.TEXTURE_2D,b.texture,n),p(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),m(b.texture,n)&&v(a.TEXTURE_2D,b.texture,b.width,b.height),
c.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&
b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);k(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error("Unknown depthTexture format");
}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),w(e.__webglDepthbuffer[f],b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),w(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture,f=l(b);if(m(e,f)){f=b.isWebGLRenderTargetCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D;var g=d.get(e).__webglTexture;
c.bindTexture(f,g);v(f,e,b.width,b.height);c.bindTexture(f,null)}}}function af(a,b){return{convert:function(c){if(1E3===c)return a.REPEAT;if(1001===c)return a.CLAMP_TO_EDGE;if(1002===c)return a.MIRRORED_REPEAT;if(1003===c)return a.NEAREST;if(1004===c)return a.NEAREST_MIPMAP_NEAREST;if(1005===c)return a.NEAREST_MIPMAP_LINEAR;if(1006===c)return a.LINEAR;if(1007===c)return a.LINEAR_MIPMAP_NEAREST;if(1008===c)return a.LINEAR_MIPMAP_LINEAR;if(1009===c)return a.UNSIGNED_BYTE;if(1017===c)return a.UNSIGNED_SHORT_4_4_4_4;
if(1018===c)return a.UNSIGNED_SHORT_5_5_5_1;if(1019===c)return a.UNSIGNED_SHORT_5_6_5;if(1010===c)return a.BYTE;if(1011===c)return a.SHORT;if(1012===c)return a.UNSIGNED_SHORT;if(1013===c)return a.INT;if(1014===c)return a.UNSIGNED_INT;if(1015===c)return a.FLOAT;if(1016===c){var d=b.get("OES_texture_half_float");if(null!==d)return d.HALF_FLOAT_OES}if(1021===c)return a.ALPHA;if(1022===c)return a.RGB;if(1023===c)return a.RGBA;if(1024===c)return a.LUMINANCE;if(1025===c)return a.LUMINANCE_ALPHA;if(1026===
c)return a.DEPTH_COMPONENT;if(1027===c)return a.DEPTH_STENCIL;if(100===c)return a.FUNC_ADD;if(101===c)return a.FUNC_SUBTRACT;if(102===c)return a.FUNC_REVERSE_SUBTRACT;if(200===c)return a.ZERO;if(201===c)return a.ONE;if(202===c)return a.SRC_COLOR;if(203===c)return a.ONE_MINUS_SRC_COLOR;if(204===c)return a.SRC_ALPHA;if(205===c)return a.ONE_MINUS_SRC_ALPHA;if(206===c)return a.DST_ALPHA;if(207===c)return a.ONE_MINUS_DST_ALPHA;if(208===c)return a.DST_COLOR;if(209===c)return a.ONE_MINUS_DST_COLOR;if(210===
c)return a.SRC_ALPHA_SATURATE;if(33776===c||33777===c||33778===c||33779===c)if(d=b.get("WEBGL_compressed_texture_s3tc"),null!==d){if(33776===c)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===c)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===c)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===c)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===c||35841===c||35842===c||35843===c)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===c)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===
c)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===c)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===c)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===c&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===c||37809===c||37810===c||37811===c||37812===c||37813===c||37814===c||37815===c||37816===c||37817===c||37818===c||37819===c||37820===c||37821===c)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return c;if(103===c||104===c)if(d=b.get("EXT_blend_minmax"),
null!==d){if(103===c)return d.MIN_EXT;if(104===c)return d.MAX_EXT}return 1020===c&&(d=b.get("WEBGL_depth_texture"),null!==d)?d.UNSIGNED_INT_24_8_WEBGL:0}}}function Ub(){H.call(this);this.type="Group"}function Z(a,b,c,d){Ra.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Hc(a){Z.call(this);
this.cameras=a||[]}function bf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth;c=c.renderHeight;w=a.getPixelRatio();y=a.getSize();a.setDrawingBufferSize(2*f,c,1);A.start()}else d.enabled&&(a.setDrawingBufferSize(y.width,y.height,w),A.stop())}var d=this,e=null,f=null,g=null,h=[],l=new R,m=new R;"undefined"!==typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));
var v=new R,n=new ca,t=new p,q=new Z;q.bounds=new W(0,0,.5,1);q.layers.enable(1);var k=new Z;k.bounds=new W(.5,0,.5,1);k.layers.enable(2);var u=new Hc([q,k]);u.layers.enable(1);u.layers.enable(2);var y,w,x=!1;this.enabled=!1;this.userHeight=1.6;this.getController=function(a){var b=h[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice=function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);A.setContext(a)};this.setPoseTarget=function(a){void 0!==a&&
(g=a)};this.getCamera=function(a){if(null===e)return a.position.set(0,d.userHeight,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);var b=e.stageParameters;b?l.fromArray(b.sittingToStandingTransform):l.makeTranslation(0,d.userHeight,0);b=f.pose;var c=null!==g?g:a;c.matrix.copy(l);c.matrix.decompose(c.position,c.quaternion,c.scale);null!==b.orientation&&(n.fromArray(b.orientation),c.quaternion.multiply(n));null!==b.position&&(n.setFromRotationMatrix(l),t.fromArray(b.position),t.applyQuaternion(n),
c.position.add(t));c.updateMatrixWorld();if(!1===e.isPresenting)return a;q.near=a.near;k.near=a.near;q.far=a.far;k.far=a.far;u.matrixWorld.copy(a.matrixWorld);u.matrixWorldInverse.copy(a.matrixWorldInverse);q.matrixWorldInverse.fromArray(f.leftViewMatrix);k.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(l);q.matrixWorldInverse.multiply(m);k.matrixWorldInverse.multiply(m);a=c.parent;null!==a&&(v.getInverse(a.matrixWorld),q.matrixWorldInverse.multiply(v),k.matrixWorldInverse.multiply(v));
q.matrixWorld.getInverse(q.matrixWorldInverse);k.matrixWorld.getInverse(k.matrixWorldInverse);q.projectionMatrix.fromArray(f.leftProjectionMatrix);k.projectionMatrix.fromArray(f.rightProjectionMatrix);u.projectionMatrix.copy(q.projectionMatrix);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&q.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&k.bounds.fromArray(a.rightBounds));a:for(a=0;a<h.length;a++){b=h[a];b:{c=a;for(var r=navigator.getGamepads&&
navigator.getGamepads(),p=0,y=0,w=r.length;p<w;p++){var C=r[p];if(C&&("Daydream Controller"===C.id||"Gear VR Controller"===C.id||"Oculus Go Controller"===C.id||"OpenVR Gamepad"===C.id||C.id.startsWith("Oculus Touch")||C.id.startsWith("Spatial Controller"))){if(y===c){c=C;break b}y++}}c=void 0}if(void 0!==c&&void 0!==c.pose){if(null===c.pose)break a;r=c.pose;!1===r.hasPosition&&b.position.set(.2,-.6,-.05);null!==r.position&&b.position.fromArray(r.position);null!==r.orientation&&b.quaternion.fromArray(r.orientation);
b.matrix.compose(b.position,b.quaternion,b.scale);b.matrix.premultiply(l);b.matrix.decompose(b.position,b.quaternion,b.scale);b.matrixWorldNeedsUpdate=!0;b.visible=!0;r="Daydream Controller"===c.id?0:1;x!==c.buttons[r].pressed&&((x=c.buttons[r].pressed)?b.dispatchEvent({type:"selectstart"}):(b.dispatchEvent({type:"selectend"}),b.dispatchEvent({type:"select"})))}else b.visible=!1}return u};this.getStandingMatrix=function(){return l};this.isPresenting=b;var A=new Vd;this.setAnimationLoop=function(a){A.setAnimationLoop(a)};
this.submitFrame=function(){b()&&e.submitFrame()};this.dispose=function(){"undefined"!==typeof window&&window.removeEventListener("vrdisplaypresentchange",c)}}function Ng(a){function b(){return null!==h&&null!==l}function c(a){var b=v[n.indexOf(a.inputSource)];b&&b.dispatchEvent({type:a.type})}function d(){a.setFramebuffer(null);p.stop()}function e(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.multiplyMatrices(b.matrixWorld,a.matrix);a.matrixWorldInverse.getInverse(a.matrixWorld)}var f=
a.context,g=null,h=null,l=null,m=null,v=[],n=[],t=new Z;t.layers.enable(1);t.viewport=new W;var q=new Z;q.layers.enable(2);q.viewport=new W;var k=new Hc([t,q]);k.layers.enable(1);k.layers.enable(2);this.enabled=!1;this.getController=function(a){var b=v[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,v[a]=b);return b};this.getDevice=function(){return g};this.setDevice=function(a){void 0!==a&&(g=a);f.setCompatibleXRDevice(a)};this.setSession=function(b,e){h=b;null!==h&&(h.addEventListener("select",
c),h.addEventListener("selectstart",c),h.addEventListener("selectend",c),h.addEventListener("end",d),h.baseLayer=new XRWebGLLayer(h,f),h.requestFrameOfReference(e.frameOfReferenceType).then(function(b){l=b;a.setFramebuffer(h.baseLayer.framebuffer);p.setContext(h);p.start()}),n=h.getInputSources(),h.addEventListener("inputsourceschange",function(){n=h.getInputSources();console.log(n)}))};this.getCamera=function(a){if(b()){var c=a.parent,d=k.cameras;e(k,c);for(var f=0;f<d.length;f++)e(d[f],c);a.matrixWorld.copy(k.matrixWorld);
a=a.children;f=0;for(c=a.length;f<c;f++)a[f].updateMatrixWorld(!0);return k}return a};this.isPresenting=b;var u=null,p=new Vd;p.setAnimationLoop(function(a,b){m=b.getDevicePose(l);if(null!==m)for(var c=h.baseLayer,d=b.views,e=0;e<d.length;e++){var f=d[e],g=c.getViewport(f),t=m.getViewMatrix(f),q=k.cameras[e];q.matrix.fromArray(t).getInverse(q.matrix);q.projectionMatrix.fromArray(f.projectionMatrix);q.viewport.set(g.x,g.y,g.width,g.height);0===e&&(k.matrix.copy(q.matrix),k.projectionMatrix.copy(q.projectionMatrix))}for(e=
0;e<v.length;e++){c=v[e];if(d=n[e])if(d=b.getInputPose(d,l),null!==d){c.matrix.elements=d.pointerMatrix;c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}u&&u(a)});this.setAnimationLoop=function(a){u=a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new THREE.Matrix4};this.submitFrame=function(){}}function ae(a){function b(){ma=new Pf(F);ma.get("WEBGL_depth_texture");
ma.get("OES_texture_float");ma.get("OES_texture_float_linear");ma.get("OES_texture_half_float");ma.get("OES_texture_half_float_linear");ma.get("OES_standard_derivatives");ma.get("OES_element_index_uint");ma.get("ANGLE_instanced_arrays");ia=new af(F,ma);Sa=new Nf(F,ma,a);aa=new Lg(F,ma,ia);aa.scissor(S.copy(ba).multiplyScalar(V));aa.viewport(db.copy(N).multiplyScalar(V));hb=new Sf(F);Aa=new Ag;Z=new Mg(F,ma,aa,Aa,Sa,ia,hb);ja=new Gf(F);qa=new Qf(F,ja,hb);pa=new Vf(qa,hb);va=new Uf(F);na=new zg(U,ma,
Sa);ra=new Eg;oa=new Jg;la=new Lf(U,aa,pa,O);wa=new Mf(F,ma,hb);xa=new Rf(F,ma,hb);ya=new Kg(U,F,aa,Z,Sa);hb.programs=na.programs;U.context=F;U.capabilities=Sa;U.extensions=ma;U.properties=Aa;U.renderLists=ra;U.state=aa;U.info=hb}function c(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");G=!0}function d(){console.log("THREE.WebGLRenderer: Context Restored.");G=!1;b()}function e(a){a=a.target;a.removeEventListener("dispose",e);f(a);Aa.remove(a)}function f(a){var b=Aa.get(a).program;
a.program=void 0;void 0!==b&&na.releaseProgram(b)}function g(a,b,c){a.render(function(a){U.renderBufferImmediate(a,b,c)})}function h(a,b,c){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isLight)z.pushLight(a),a.castShadow&&z.pushShadow(a);else if(a.isSprite)a.frustumCulled&&!da.intersectsSprite(a)||z.pushSprite(a);else if(a.isImmediateRenderObject)c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud),B.push(a,null,a.material,Tb.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&
a.skeleton.update(),!a.frustumCulled||da.intersectsObject(a)){c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud);var d=pa.update(a),e=a.material;if(Array.isArray(e))for(var f=d.groups,g=0,l=f.length;g<l;g++){var m=f[g],n=e[m.materialIndex];n&&n.visible&&B.push(a,d,n,Tb.z,m)}else e.visible&&B.push(a,d,e,Tb.z,null)}a=a.children;g=0;for(l=a.length;g<l;g++)h(a[g],b,c)}}function l(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,n=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){Pb=
c;for(var v=c.cameras,t=0,q=v.length;t<q;t++){var k=v[t];if(h.layers.test(k.layers)){if("viewport"in k)aa.viewport(db.copy(k.viewport));else{var r=k.bounds;aa.viewport(db.set(r.x*Y,r.y*fa,r.z*Y,r.w*fa).multiplyScalar(V))}m(h,b,k,l,n,g)}}}else Pb=null,m(h,b,c,l,n,g)}}function m(a,b,c,d,e,f){a.onBeforeRender(U,b,c,d,e,f);z=oa.get(b,Pb||c);a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){var h=a.isMesh&&
0>a.matrixWorld.determinant();aa.setMaterial(e,h);h=n(c,b.fog,e,a);I="";g(a,h,e)}else U.renderBufferDirect(c,b.fog,d,e,a,f);a.onAfterRender(U,b,c,d,e,f);z=oa.get(b,Pb||c)}function v(a,b,c){var d=Aa.get(a),g=z.state.lights;c=na.getParameters(a,g.state,z.state.shadowsArray,b,X.numPlanes,X.numIntersection,c);var h=na.getProgramCode(a,c),l=d.program,m=!0;if(void 0===l)a.addEventListener("dispose",e);else if(l.code!==h)f(a);else{if(d.lightsHash!==g.state.hash)Aa.update(a,"lightsHash",g.state.hash);else if(void 0!==
c.shaderID)return;m=!1}m&&(c.shaderID?(l=tb[c.shaderID],d.shader={name:a.type,uniforms:Ba.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},a.onBeforeCompile(d.shader,U),l=na.acquireProgram(a,d.shader,c,h),d.program=l,a.program=l);c=l.getAttributes();if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<U.maxMorphTargets;h++)0<=c["morphTarget"+h]&&a.numSupportedMorphTargets++;
if(a.morphNormals)for(h=a.numSupportedMorphNormals=0;h<U.maxMorphNormals;h++)0<=c["morphNormal"+h]&&a.numSupportedMorphNormals++;c=d.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=X.numPlanes,d.numIntersection=X.numIntersection,c.clippingPlanes=X.uniform;d.fog=b;d.lightsHash=g.state.hash;a.lights&&(c.ambientLightColor.value=g.state.ambient,c.directionalLights.value=g.state.directional,c.spotLights.value=g.state.spot,c.rectAreaLights.value=g.state.rectArea,
c.pointLights.value=g.state.point,c.hemisphereLights.value=g.state.hemi,c.directionalShadowMap.value=g.state.directionalShadowMap,c.directionalShadowMatrix.value=g.state.directionalShadowMatrix,c.spotShadowMap.value=g.state.spotShadowMap,c.spotShadowMatrix.value=g.state.spotShadowMatrix,c.pointShadowMap.value=g.state.pointShadowMap,c.pointShadowMatrix.value=g.state.pointShadowMatrix);a=d.program.getUniforms();a=eb.seqWithValue(a.seq,c);d.uniformsList=a}function n(a,b,c,d){$d=0;var e=Aa.get(c),f=z.state.lights;
ca&&(ha||a!==L)&&X.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===L&&c.id===P);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:c.lights&&e.lightsHash!==f.state.hash?c.needsUpdate=!0:void 0===e.numClippingPlanes||e.numClippingPlanes===X.numPlanes&&e.numIntersection===X.numIntersection||(c.needsUpdate=!0));c.needsUpdate&&(v(c,b,d),c.needsUpdate=!1);var g=!1,h=!1,l=!1;f=e.program;var m=f.getUniforms(),n=e.shader.uniforms;aa.useProgram(f.program)&&
(l=h=g=!0);c.id!==P&&(P=c.id,h=!0);if(g||a!==L){m.setValue(F,"projectionMatrix",a.projectionMatrix);Sa.logarithmicDepthBuffer&&m.setValue(F,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));L!==(Pb||a)&&(L=Pb||a,l=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshStandardMaterial||c.envMap)g=m.map.cameraPosition,void 0!==g&&g.setValue(F,Tb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||
c.skinning)&&m.setValue(F,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(m.setOptional(F,d,"bindMatrix"),m.setOptional(F,d,"bindMatrixInverse"),a=d.skeleton))if(g=a.bones,Sa.floatVertexTextures){if(void 0===a.boneTexture){g=Math.sqrt(4*g.length);g=J.ceilPowerOfTwo(g);g=Math.max(g,4);var r=new Float32Array(g*g*4);r.set(a.boneMatrices);var u=new lb(r,g,g,1023,1015);u.needsUpdate=!0;a.boneMatrices=r;a.boneTexture=u;a.boneTextureSize=g}m.setValue(F,"boneTexture",a.boneTexture);m.setValue(F,"boneTextureSize",
a.boneTextureSize)}else m.setOptional(F,a,"boneMatrices");h&&(m.setValue(F,"toneMappingExposure",U.toneMappingExposure),m.setValue(F,"toneMappingWhitePoint",U.toneMappingWhitePoint),c.lights&&(h=l,n.ambientLightColor.needsUpdate=h,n.directionalLights.needsUpdate=h,n.pointLights.needsUpdate=h,n.spotLights.needsUpdate=h,n.rectAreaLights.needsUpdate=h,n.hemisphereLights.needsUpdate=h),b&&c.fog&&(n.fogColor.value=b.color,b.isFog?(n.fogNear.value=b.near,n.fogFar.value=b.far):b.isFogExp2&&(n.fogDensity.value=
b.density)),c.isMeshBasicMaterial?t(n,c):c.isMeshLambertMaterial?(t(n,c),c.emissiveMap&&(n.emissiveMap.value=c.emissiveMap)):c.isMeshPhongMaterial?(t(n,c),c.isMeshToonMaterial?(q(n,c),c.gradientMap&&(n.gradientMap.value=c.gradientMap)):q(n,c)):c.isMeshStandardMaterial?(t(n,c),c.isMeshPhysicalMaterial?(k(n,c),n.reflectivity.value=c.reflectivity,n.clearCoat.value=c.clearCoat,n.clearCoatRoughness.value=c.clearCoatRoughness):k(n,c)):c.isMeshDepthMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=
c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias),n.referencePosition.value.copy(c.referencePosition),n.nearDistance.value=c.nearDistance,n.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(n,c),c.bumpMap&&(n.bumpMap.value=c.bumpMap,n.bumpScale.value=
c.bumpScale,1===c.side&&(n.bumpScale.value*=-1)),c.normalMap&&(n.normalMap.value=c.normalMap,n.normalScale.value.copy(c.normalScale),1===c.side&&n.normalScale.value.negate()),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isLineBasicMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,c.isLineDashedMaterial&&(n.dashSize.value=c.dashSize,n.totalSize.value=c.dashSize+c.gapSize,n.scale.value=
c.scale)):c.isPointsMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,n.size.value=c.size*V,n.scale.value=.5*fa,n.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),n.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(n.color.value=c.color,n.opacity.value=c.opacity),void 0!==n.ltc_1&&(n.ltc_1.value=K.LTC_1),void 0!==n.ltc_2&&(n.ltc_2.value=K.LTC_2),eb.upload(F,e.uniformsList,n,U));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(eb.upload(F,e.uniformsList,
n,U),c.uniformsNeedUpdate=!1);m.setValue(F,"modelViewMatrix",d.modelViewMatrix);m.setValue(F,"normalMatrix",d.normalMatrix);m.setValue(F,"modelMatrix",d.matrixWorld);return f}function t(a,b){a.opacity.value=b.opacity;b.color&&(a.diffuse.value=b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=
b.envMap&&b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Aa.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:
b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function q(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,
a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function k(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,
a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","94");a=a||{};var u=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml",
"canvas"),y=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,x=void 0!==a.depth?a.depth:!0,A=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.powerPreference?a.powerPreference:"default",B=null,z=null;this.domElement=u;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=
[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var U=this,G=!1,H=null,D=null,E=null,P=-1,I="",L=null,Pb=null,db=new W,S=new W,T=null,$d=0,Y=u.width,fa=u.height,V=1,N=new W(0,0,Y,fa),ba=new W(0,0,Y,fa),ea=!1,da=new td,X=new Of,ca=!1,ha=!1,ud=new R,Tb=new p;try{w={alpha:w,depth:x,stencil:A,antialias:C,premultipliedAlpha:O,
preserveDrawingBuffer:Q,powerPreference:M};u.addEventListener("webglcontextlost",c,!1);u.addEventListener("webglcontextrestored",d,!1);var F=y||u.getContext("webgl",w)||u.getContext("experimental-webgl",w);if(null===F){if(null!==u.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===F.getShaderPrecisionFormat&&(F.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Og){console.error("THREE.WebGLRenderer: "+
Og.message)}var ma,Sa,aa,hb,Aa,Z,ja,qa,pa,na,ra,oa,la,va,wa,xa,ya,ia;b();var ka="xr"in navigator?new Ng(U):new bf(U);this.vr=ka;var za=new $e(U,pa,Sa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return F};this.getContextAttributes=function(){return F.getContextAttributes()};this.forceContextLoss=function(){var a=ma.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=ma.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return V};
this.setPixelRatio=function(a){void 0!==a&&(V=a,this.setSize(Y,fa,!1))};this.getSize=function(){return{width:Y,height:fa}};this.setSize=function(a,b,c){ka.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Y=a,fa=b,u.width=a*V,u.height=b*V,!1!==c&&(u.style.width=a+"px",u.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(){return{width:Y*V,height:fa*V}};this.setDrawingBufferSize=function(a,b,c){Y=a;fa=b;V=c;u.width=
a*c;u.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(){return db};this.setViewport=function(a,b,c,d){N.set(a,fa-b-d,c,d);aa.viewport(db.copy(N).multiplyScalar(V))};this.setScissor=function(a,b,c,d){ba.set(a,fa-b-d,c,d);aa.scissor(S.copy(ba).multiplyScalar(V))};this.setScissorTest=function(a){aa.setScissorTest(ea=a)};this.getClearColor=function(){return la.getClearColor()};this.setClearColor=function(){la.setClearColor.apply(la,arguments)};this.getClearAlpha=function(){return la.getClearAlpha()};
this.setClearAlpha=function(){la.setClearAlpha.apply(la,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=F.COLOR_BUFFER_BIT;if(void 0===b||b)d|=F.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=F.STENCIL_BUFFER_BIT;F.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.dispose=function(){u.removeEventListener("webglcontextlost",
c,!1);u.removeEventListener("webglcontextrestored",d,!1);ra.dispose();oa.dispose();Aa.dispose();pa.dispose();ka.dispose();ta.stop()};this.renderBufferImmediate=function(a,b,c){aa.initAttributes();var d=Aa.get(a);a.hasPositions&&!d.position&&(d.position=F.createBuffer());a.hasNormals&&!d.normal&&(d.normal=F.createBuffer());a.hasUvs&&!d.uv&&(d.uv=F.createBuffer());a.
gitextract_b5dgj9ng/
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── dist/
│ └── threebox.js
├── docs/
│ ├── SymbolLayer3D.md
│ └── Threebox.md
├── examples/
│ ├── Object3D.html
│ ├── basic.html
│ ├── config_template.js
│ ├── line.html
│ ├── logistics.html
│ ├── mercator.html
│ ├── models/
│ │ ├── Truck.mtl
│ │ └── Truck.obj
│ ├── old/
│ │ ├── basic.html
│ │ ├── flocking.html
│ │ └── orientation.html
│ ├── raycaster.html
│ └── tube.html
├── exports.js
├── main.js
├── package.json
├── src/
│ ├── Animation/
│ │ └── AnimationManager.js
│ ├── Camera/
│ │ └── CameraSync.js
│ ├── Threebox.js
│ ├── Utils/
│ │ ├── Utils.js
│ │ └── ValueGenerator.js
│ ├── objects/
│ │ ├── Object3D.js
│ │ ├── customLines/
│ │ │ ├── Line2.js
│ │ │ ├── LineGeometry.js
│ │ │ ├── LineMaterial.js
│ │ │ ├── LineSegments2.js
│ │ │ ├── LineSegmentsGeometry.js
│ │ │ ├── Wireframe.js
│ │ │ └── WireframeGeometry2.js
│ │ ├── line.js
│ │ ├── loadObj.js
│ │ ├── loaders/
│ │ │ ├── MTLLoader.js
│ │ │ └── OBJLoader.js
│ │ ├── objects.js
│ │ ├── sphere.js
│ │ └── tube.js
│ ├── three.js
│ └── utils/
│ ├── constants.js
│ ├── material.js
│ └── validate.js
└── tests/
├── threebox-tests-bundle.js
├── threebox-tests.html
├── threebox-tests.js
└── unit/
├── camera.test.js
├── material.test.js
├── object.test.js
├── utilities.test.js
└── validate.test.js
SYMBOL INDEX (1020 symbols across 24 files)
FILE: dist/threebox.js
function r (line 1) | function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==...
function Threebox (line 20) | function Threebox(map, glContext, options){
function convert (line 237) | function convert(degrees){
function convert (line 263) | function convert(radians){
method normalizeVertices (line 342) | normalizeVertices(vertices) {
method flattenVectors (line 363) | flattenVectors(vectors) {
function Validate (line 471) | function Validate(){
function AnimationManager (line 589) | function AnimationManager(map) {
function CameraSync (line 843) | function CameraSync(map, camera, world) {
function Object3D (line 971) | function Object3D(options) {
function line (line 989) | function line(obj){
function loadObj (line 1985) | function loadObj(options, cb){
function resolveURL (line 2393) | function resolveURL( baseUrl, url ) {
function setMapForType (line 2405) | function setMapForType( mapType, value ) {
function Objects (line 3337) | function Objects(){
function Sphere (line 3525) | function Sphere(obj){
function tube (line 3545) | function tube(obj, world){
function za (line 3742) | function za(){}
function B (line 3742) | function B(a,b){this.x=a||0;this.y=b||0}
function R (line 3742) | function R(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments...
function ca (line 3742) | function ca(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void...
function p (line 3742) | function p(a,
function la (line 3743) | function la(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&cons...
function ea (line 3743) | function ea(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,"id",{value:...
function W (line 3744) | function W(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==...
function kb (line 3744) | function kb(a,
function Lb (line 3746) | function Lb(a,b,c){kb.call(this,a,b,c);this.activeMipMapLevel=this.activ...
function lb (line 3746) | function lb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n...
function Xa (line 3746) | function Xa(a,b){this.min=void 0!==a?a:new p(Infinity,Infinity,Infinity)...
function Ha (line 3746) | function Ha(a,b){this.center=void 0!==
function Ia (line 3747) | function Ia(a,b){this.normal=void 0!==a?a:new p(1,0,0);this.constant=voi...
function td (line 3747) | function td(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ia,void 0!==b?b:n...
function G (line 3747) | function G(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(...
function Vd (line 3747) | function Vd(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a)...
function Gf (line 3748) | function Gf(a){function b(b,c){var d=b.array,e=b.dynamic?a.DYNAMIC_DRAW:...
function mb (line 3751) | function mb(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=...
function Wd (line 3751) | function Wd(){this.mask=1}
function H (line 3751) | function H(){Object.defineProperty(this,"id",{value:Hf++});this.uuid=J.g...
function Ra (line 3752) | function Ra(){H.call(this);this.type="Camera";this.matrixWorldInverse=
function Mb (line 3753) | function Mb(a,b,c,d,e,f){Ra.call(this);this.type="OrthographicCamera";th...
function Ya (line 3753) | function Ya(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isV...
function P (line 3753) | function P(){Object.defineProperty(this,
function L (line 3754) | function L(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferA...
function yc (line 3755) | function yc(a,b,c){L.call(this,new Int8Array(a),b,c)}
function zc (line 3755) | function zc(a,b,c){L.call(this,new Uint8Array(a),b,c)}
function Ac (line 3755) | function Ac(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}
function Bc (line 3755) | function Bc(a,b,c){L.call(this,new Int16Array(a),b,c)}
function nb (line 3755) | function nb(a,b,c){L.call(this,new Uint16Array(a),b,c)}
function Cc (line 3755) | function Cc(a,b,c){L.call(this,new Int32Array(a),b,c)}
function ob (line 3755) | function ob(a,
function z (line 3756) | function z(a,b,c){L.call(this,new Float32Array(a),b,c)}
function Dc (line 3756) | function Dc(a,b,c){L.call(this,new Float64Array(a),b,c)}
function Ge (line 3756) | function Ge(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[...
function He (line 3756) | function He(a){if(0===a.length)return-Infinity;
function D (line 3757) | function D(){Object.defineProperty(this,"id",{value:Jf+=2});this.uuid=J....
function Nb (line 3757) | function Nb(a,b,c,d,e,f){P.call(this);this.type="BoxGeometry";this.param...
function pb (line 3758) | function pb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,Q,M,Ob){var r=f/Q,u=...
function Fc (line 3760) | function Fc(a,b,c,d){P.call(this);this.type="PlaneGeometry";this.paramet...
function rb (line 3760) | function rb(a,b,c,d){D.call(this);this.type="PlaneBufferGeometry";this.p...
function I (line 3761) | function I(){Object.defineProperty(this,"id",{value:Kf++});this.uuid=J.g...
function ua (line 3763) | function ua(a){I.call(this);this.type="MeshBasicMaterial";this.color=new...
function Fa (line 3764) | function Fa(a){I.call(this);this.type="ShaderMaterial";this.defines={};t...
function sb (line 3765) | function sb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==...
function Qb (line 3765) | function Qb(a,b){this.start=void 0!==a?a:new p;this.end=void 0!==b?b:new p}
function ta (line 3766) | function ta(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;t...
function va (line 3766) | function va(a,b){H.call(this);this.type="Mesh";this.geometry=void 0!==a?...
function Lf (line 3766) | function Lf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a....
function Mf (line 3768) | function Mf(a,b,c){var d;this.setMode=function(a){d=a};this.render=funct...
function Nf (line 3769) | function Nf(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisi...
function Of (line 3772) | function Of(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c....
function Pf (line 3774) | function Pf(a){var b={};return{get:function(c){if(void 0!==b[c])return b...
function Qf (line 3776) | function Qf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index...
function Rf (line 3778) | function Rf(a,b,c){var d,e,f;this.setMode=function(a){d=a};this.setIndex...
function Sf (line 3779) | function Sf(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};retu...
function Tf (line 3780) | function Tf(a,b){return Math.abs(b[1])-Math.abs(a[1])}
function Uf (line 3780) | function Uf(a){var b={},c=new Float32Array(8);return{update:function(d,e...
function Vf (line 3781) | function Vf(a,b){var c={};return{update:function(d){var e=b.render.frame...
function Za (line 3782) | function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];ea.call(this,a,void 0...
function Rb (line 3782) | function Rb(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ie[e];vo...
function da (line 3782) | function da(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;...
function qa (line 3782) | function qa(a,b){for(var c=
function Je (line 3783) | function Je(a,b){var c=Ke[b];void 0===c&&(c=new Int32Array(b),Ke[b]=c);f...
function Wf (line 3783) | function Wf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[...
function Xf (line 3783) | function Xf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[...
function Yf (line 3783) | function Yf(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!=...
function Zf (line 3783) | function Zf(a,
function $f (line 3784) | function $f(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!=...
function ag (line 3785) | function ag(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function bg (line 3785) | function bg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function cg (line 3785) | function cg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function dg (line 3786) | function dg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a....
function eg (line 3786) | function eg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a....
function Qe (line 3786) | function Qe(a,b){var c=this.cache;da(c,b)||(a.uniform2iv(this.addr,b),qa...
function Re (line 3786) | function Re(a,b){var c=this.cache;da(c,b)||(a.uniform3iv(this.addr,b),qa...
function Se (line 3786) | function Se(a,b){var c=this.cache;da(c,b)||(a.uniform4iv(this.addr,b),qa(c,
function fg (line 3787) | function fg(a){switch(a){case 5126:return Wf;case 35664:return Yf;case 3...
function gg (line 3787) | function gg(a,b){var c=this.cache;da(c,b)||(a.uniform1fv(this.addr,b),qa...
function hg (line 3787) | function hg(a,b){var c=this.cache;da(c,b)||(a.uniform1iv(this.addr,
function ig (line 3788) | function ig(a,b){var c=this.cache;b=Rb(b,this.size,2);da(c,b)||(a.unifor...
function jg (line 3788) | function jg(a,b){var c=this.cache;b=Rb(b,this.size,3);da(c,b)||(a.unifor...
function kg (line 3788) | function kg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.unifor...
function lg (line 3788) | function lg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.unifor...
function mg (line 3788) | function mg(a,b){var c=this.cache;b=
function ng (line 3789) | function ng(a,b){var c=this.cache;b=Rb(b,this.size,16);da(c,b)||(a.unifo...
function og (line 3789) | function og(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(...
function pg (line 3789) | function pg(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(...
function qg (line 3790) | function qg(a){switch(a){case 5126:return gg;case 35664:return ig;case 3...
function rg (line 3790) | function rg(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=fg(...
function Te (line 3790) | function Te(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;
function Ue (line 3791) | function Ue(a){this.id=a;this.seq=[];this.map={}}
function eb (line 3791) | function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgra...
function sg (line 3792) | function sg(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=b+1+": "+...
function Ve (line 3792) | function Ve(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compile...
function We (line 3793) | function We(a){switch(a){case 3E3:return["Linear","( value )"];case 3001...
function Yd (line 3793) | function Yd(a,b){b=We(b);return"vec4 "+a+"( vec4 value ) { return "+b[0]...
function tg (line 3793) | function tg(a,
function ug (line 3794) | function ug(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";b...
function vg (line 3794) | function vg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpM...
function wg (line 3795) | function wg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define...
function Gc (line 3795) | function Gc(a){return""!==a}
function Xe (line 3795) | function Xe(a,b){return a.replace(/NUM_DIR_LIGHTS/g,
function Ye (line 3796) | function Ye(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPl...
function Zd (line 3796) | function Zd(a){return a.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,functi...
function Ze (line 3797) | function Ze(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i =...
function xg (line 3797) | function xg(a,b,c,d,e,f){var g=a.context,h=d.defines,l=e.vertexShader,m=...
function zg (line 3811) | function zg(a,b,c){function d(a,b){if(a)a.isTexture?c=a.encoding:a.isWeb...
function Ag (line 3818) | function Ag(){var a=new WeakMap;return{get:function(b){var c=a.get(b);vo...
function Bg (line 3818) | function Bg(a,b){return a.renderOrder!==b.renderOrder?
function Cg (line 3819) | function Cg(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.re...
function Dg (line 3819) | function Dg(){var a=[],b=0,c=[],d=[];return{opaque:c,transparent:d,init:...
function Eg (line 3820) | function Eg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];v...
function Fg (line 3820) | function Fg(){var a={};return{get:function(b){if(void 0!==a[b.id])return...
function Gg (line 3822) | function Gg(){var a=new Fg,b={id:Hg++,hash:"",ambient:[0,0,0],directiona...
function Ig (line 3827) | function Ig(){var a=new Gg,b=[],c=[],d=[];return{init:function(){b.lengt...
function Jg (line 3828) | function Jg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];v...
function fb (line 3828) | function fb(a){I.call(this);this.type="MeshDepthMaterial";this.depthPack...
function gb (line 3829) | function gb(a){I.call(this);this.type="MeshDistanceMaterial";this.refere...
function $e (line 3829) | function $e(a,b,c){function d(b,c,d,e,f,g){var h=
function Sb (line 3836) | function Sb(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.need...
function Kg (line 3836) | function Kg(a,
function Lg (line 3845) | function Lg(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createT...
function Mg (line 3857) | function Mg(a,b,c,d,
function af (line 3879) | function af(a,b){return{convert:function(c){if(1E3===c)return a.REPEAT;i...
function Ub (line 3884) | function Ub(){H.call(this);this.type="Group"}
function Z (line 3884) | function Z(a,b,c,d){Ra.call(this);this.type="PerspectiveCamera";this.fov...
function Hc (line 3884) | function Hc(a){Z.call(this);
function bf (line 3885) | function bf(a){function b(){return null!==e&&!0===e.isPresenting}functio...
function Ng (line 3892) | function Ng(a){function b(){return null!==h&&null!==l}function c(a){var ...
function ae (line 3896) | function ae(a){function b(){ma=new Pf(F);ma.get("WEBGL_depth_texture");
function Vb (line 3943) | function Vb(a,b){this.name="";this.color=new G(a);this.density=void 0!==...
function Wb (line 3943) | function Wb(a,b,c){this.name="";this.color=new G(a);this.near=void 0!==b...
function vd (line 3943) | function vd(){H.call(this);this.type="Scene";this.overrideMaterial=this....
function ib (line 3943) | function ib(a){I.call(this);this.type="SpriteMaterial";this.color=new G(...
function Ic (line 3944) | function Ic(a){H.call(this);this.type="Sprite";this.material=void 0!==a?...
function Jc (line 3944) | function Jc(){H.call(this);this.type="LOD";Object.defineProperties(this,...
function Kc (line 3944) | function Kc(a,b){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Flo...
function wd (line 3945) | function wd(){H.call(this);this.type="Bone"}
function xd (line 3945) | function xd(a,b){va.call(this,a,b);this.type="SkinnedMesh";this.bindMode...
function T (line 3945) | function T(a){I.call(this);this.type="LineBasicMaterial";this.color=new ...
function wa (line 3946) | function wa(a,b,c){if(1===c)return console.warn("THREE.Line: parameter T...
function Y (line 3946) | function Y(a,b){wa.call(this,a,b);this.type="LineSegments"}
function yd (line 3946) | function yd(a,b){wa.call(this,a,b);this.type="LineLoop"}
function Ja (line 3946) | function Ja(a){I.call(this);this.type="PointsMaterial";this.color=new G(...
function Xb (line 3947) | function Xb(a,b){H.call(this);this.type="Points";this.geometry=void 0!==...
function be (line 3947) | function be(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.gene...
function Yb (line 3947) | function Yb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n...
function Lc (line 3947) | function Lc(a,
function Zb (line 3948) | function Zb(a){D.call(this);this.type="WireframeGeometry";var b=[],c,d,e...
function Mc (line 3951) | function Mc(a,b,c){P.call(this);this.type="ParametricGeometry";this.para...
function $b (line 3951) | function $b(a,b,c){D.call(this);this.type="ParametricBufferGeometry";thi...
function Nc (line 3953) | function Nc(a,b,c,d){P.call(this);this.type="PolyhedronGeometry";this.pa...
function xa (line 3953) | function xa(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b...
function Oc (line 3956) | function Oc(a,
function ac (line 3957) | function ac(a,b){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3...
function Pc (line 3957) | function Pc(a,b){P.call(this);this.type="OctahedronGeometry";this.parame...
function ub (line 3957) | function ub(a,b){xa.call(this,[1,0,0,
function Qc (line 3958) | function Qc(a,b){P.call(this);this.type="IcosahedronGeometry";this.param...
function bc (line 3958) | function bc(a,b){var c=(1+Math.sqrt(5))/2;xa.call(this,[-1,c,0,1,c,0,-1,...
function Rc (line 3959) | function Rc(a,b){P.call(this);this.type="DodecahedronGeometry";this.para...
function cc (line 3959) | function cc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;xa.call(this,[-1,-1,-1,-...
function Sc (line 3960) | function Sc(a,b,c,d,e,f){P.call(this);this.type="TubeGeometry";this.para...
function dc (line 3961) | function dc(a,b,c,d,e){function f(e){v=a.getPointAt(e/b,v);var f=g.norma...
function Tc (line 3963) | function Tc(a,b,c,d,e,f,g){P.call(this);this.type="TorusKnotGeometry";th...
function ec (line 3964) | function ec(a,b,c,d,e,f){function g(a,b,c,d,e){var f=Math.sin(a);b=c/b*a...
function Uc (line 3966) | function Uc(a,b,c,d,e){P.call(this);this.type="TorusGeometry";this.param...
function fc (line 3966) | function fc(a,b,c,d,e){D.call(this);this.type="TorusBufferGeometry";this...
function cf (line 3968) | function cf(a,b,c,d,e){for(var f,g=0,h=b,l=c-d;h<c;h+=d)g+=(a[l]-a[h])*(...
function Wc (line 3968) | function Wc(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!vb(a...
function Xc (line 3969) | function Xc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l...
function Pg (line 3973) | function Pg(a,b){return a.x-b.x}
function Qg (line 3973) | function Qg(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next...
function ce (line 3974) | function ce(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&167119...
function Rg (line 3974) | function Rg(a){var b=a,c=a;do b.x<c.x&&(c=b),b=b.next;while(b!==a);retur...
function zd (line 3974) | function zd(a,b,c,d,e,f,g,h){return 0<=(e-g)*(b-h)-(a-g)*(f-h)&&0<=(a-g)...
function oa (line 3975) | function oa(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}
function vb (line 3975) | function vb(a,b){return a.x===b.x&&a.y===b.y}
function ef (line 3975) | function ef(a,b,c,d){return vb(a,b)&&vb(c,d)||vb(a,d)&&vb(c,b)?!0:0<oa(a...
function Yc (line 3975) | function Yc(a,b){return 0>oa(a.prev,a,a.next)?0<=oa(a,b,a.next)&&0<=oa(a...
function ff (line 3975) | function ff(a,b){var c=new de(a.i,a.x,a.y),d=new de(b.i,b.x,b.y),e=a.nex...
function df (line 3976) | function df(a,b,c,d){a=new de(a,b,c);d?(a.next=d.next,a.prev=d,d.next.pr...
function Vc (line 3976) | function Vc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.n...
function de (line 3976) | function de(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this...
function gf (line 3976) | function gf(a){var b=a.length;2<b&&a[b-1].equals(a[0])&&a.pop()}
function hf (line 3976) | function hf(a,b){for(var c=0;c<b.length;c++)a.push(b[c].x),
function wb (line 3977) | function wb(a,b){P.call(this);this.type="ExtrudeGeometry";this.parameter...
function Ta (line 3977) | function Ta(a,b){function c(a){function c(a,b,c){b||console.error("THREE...
function jf (line 3985) | function jf(a,b,c){c.shapes=[];if(Array.isArray(a))for(var d=0,e=a.lengt...
function Zc (line 3985) | function Zc(a,b){P.call(this);this.type="TextGeometry";this.parameters={...
function gc (line 3986) | function gc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.er...
function $c (line 3986) | function $c(a,b,c,d,e,f,g){P.call(this);this.type="SphereGeometry";this....
function xb (line 3987) | function xb(a,b,c,d,e,f,g){D.call(this);this.type="SphereBufferGeometry"...
function ad (line 3989) | function ad(a,b,c,d,e,f){P.call(this);this.type="RingGeometry";this.para...
function hc (line 3989) | function hc(a,b,c,d,e,f){D.call(this);this.type="RingBufferGeometry";thi...
function bd (line 3991) | function bd(a,b,c,d){P.call(this);this.type="LatheGeometry";this.paramet...
function ic (line 3991) | function ic(a,b,c,d){D.call(this);this.type="LatheBufferGeometry";this.p...
function yb (line 3993) | function yb(a,b){P.call(this);this.type="ShapeGeometry";"object"===typeo...
function zb (line 3993) | function zb(a,b){function c(a){var c,h=e.length/3;a=a.extractPoints(b);
function kf (line 3995) | function kf(a,b){b.shapes=[];if(Array.isArray(a))for(var c=0,d=a.length;...
function jc (line 3995) | function jc(a,b){D.call(this);this.type="EdgesGeometry";this.parameters=...
function Ab (line 3997) | function Ab(a,b,c,d,e,f,g,h){P.call(this);this.type="CylinderGeometry";t...
function ab (line 3997) | function ab(a,b,c,d,e,f,g,h){function l(c){var e,f=new B,l=new p,v=0,u=!...
function cd (line 4000) | function cd(a,b,c,d,e,f,g){Ab.call(this,0,a,b,c,d,e,f,g);this.type="Cone...
function dd (line 4000) | function dd(a,b,c,d,e,f,g){ab.call(this,0,a,b,c,d,e,f,g);this.type=
function ed (line 4001) | function ed(a,b,c,d){P.call(this);this.type="CircleGeometry";this.parame...
function kc (line 4001) | function kc(a,b,c,d){D.call(this);this.type="CircleBufferGeometry";this....
function Bb (line 4002) | function Bb(a){I.call(this);this.type="ShadowMaterial";this.color=
function lc (line 4003) | function lc(a){Fa.call(this,a);this.type="RawShaderMaterial"}
function Ua (line 4003) | function Ua(a){I.call(this);this.defines={STANDARD:""};this.type="MeshSt...
function Cb (line 4004) | function Cb(a){Ua.call(this);this.defines={PHYSICAL:""};this.type="MeshP...
function Ka (line 4005) | function Ka(a){I.call(this);this.type="MeshPhongMaterial";this.color=new...
function Db (line 4006) | function Db(a){Ka.call(this);this.defines={TOON:""};this.type="MeshToonM...
function Eb (line 4006) | function Eb(a){I.call(this);this.type="MeshNormalMaterial";this.bumpMap=...
function Fb (line 4007) | function Fb(a){I.call(this);this.type="MeshLambertMaterial";this.color=n...
function Gb (line 4008) | function Gb(a){T.call(this);this.type="LineDashedMaterial";this.scale=1;...
function ee (line 4008) | function ee(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;...
function La (line 4009) | function La(a){this.manager=void 0!==a?a:ya}
function lf (line 4009) | function lf(a){this.manager=void 0!==a?a:ya;this._parser=null}
function fe (line 4009) | function fe(a){this.manager=
function fd (line 4010) | function fd(a){this.manager=void 0!==a?a:ya}
function ge (line 4010) | function ge(a){this.manager=void 0!==a?a:ya}
function Ad (line 4010) | function Ad(a){this.manager=void 0!==a?a:ya}
function E (line 4010) | function E(){this.type="Curve";this.arcLengthDivisions=200}
function Da (line 4010) | function Da(a,b,c,d,e,f,g,h){E.call(this);this.type="EllipseCurve";this....
function mc (line 4010) | function mc(a,b,c,d,e,f){Da.call(this,a,b,c,c,d,e,f);this.type=
function he (line 4011) | function he(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h...
function pa (line 4011) | function pa(a,b,c,d){E.call(this);this.type="CatmullRomCurve3";this.poin...
function mf (line 4012) | function mf(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+...
function gd (line 4012) | function gd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}
function hd (line 4012) | function hd(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*...
function Ma (line 4012) | function Ma(a,b,c,d){E.call(this);this.type="CubicBezierCurve";this.v0=a...
function Va (line 4012) | function Va(a,b,c,d){E.call(this);this.type="CubicBezierCurve3";this.v0=...
function ia (line 4013) | function ia(a,b){E.call(this);this.type="LineCurve";this.v1=a||new B;thi...
function Na (line 4013) | function Na(a,b){E.call(this);this.type="LineCurve3";this.v1=a||new p;th...
function Oa (line 4013) | function Oa(a,b,c){E.call(this);this.type="QuadraticBezierCurve";this.v0...
function Wa (line 4013) | function Wa(a,b,c){E.call(this);this.type="QuadraticBezierCurve3";this.v...
function Pa (line 4013) | function Pa(a){E.call(this);this.type="SplineCurve";this.points=a||[]}
function bb (line 4013) | function bb(){E.call(this);
function Qa (line 4014) | function Qa(a){bb.call(this);this.type="Path";this.currentPoint=new B;a&...
function jb (line 4014) | function jb(a){Qa.call(this,a);this.uuid=J.generateUUID();this.type="Sha...
function X (line 4014) | function X(a,b){H.call(this);this.type="Light";this.color=new G(a);this....
function Bd (line 4014) | function Bd(a,b,c){X.call(this,a,c);this.type="HemisphereLight";this.cas...
function Hb (line 4015) | function Hb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new ...
function Cd (line 4015) | function Cd(){Hb.call(this,new Z(50,1,.5,500))}
function Dd (line 4015) | function Dd(a,b,c,d,e,f){X.call(this,a,b);this.type="SpotLight";this.pos...
function Ed (line 4016) | function Ed(a,b,c,d){X.call(this,a,b);this.type="PointLight";Object.defi...
function Fd (line 4016) | function Fd(){Hb.call(this,new Mb(-5,5,5,-5,.5,500))}
function Gd (line 4016) | function Gd(a,b){X.call(this,a,b);this.type="DirectionalLight";this.posi...
function Hd (line 4017) | function Hd(a,b){X.call(this,a,b);this.type="AmbientLight";this.castShad...
function Id (line 4017) | function Id(a,b,c,d){X.call(this,a,b);this.type="RectAreaLight";this.wid...
function Jd (line 4017) | function Jd(a,b,c,d){ja.call(this,a,b,c,d)}
function Kd (line 4017) | function Kd(a,b,c){ja.call(this,a,b,c)}
function Ea (line 4017) | function Ea(a,b,c,d){this.parameterPositions=a;this._cachedIndex=0;this....
function Ld (line 4017) | function Ld(a,
function id (line 4018) | function id(a,b,c,d){ja.call(this,a,b,c,d)}
function Md (line 4018) | function Md(a,b,c,d){ja.call(this,a,b,c,d)}
function nc (line 4018) | function nc(a,b,c,d){ja.call(this,a,b,c,d)}
function Nd (line 4018) | function Nd(a,b,c,d){Ea.call(this,a,b,c,d);this._offsetNext=this._weight...
function jd (line 4018) | function jd(a,b,c,d){Ea.call(this,a,b,c,d)}
function Od (line 4018) | function Od(a,b,c,d){Ea.call(this,a,b,c,d)}
function ja (line 4018) | function ja(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: tra...
function oc (line 4019) | function oc(a,b,c,d){ja.call(this,a,b,c,d)}
function Ga (line 4019) | function Ga(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:...
function Pd (line 4019) | function Pd(a){this.manager=void 0!==a?a:ya;this.textures={}}
function ie (line 4019) | function ie(a){this.manager=void 0!==a?a:
function pc (line 4020) | function pc(){}
function je (line 4020) | function je(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: sh...
function nf (line 4020) | function nf(a){this.manager=void 0!==a?a:ya;this.texturePath=""}
function ke (line 4020) | function ke(a){"undefined"===typeof createImageBitmap&&console.warn("THR...
function le (line 4021) | function le(){this.type="ShapePath";this.color=new G;this.subPaths=[];th...
function me (line 4021) | function me(a){this.type="Font";this.data=a}
function of (line 4021) | function of(a){this.manager=void 0!==a?a:ya}
function ne (line 4021) | function ne(a){this.manager=void 0!==a?a:ya}
function pf (line 4021) | function pf(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;th...
function kd (line 4021) | function kd(a,
function oe (line 4024) | function oe(){H.call(this);this.type="AudioListener";this.context=pe.get...
function qc (line 4024) | function qc(a){H.call(this);this.type="Audio";this.context=a.context;thi...
function qe (line 4025) | function qe(a){qc.call(this,a);this.panner=this.context.createPanner();t...
function re (line 4025) | function re(a,b){this.analyser=a.context.createAnalyser();this.analyser....
function se (line 4025) | function se(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch...
function qf (line 4026) | function qf(a,b,c){c=c||ra.parseTrackName(b);this._targetGroup=a;this._b...
function ra (line 4026) | function ra(a,b,c){this.path=b;this.parsedPath=c||ra.parseTrackName(b);t...
function rf (line 4026) | function rf(){this.uuid=J.generateUUID();this._objects=Array.prototype.s...
function sf (line 4027) | function sf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=...
function te (line 4029) | function te(a){this._root=a;this._initMemoryManager();this.time=this._ac...
function Qd (line 4029) | function Qd(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type...
function ue (line 4029) | function ue(){D.call(this);this.type="InstancedBufferGeometry";this.maxI...
function ve (line 4029) | function ve(a,b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.norm...
function rc (line 4029) | function rc(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/
function we (line 4030) | function we(a,b,c){rc.call(this,a,b);this.meshPerAttribute=c||1}
function xe (line 4030) | function xe(a,b,c){L.call(this,a,b);this.meshPerAttribute=c||1}
function tf (line 4030) | function tf(a,b,c,d){this.ray=new sb(a,b);this.near=c||0;this.far=d||Inf...
function uf (line 4031) | function uf(a,b){return a.distance-b.distance}
function ye (line 4031) | function ye(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.chi...
function vf (line 4031) | function vf(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldT...
function wf (line 4031) | function wf(a,b,c){this.radius=void 0!==a?a:1;this.phi=void 0!==b?b:0;th...
function xf (line 4031) | function xf(a,b,c){this.radius=void 0!==a?a:1;this.theta=void 0!==b?b:0;...
function ze (line 4031) | function ze(a,
function ld (line 4032) | function ld(a){H.call(this);this.material=a;this.render=function(){}}
function md (line 4032) | function md(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c...
function sc (line 4033) | function sc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld(...
function yf (line 4033) | function yf(a){var b=[];a&&a.isBone&&
function tc (line 4034) | function tc(a){for(var b=yf(a),c=new D,d=[],e=[],f=new G(0,0,1),g=new G(...
function uc (line 4035) | function uc(a,b,c){this.light=a;this.light.updateMatrixWorld();this.colo...
function vc (line 4035) | function vc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld(...
function wc (line 4036) | function wc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorl...
function nd (line 4036) | function nd(a,b,c,d){a=a||10;b=b||10;c=new G(void 0!==c?c:4473924);d=new...
function Rd (line 4037) | function Rd(a,b,c,d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new G(void 0!=...
function od (line 4038) | function od(a,b,c,d){this.object=
function xc (line 4039) | function xc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorl...
function pd (line 4040) | function pd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,...
function Ib (line 4042) | function Ib(a,b){this.object=a;void 0===b&&(b=16776960);a=new Uint16Arra...
function qd (line 4043) | function qd(a,b){this.type="Box3Helper";this.box=a;a=void 0!==b?b:167769...
function rd (line 4043) | function rd(a,b,c){this.type="PlaneHelper";this.plane=a;this.size=void 0...
function Jb (line 4044) | function Jb(a,b,c,d,e,f){H.call(this);void 0===d&&(d=16776960);void 0===...
function sd (line 4045) | function sd(a){a=a||1;var b=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new ...
function zf (line 4046) | function zf(a){console.warn("THREE.ClosedSplineCurve3 has been deprecate...
function Af (line 4046) | function Af(a){console.warn("THREE.SplineCurve3 has been deprecated. Use...
function Be (line 4046) | function Be(a){console.warn("THREE.Spline has been removed. Use THREE.Ca...
function b (line 4112) | function b(a){if(a instanceof HTMLCanvasElement)var b=a;else{b=document....
function a (line 4132) | function a(a){var f=a.geometry;if(void 0!==f)if(f.isGeometry)for(f=f.ver...
function a (line 4135) | function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f)...
function a (line 4218) | function a(a,c,d){0>d&&(d+=1);1<d&&--d;return d<1/6?a+6*(c-a)*d:.5>d?c:d...
function b (line 4219) | function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Al...
function a (line 4223) | function a(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.05213...
function a (line 4223) | function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}
function b (line 4250) | function b(b,c){void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a));return c.uuid}
function c (line 4250) | function c(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push...
function b (line 4262) | function b(a,b,d,e){var f=void 0!==
function a (line 4276) | function a(a,b,c){return c?a|1<<b:a&~(1<<b)}
function b (line 4276) | function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void...
function c (line 4277) | function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void...
function d (line 4277) | function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])retur...
function b (line 4316) | function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push...
function a (line 4346) | function a(a,b,c,d,e,f,g){ta.getBarycoord(a,b,c,d,u);e.multiplyScalar(u....
function b (line 4346) | function b(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,...
function c (line 4347) | function c(c,d,e,f,m,k,n,p,v){g.fromBufferAttribute(m,n);h.fromBufferAtt...
function a (line 4363) | function a(a,b,c,d,h,l){e.subVectors(a,c).addScalar(.5).multiply(d);void...
function f (line 4380) | function f(a,c){var f=b.distanceSqToPoint(a);f<k&&(b.closestPointToPoint...
function e (line 4409) | function e(e){l.load(a[e],function(a){a=f._parser(a,!0);g[e]={width:a.wi...
function e (line 4412) | function e(){l.removeEventListener("load",
function f (line 4413) | function f(b){l.removeEventListener("load",e,!1);l.removeEventListener("...
function e (line 4414) | function e(c){g.load(a[c],function(a){f.images[c]=a;h++;6===h&&(f.needsU...
function b (line 4474) | function b(a){void 0===c[a]&&console.warn("THREE.MaterialLoader: Undefin...
function h (line 4484) | function h(a,b,d,e,h){a=f+a;var k=pc.Handlers.get(a);null!==k?a=k.load(a...
function c (line 4509) | function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manage...
function c (line 4510) | function c(a,b){if("number"===typeof a)return a;console.warn("THREE.Obje...
function d (line 4512) | function d(a){void 0===b[a]&&console.warn("THREE.ObjectLoader: Undefined...
function e (line 4513) | function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.l...
function c (line 4522) | function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new jb;f...
function d (line 4522) | function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],...
method total (line 4572) | get total(){return a._actions.length}
method inUse (line 4572) | get inUse(){return a._nActiveActions}
method total (line 4572) | get total(){return a._bindings.length}
method inUse (line 4572) | get inUse(){return a._nActiveBindings}
method total (line 4572) | get total(){return a._controlInterpolants.length}
method inUse (line 4572) | get inUse(){return a._nActiveControlInterpolants}
function a (line 4605) | function a(a,
function material (line 4707) | function material (options) {
FILE: src/Animation/AnimationManager.js
function AnimationManager (line 5) | function AnimationManager(map) {
FILE: src/Camera/CameraSync.js
function CameraSync (line 5) | function CameraSync(map, camera, world) {
FILE: src/Threebox.js
function Threebox (line 15) | function Threebox(map, glContext, options){
FILE: src/Utils/Utils.js
function convert (line 37) | function convert(degrees){
function convert (line 63) | function convert(radians){
method normalizeVertices (line 142) | normalizeVertices(vertices) {
method flattenVectors (line 163) | flattenVectors(vectors) {
FILE: src/objects/Object3D.js
function Object3D (line 4) | function Object3D(options) {
FILE: src/objects/line.js
function line (line 5) | function line(obj){
FILE: src/objects/loadObj.js
function loadObj (line 6) | function loadObj(options, cb){
FILE: src/objects/loaders/MTLLoader.js
constant THREE (line 7) | const THREE = require('../../three.js');
function resolveURL (line 355) | function resolveURL( baseUrl, url ) {
function setMapForType (line 367) | function setMapForType( mapType, value ) {
FILE: src/objects/loaders/OBJLoader.js
constant THREE (line 4) | const THREE = require('../../three.js');
FILE: src/objects/objects.js
function Objects (line 7) | function Objects(){
FILE: src/objects/sphere.js
function Sphere (line 5) | function Sphere(obj){
FILE: src/objects/tube.js
function tube (line 6) | function tube(obj, world){
FILE: src/three.js
function za (line 2) | function za(){}
function B (line 2) | function B(a,b){this.x=a||0;this.y=b||0}
function R (line 2) | function R(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments...
function ca (line 2) | function ca(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void...
function p (line 2) | function p(a,
function la (line 3) | function la(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&cons...
function ea (line 3) | function ea(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,"id",{value:...
function W (line 4) | function W(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==...
function kb (line 4) | function kb(a,
function Lb (line 6) | function Lb(a,b,c){kb.call(this,a,b,c);this.activeMipMapLevel=this.activ...
function lb (line 6) | function lb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n...
function Xa (line 6) | function Xa(a,b){this.min=void 0!==a?a:new p(Infinity,Infinity,Infinity)...
function Ha (line 6) | function Ha(a,b){this.center=void 0!==
function Ia (line 7) | function Ia(a,b){this.normal=void 0!==a?a:new p(1,0,0);this.constant=voi...
function td (line 7) | function td(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ia,void 0!==b?b:n...
function G (line 7) | function G(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(...
function Vd (line 7) | function Vd(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a)...
function Gf (line 8) | function Gf(a){function b(b,c){var d=b.array,e=b.dynamic?a.DYNAMIC_DRAW:...
function mb (line 11) | function mb(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=...
function Wd (line 11) | function Wd(){this.mask=1}
function H (line 11) | function H(){Object.defineProperty(this,"id",{value:Hf++});this.uuid=J.g...
function Ra (line 12) | function Ra(){H.call(this);this.type="Camera";this.matrixWorldInverse=
function Mb (line 13) | function Mb(a,b,c,d,e,f){Ra.call(this);this.type="OrthographicCamera";th...
function Ya (line 13) | function Ya(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isV...
function P (line 13) | function P(){Object.defineProperty(this,
function L (line 14) | function L(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferA...
function yc (line 15) | function yc(a,b,c){L.call(this,new Int8Array(a),b,c)}
function zc (line 15) | function zc(a,b,c){L.call(this,new Uint8Array(a),b,c)}
function Ac (line 15) | function Ac(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}
function Bc (line 15) | function Bc(a,b,c){L.call(this,new Int16Array(a),b,c)}
function nb (line 15) | function nb(a,b,c){L.call(this,new Uint16Array(a),b,c)}
function Cc (line 15) | function Cc(a,b,c){L.call(this,new Int32Array(a),b,c)}
function ob (line 15) | function ob(a,
function z (line 16) | function z(a,b,c){L.call(this,new Float32Array(a),b,c)}
function Dc (line 16) | function Dc(a,b,c){L.call(this,new Float64Array(a),b,c)}
function Ge (line 16) | function Ge(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[...
function He (line 16) | function He(a){if(0===a.length)return-Infinity;
function D (line 17) | function D(){Object.defineProperty(this,"id",{value:Jf+=2});this.uuid=J....
function Nb (line 17) | function Nb(a,b,c,d,e,f){P.call(this);this.type="BoxGeometry";this.param...
function pb (line 18) | function pb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,Q,M,Ob){var r=f/Q,u=...
function Fc (line 20) | function Fc(a,b,c,d){P.call(this);this.type="PlaneGeometry";this.paramet...
function rb (line 20) | function rb(a,b,c,d){D.call(this);this.type="PlaneBufferGeometry";this.p...
function I (line 21) | function I(){Object.defineProperty(this,"id",{value:Kf++});this.uuid=J.g...
function ua (line 23) | function ua(a){I.call(this);this.type="MeshBasicMaterial";this.color=new...
function Fa (line 24) | function Fa(a){I.call(this);this.type="ShaderMaterial";this.defines={};t...
function sb (line 25) | function sb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==...
function Qb (line 25) | function Qb(a,b){this.start=void 0!==a?a:new p;this.end=void 0!==b?b:new p}
function ta (line 26) | function ta(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;t...
function va (line 26) | function va(a,b){H.call(this);this.type="Mesh";this.geometry=void 0!==a?...
function Lf (line 26) | function Lf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a....
function Mf (line 28) | function Mf(a,b,c){var d;this.setMode=function(a){d=a};this.render=funct...
function Nf (line 29) | function Nf(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisi...
function Of (line 32) | function Of(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c....
function Pf (line 34) | function Pf(a){var b={};return{get:function(c){if(void 0!==b[c])return b...
function Qf (line 36) | function Qf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index...
function Rf (line 38) | function Rf(a,b,c){var d,e,f;this.setMode=function(a){d=a};this.setIndex...
function Sf (line 39) | function Sf(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};retu...
function Tf (line 40) | function Tf(a,b){return Math.abs(b[1])-Math.abs(a[1])}
function Uf (line 40) | function Uf(a){var b={},c=new Float32Array(8);return{update:function(d,e...
function Vf (line 41) | function Vf(a,b){var c={};return{update:function(d){var e=b.render.frame...
function Za (line 42) | function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];ea.call(this,a,void 0...
function Rb (line 42) | function Rb(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ie[e];vo...
function da (line 42) | function da(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;...
function qa (line 42) | function qa(a,b){for(var c=
function Je (line 43) | function Je(a,b){var c=Ke[b];void 0===c&&(c=new Int32Array(b),Ke[b]=c);f...
function Wf (line 43) | function Wf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[...
function Xf (line 43) | function Xf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[...
function Yf (line 43) | function Yf(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!=...
function Zf (line 43) | function Zf(a,
function $f (line 44) | function $f(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!=...
function ag (line 45) | function ag(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function bg (line 45) | function bg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function cg (line 45) | function cg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.un...
function dg (line 46) | function dg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a....
function eg (line 46) | function eg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a....
function Qe (line 46) | function Qe(a,b){var c=this.cache;da(c,b)||(a.uniform2iv(this.addr,b),qa...
function Re (line 46) | function Re(a,b){var c=this.cache;da(c,b)||(a.uniform3iv(this.addr,b),qa...
function Se (line 46) | function Se(a,b){var c=this.cache;da(c,b)||(a.uniform4iv(this.addr,b),qa(c,
function fg (line 47) | function fg(a){switch(a){case 5126:return Wf;case 35664:return Yf;case 3...
function gg (line 47) | function gg(a,b){var c=this.cache;da(c,b)||(a.uniform1fv(this.addr,b),qa...
function hg (line 47) | function hg(a,b){var c=this.cache;da(c,b)||(a.uniform1iv(this.addr,
function ig (line 48) | function ig(a,b){var c=this.cache;b=Rb(b,this.size,2);da(c,b)||(a.unifor...
function jg (line 48) | function jg(a,b){var c=this.cache;b=Rb(b,this.size,3);da(c,b)||(a.unifor...
function kg (line 48) | function kg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.unifor...
function lg (line 48) | function lg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.unifor...
function mg (line 48) | function mg(a,b){var c=this.cache;b=
function ng (line 49) | function ng(a,b){var c=this.cache;b=Rb(b,this.size,16);da(c,b)||(a.unifo...
function og (line 49) | function og(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(...
function pg (line 49) | function pg(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(...
function qg (line 50) | function qg(a){switch(a){case 5126:return gg;case 35664:return ig;case 3...
function rg (line 50) | function rg(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=fg(...
function Te (line 50) | function Te(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;
function Ue (line 51) | function Ue(a){this.id=a;this.seq=[];this.map={}}
function eb (line 51) | function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgra...
function sg (line 52) | function sg(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=b+1+": "+...
function Ve (line 52) | function Ve(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compile...
function We (line 53) | function We(a){switch(a){case 3E3:return["Linear","( value )"];case 3001...
function Yd (line 53) | function Yd(a,b){b=We(b);return"vec4 "+a+"( vec4 value ) { return "+b[0]...
function tg (line 53) | function tg(a,
function ug (line 54) | function ug(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";b...
function vg (line 54) | function vg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpM...
function wg (line 55) | function wg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define...
function Gc (line 55) | function Gc(a){return""!==a}
function Xe (line 55) | function Xe(a,b){return a.replace(/NUM_DIR_LIGHTS/g,
function Ye (line 56) | function Ye(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPl...
function Zd (line 56) | function Zd(a){return a.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,functi...
function Ze (line 57) | function Ze(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i =...
function xg (line 57) | function xg(a,b,c,d,e,f){var g=a.context,h=d.defines,l=e.vertexShader,m=...
function zg (line 71) | function zg(a,b,c){function d(a,b){if(a)a.isTexture?c=a.encoding:a.isWeb...
function Ag (line 78) | function Ag(){var a=new WeakMap;return{get:function(b){var c=a.get(b);vo...
function Bg (line 78) | function Bg(a,b){return a.renderOrder!==b.renderOrder?
function Cg (line 79) | function Cg(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.re...
function Dg (line 79) | function Dg(){var a=[],b=0,c=[],d=[];return{opaque:c,transparent:d,init:...
function Eg (line 80) | function Eg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];v...
function Fg (line 80) | function Fg(){var a={};return{get:function(b){if(void 0!==a[b.id])return...
function Gg (line 82) | function Gg(){var a=new Fg,b={id:Hg++,hash:"",ambient:[0,0,0],directiona...
function Ig (line 87) | function Ig(){var a=new Gg,b=[],c=[],d=[];return{init:function(){b.lengt...
function Jg (line 88) | function Jg(){var a={};return{get:function(b,c){b=b.id+","+c.id;c=a[b];v...
function fb (line 88) | function fb(a){I.call(this);this.type="MeshDepthMaterial";this.depthPack...
function gb (line 89) | function gb(a){I.call(this);this.type="MeshDistanceMaterial";this.refere...
function $e (line 89) | function $e(a,b,c){function d(b,c,d,e,f,g){var h=
function Sb (line 96) | function Sb(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.need...
function Kg (line 96) | function Kg(a,
function Lg (line 105) | function Lg(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createT...
function Mg (line 117) | function Mg(a,b,c,d,
function af (line 139) | function af(a,b){return{convert:function(c){if(1E3===c)return a.REPEAT;i...
function Ub (line 144) | function Ub(){H.call(this);this.type="Group"}
function Z (line 144) | function Z(a,b,c,d){Ra.call(this);this.type="PerspectiveCamera";this.fov...
function Hc (line 144) | function Hc(a){Z.call(this);
function bf (line 145) | function bf(a){function b(){return null!==e&&!0===e.isPresenting}functio...
function Ng (line 152) | function Ng(a){function b(){return null!==h&&null!==l}function c(a){var ...
function ae (line 156) | function ae(a){function b(){ma=new Pf(F);ma.get("WEBGL_depth_texture");
function Vb (line 203) | function Vb(a,b){this.name="";this.color=new G(a);this.density=void 0!==...
function Wb (line 203) | function Wb(a,b,c){this.name="";this.color=new G(a);this.near=void 0!==b...
function vd (line 203) | function vd(){H.call(this);this.type="Scene";this.overrideMaterial=this....
function ib (line 203) | function ib(a){I.call(this);this.type="SpriteMaterial";this.color=new G(...
function Ic (line 204) | function Ic(a){H.call(this);this.type="Sprite";this.material=void 0!==a?...
function Jc (line 204) | function Jc(){H.call(this);this.type="LOD";Object.defineProperties(this,...
function Kc (line 204) | function Kc(a,b){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Flo...
function wd (line 205) | function wd(){H.call(this);this.type="Bone"}
function xd (line 205) | function xd(a,b){va.call(this,a,b);this.type="SkinnedMesh";this.bindMode...
function T (line 205) | function T(a){I.call(this);this.type="LineBasicMaterial";this.color=new ...
function wa (line 206) | function wa(a,b,c){if(1===c)return console.warn("THREE.Line: parameter T...
function Y (line 206) | function Y(a,b){wa.call(this,a,b);this.type="LineSegments"}
function yd (line 206) | function yd(a,b){wa.call(this,a,b);this.type="LineLoop"}
function Ja (line 206) | function Ja(a){I.call(this);this.type="PointsMaterial";this.color=new G(...
function Xb (line 207) | function Xb(a,b){H.call(this);this.type="Points";this.geometry=void 0!==...
function be (line 207) | function be(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.gene...
function Yb (line 207) | function Yb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n...
function Lc (line 207) | function Lc(a,
function Zb (line 208) | function Zb(a){D.call(this);this.type="WireframeGeometry";var b=[],c,d,e...
function Mc (line 211) | function Mc(a,b,c){P.call(this);this.type="ParametricGeometry";this.para...
function $b (line 211) | function $b(a,b,c){D.call(this);this.type="ParametricBufferGeometry";thi...
function Nc (line 213) | function Nc(a,b,c,d){P.call(this);this.type="PolyhedronGeometry";this.pa...
function xa (line 213) | function xa(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b...
function Oc (line 216) | function Oc(a,
function ac (line 217) | function ac(a,b){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3...
function Pc (line 217) | function Pc(a,b){P.call(this);this.type="OctahedronGeometry";this.parame...
function ub (line 217) | function ub(a,b){xa.call(this,[1,0,0,
function Qc (line 218) | function Qc(a,b){P.call(this);this.type="IcosahedronGeometry";this.param...
function bc (line 218) | function bc(a,b){var c=(1+Math.sqrt(5))/2;xa.call(this,[-1,c,0,1,c,0,-1,...
function Rc (line 219) | function Rc(a,b){P.call(this);this.type="DodecahedronGeometry";this.para...
function cc (line 219) | function cc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;xa.call(this,[-1,-1,-1,-...
function Sc (line 220) | function Sc(a,b,c,d,e,f){P.call(this);this.type="TubeGeometry";this.para...
function dc (line 221) | function dc(a,b,c,d,e){function f(e){v=a.getPointAt(e/b,v);var f=g.norma...
function Tc (line 223) | function Tc(a,b,c,d,e,f,g){P.call(this);this.type="TorusKnotGeometry";th...
function ec (line 224) | function ec(a,b,c,d,e,f){function g(a,b,c,d,e){var f=Math.sin(a);b=c/b*a...
function Uc (line 226) | function Uc(a,b,c,d,e){P.call(this);this.type="TorusGeometry";this.param...
function fc (line 226) | function fc(a,b,c,d,e){D.call(this);this.type="TorusBufferGeometry";this...
function cf (line 228) | function cf(a,b,c,d,e){for(var f,g=0,h=b,l=c-d;h<c;h+=d)g+=(a[l]-a[h])*(...
function Wc (line 228) | function Wc(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!vb(a...
function Xc (line 229) | function Xc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l...
function Pg (line 233) | function Pg(a,b){return a.x-b.x}
function Qg (line 233) | function Qg(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next...
function ce (line 234) | function ce(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&167119...
function Rg (line 234) | function Rg(a){var b=a,c=a;do b.x<c.x&&(c=b),b=b.next;while(b!==a);retur...
function zd (line 234) | function zd(a,b,c,d,e,f,g,h){return 0<=(e-g)*(b-h)-(a-g)*(f-h)&&0<=(a-g)...
function oa (line 235) | function oa(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}
function vb (line 235) | function vb(a,b){return a.x===b.x&&a.y===b.y}
function ef (line 235) | function ef(a,b,c,d){return vb(a,b)&&vb(c,d)||vb(a,d)&&vb(c,b)?!0:0<oa(a...
function Yc (line 235) | function Yc(a,b){return 0>oa(a.prev,a,a.next)?0<=oa(a,b,a.next)&&0<=oa(a...
function ff (line 235) | function ff(a,b){var c=new de(a.i,a.x,a.y),d=new de(b.i,b.x,b.y),e=a.nex...
function df (line 236) | function df(a,b,c,d){a=new de(a,b,c);d?(a.next=d.next,a.prev=d,d.next.pr...
function Vc (line 236) | function Vc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.n...
function de (line 236) | function de(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this...
function gf (line 236) | function gf(a){var b=a.length;2<b&&a[b-1].equals(a[0])&&a.pop()}
function hf (line 236) | function hf(a,b){for(var c=0;c<b.length;c++)a.push(b[c].x),
function wb (line 237) | function wb(a,b){P.call(this);this.type="ExtrudeGeometry";this.parameter...
function Ta (line 237) | function Ta(a,b){function c(a){function c(a,b,c){b||console.error("THREE...
function jf (line 245) | function jf(a,b,c){c.shapes=[];if(Array.isArray(a))for(var d=0,e=a.lengt...
function Zc (line 245) | function Zc(a,b){P.call(this);this.type="TextGeometry";this.parameters={...
function gc (line 246) | function gc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.er...
function $c (line 246) | function $c(a,b,c,d,e,f,g){P.call(this);this.type="SphereGeometry";this....
function xb (line 247) | function xb(a,b,c,d,e,f,g){D.call(this);this.type="SphereBufferGeometry"...
function ad (line 249) | function ad(a,b,c,d,e,f){P.call(this);this.type="RingGeometry";this.para...
function hc (line 249) | function hc(a,b,c,d,e,f){D.call(this);this.type="RingBufferGeometry";thi...
function bd (line 251) | function bd(a,b,c,d){P.call(this);this.type="LatheGeometry";this.paramet...
function ic (line 251) | function ic(a,b,c,d){D.call(this);this.type="LatheBufferGeometry";this.p...
function yb (line 253) | function yb(a,b){P.call(this);this.type="ShapeGeometry";"object"===typeo...
function zb (line 253) | function zb(a,b){function c(a){var c,h=e.length/3;a=a.extractPoints(b);
function kf (line 255) | function kf(a,b){b.shapes=[];if(Array.isArray(a))for(var c=0,d=a.length;...
function jc (line 255) | function jc(a,b){D.call(this);this.type="EdgesGeometry";this.parameters=...
function Ab (line 257) | function Ab(a,b,c,d,e,f,g,h){P.call(this);this.type="CylinderGeometry";t...
function ab (line 257) | function ab(a,b,c,d,e,f,g,h){function l(c){var e,f=new B,l=new p,v=0,u=!...
function cd (line 260) | function cd(a,b,c,d,e,f,g){Ab.call(this,0,a,b,c,d,e,f,g);this.type="Cone...
function dd (line 260) | function dd(a,b,c,d,e,f,g){ab.call(this,0,a,b,c,d,e,f,g);this.type=
function ed (line 261) | function ed(a,b,c,d){P.call(this);this.type="CircleGeometry";this.parame...
function kc (line 261) | function kc(a,b,c,d){D.call(this);this.type="CircleBufferGeometry";this....
function Bb (line 262) | function Bb(a){I.call(this);this.type="ShadowMaterial";this.color=
function lc (line 263) | function lc(a){Fa.call(this,a);this.type="RawShaderMaterial"}
function Ua (line 263) | function Ua(a){I.call(this);this.defines={STANDARD:""};this.type="MeshSt...
function Cb (line 264) | function Cb(a){Ua.call(this);this.defines={PHYSICAL:""};this.type="MeshP...
function Ka (line 265) | function Ka(a){I.call(this);this.type="MeshPhongMaterial";this.color=new...
function Db (line 266) | function Db(a){Ka.call(this);this.defines={TOON:""};this.type="MeshToonM...
function Eb (line 266) | function Eb(a){I.call(this);this.type="MeshNormalMaterial";this.bumpMap=...
function Fb (line 267) | function Fb(a){I.call(this);this.type="MeshLambertMaterial";this.color=n...
function Gb (line 268) | function Gb(a){T.call(this);this.type="LineDashedMaterial";this.scale=1;...
function ee (line 268) | function ee(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;...
function La (line 269) | function La(a){this.manager=void 0!==a?a:ya}
function lf (line 269) | function lf(a){this.manager=void 0!==a?a:ya;this._parser=null}
function fe (line 269) | function fe(a){this.manager=
function fd (line 270) | function fd(a){this.manager=void 0!==a?a:ya}
function ge (line 270) | function ge(a){this.manager=void 0!==a?a:ya}
function Ad (line 270) | function Ad(a){this.manager=void 0!==a?a:ya}
function E (line 270) | function E(){this.type="Curve";this.arcLengthDivisions=200}
function Da (line 270) | function Da(a,b,c,d,e,f,g,h){E.call(this);this.type="EllipseCurve";this....
function mc (line 270) | function mc(a,b,c,d,e,f){Da.call(this,a,b,c,c,d,e,f);this.type=
function he (line 271) | function he(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h...
function pa (line 271) | function pa(a,b,c,d){E.call(this);this.type="CatmullRomCurve3";this.poin...
function mf (line 272) | function mf(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+...
function gd (line 272) | function gd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}
function hd (line 272) | function hd(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*...
function Ma (line 272) | function Ma(a,b,c,d){E.call(this);this.type="CubicBezierCurve";this.v0=a...
function Va (line 272) | function Va(a,b,c,d){E.call(this);this.type="CubicBezierCurve3";this.v0=...
function ia (line 273) | function ia(a,b){E.call(this);this.type="LineCurve";this.v1=a||new B;thi...
function Na (line 273) | function Na(a,b){E.call(this);this.type="LineCurve3";this.v1=a||new p;th...
function Oa (line 273) | function Oa(a,b,c){E.call(this);this.type="QuadraticBezierCurve";this.v0...
function Wa (line 273) | function Wa(a,b,c){E.call(this);this.type="QuadraticBezierCurve3";this.v...
function Pa (line 273) | function Pa(a){E.call(this);this.type="SplineCurve";this.points=a||[]}
function bb (line 273) | function bb(){E.call(this);
function Qa (line 274) | function Qa(a){bb.call(this);this.type="Path";this.currentPoint=new B;a&...
function jb (line 274) | function jb(a){Qa.call(this,a);this.uuid=J.generateUUID();this.type="Sha...
function X (line 274) | function X(a,b){H.call(this);this.type="Light";this.color=new G(a);this....
function Bd (line 274) | function Bd(a,b,c){X.call(this,a,c);this.type="HemisphereLight";this.cas...
function Hb (line 275) | function Hb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new ...
function Cd (line 275) | function Cd(){Hb.call(this,new Z(50,1,.5,500))}
function Dd (line 275) | function Dd(a,b,c,d,e,f){X.call(this,a,b);this.type="SpotLight";this.pos...
function Ed (line 276) | function Ed(a,b,c,d){X.call(this,a,b);this.type="PointLight";Object.defi...
function Fd (line 276) | function Fd(){Hb.call(this,new Mb(-5,5,5,-5,.5,500))}
function Gd (line 276) | function Gd(a,b){X.call(this,a,b);this.type="DirectionalLight";this.posi...
function Hd (line 277) | function Hd(a,b){X.call(this,a,b);this.type="AmbientLight";this.castShad...
function Id (line 277) | function Id(a,b,c,d){X.call(this,a,b);this.type="RectAreaLight";this.wid...
function Jd (line 277) | function Jd(a,b,c,d){ja.call(this,a,b,c,d)}
function Kd (line 277) | function Kd(a,b,c){ja.call(this,a,b,c)}
function Ea (line 277) | function Ea(a,b,c,d){this.parameterPositions=a;this._cachedIndex=0;this....
function Ld (line 277) | function Ld(a,
function id (line 278) | function id(a,b,c,d){ja.call(this,a,b,c,d)}
function Md (line 278) | function Md(a,b,c,d){ja.call(this,a,b,c,d)}
function nc (line 278) | function nc(a,b,c,d){ja.call(this,a,b,c,d)}
function Nd (line 278) | function Nd(a,b,c,d){Ea.call(this,a,b,c,d);this._offsetNext=this._weight...
function jd (line 278) | function jd(a,b,c,d){Ea.call(this,a,b,c,d)}
function Od (line 278) | function Od(a,b,c,d){Ea.call(this,a,b,c,d)}
function ja (line 278) | function ja(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: tra...
function oc (line 279) | function oc(a,b,c,d){ja.call(this,a,b,c,d)}
function Ga (line 279) | function Ga(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:...
function Pd (line 279) | function Pd(a){this.manager=void 0!==a?a:ya;this.textures={}}
function ie (line 279) | function ie(a){this.manager=void 0!==a?a:
function pc (line 280) | function pc(){}
function je (line 280) | function je(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: sh...
function nf (line 280) | function nf(a){this.manager=void 0!==a?a:ya;this.texturePath=""}
function ke (line 280) | function ke(a){"undefined"===typeof createImageBitmap&&console.warn("THR...
function le (line 281) | function le(){this.type="ShapePath";this.color=new G;this.subPaths=[];th...
function me (line 281) | function me(a){this.type="Font";this.data=a}
function of (line 281) | function of(a){this.manager=void 0!==a?a:ya}
function ne (line 281) | function ne(a){this.manager=void 0!==a?a:ya}
function pf (line 281) | function pf(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;th...
function kd (line 281) | function kd(a,
function oe (line 284) | function oe(){H.call(this);this.type="AudioListener";this.context=pe.get...
function qc (line 284) | function qc(a){H.call(this);this.type="Audio";this.context=a.context;thi...
function qe (line 285) | function qe(a){qc.call(this,a);this.panner=this.context.createPanner();t...
function re (line 285) | function re(a,b){this.analyser=a.context.createAnalyser();this.analyser....
function se (line 285) | function se(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch...
function qf (line 286) | function qf(a,b,c){c=c||ra.parseTrackName(b);this._targetGroup=a;this._b...
function ra (line 286) | function ra(a,b,c){this.path=b;this.parsedPath=c||ra.parseTrackName(b);t...
function rf (line 286) | function rf(){this.uuid=J.generateUUID();this._objects=Array.prototype.s...
function sf (line 287) | function sf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=...
function te (line 289) | function te(a){this._root=a;this._initMemoryManager();this.time=this._ac...
function Qd (line 289) | function Qd(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type...
function ue (line 289) | function ue(){D.call(this);this.type="InstancedBufferGeometry";this.maxI...
function ve (line 289) | function ve(a,b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.norm...
function rc (line 289) | function rc(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/
function we (line 290) | function we(a,b,c){rc.call(this,a,b);this.meshPerAttribute=c||1}
function xe (line 290) | function xe(a,b,c){L.call(this,a,b);this.meshPerAttribute=c||1}
function tf (line 290) | function tf(a,b,c,d){this.ray=new sb(a,b);this.near=c||0;this.far=d||Inf...
function uf (line 291) | function uf(a,b){return a.distance-b.distance}
function ye (line 291) | function ye(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.chi...
function vf (line 291) | function vf(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldT...
function wf (line 291) | function wf(a,b,c){this.radius=void 0!==a?a:1;this.phi=void 0!==b?b:0;th...
function xf (line 291) | function xf(a,b,c){this.radius=void 0!==a?a:1;this.theta=void 0!==b?b:0;...
function ze (line 291) | function ze(a,
function ld (line 292) | function ld(a){H.call(this);this.material=a;this.render=function(){}}
function md (line 292) | function md(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c...
function sc (line 293) | function sc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld(...
function yf (line 293) | function yf(a){var b=[];a&&a.isBone&&
function tc (line 294) | function tc(a){for(var b=yf(a),c=new D,d=[],e=[],f=new G(0,0,1),g=new G(...
function uc (line 295) | function uc(a,b,c){this.light=a;this.light.updateMatrixWorld();this.colo...
function vc (line 295) | function vc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld(...
function wc (line 296) | function wc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorl...
function nd (line 296) | function nd(a,b,c,d){a=a||10;b=b||10;c=new G(void 0!==c?c:4473924);d=new...
function Rd (line 297) | function Rd(a,b,c,d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new G(void 0!=...
function od (line 298) | function od(a,b,c,d){this.object=
function xc (line 299) | function xc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorl...
function pd (line 300) | function pd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,...
function Ib (line 302) | function Ib(a,b){this.object=a;void 0===b&&(b=16776960);a=new Uint16Arra...
function qd (line 303) | function qd(a,b){this.type="Box3Helper";this.box=a;a=void 0!==b?b:167769...
function rd (line 303) | function rd(a,b,c){this.type="PlaneHelper";this.plane=a;this.size=void 0...
function Jb (line 304) | function Jb(a,b,c,d,e,f){H.call(this);void 0===d&&(d=16776960);void 0===...
function sd (line 305) | function sd(a){a=a||1;var b=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new ...
function zf (line 306) | function zf(a){console.warn("THREE.ClosedSplineCurve3 has been deprecate...
function Af (line 306) | function Af(a){console.warn("THREE.SplineCurve3 has been deprecated. Use...
function Be (line 306) | function Be(a){console.warn("THREE.Spline has been removed. Use THREE.Ca...
function b (line 372) | function b(a){if(a instanceof HTMLCanvasElement)var b=a;else{b=document....
function a (line 392) | function a(a){var f=a.geometry;if(void 0!==f)if(f.isGeometry)for(f=f.ver...
function a (line 395) | function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f)...
function a (line 478) | function a(a,c,d){0>d&&(d+=1);1<d&&--d;return d<1/6?a+6*(c-a)*d:.5>d?c:d...
function b (line 479) | function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Al...
function a (line 483) | function a(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.05213...
function a (line 483) | function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}
function b (line 510) | function b(b,c){void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a));return c.uuid}
function c (line 510) | function c(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push...
function b (line 522) | function b(a,b,d,e){var f=void 0!==
function a (line 536) | function a(a,b,c){return c?a|1<<b:a&~(1<<b)}
function b (line 536) | function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void...
function c (line 537) | function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void...
function d (line 537) | function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])retur...
function b (line 576) | function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push...
function a (line 606) | function a(a,b,c,d,e,f,g){ta.getBarycoord(a,b,c,d,u);e.multiplyScalar(u....
function b (line 606) | function b(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,...
function c (line 607) | function c(c,d,e,f,m,k,n,p,v){g.fromBufferAttribute(m,n);h.fromBufferAtt...
function a (line 623) | function a(a,b,c,d,h,l){e.subVectors(a,c).addScalar(.5).multiply(d);void...
function f (line 640) | function f(a,c){var f=b.distanceSqToPoint(a);f<k&&(b.closestPointToPoint...
function e (line 669) | function e(e){l.load(a[e],function(a){a=f._parser(a,!0);g[e]={width:a.wi...
function e (line 672) | function e(){l.removeEventListener("load",
function f (line 673) | function f(b){l.removeEventListener("load",e,!1);l.removeEventListener("...
function e (line 674) | function e(c){g.load(a[c],function(a){f.images[c]=a;h++;6===h&&(f.needsU...
function b (line 734) | function b(a){void 0===c[a]&&console.warn("THREE.MaterialLoader: Undefin...
function h (line 744) | function h(a,b,d,e,h){a=f+a;var k=pc.Handlers.get(a);null!==k?a=k.load(a...
function c (line 769) | function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manage...
function c (line 770) | function c(a,b){if("number"===typeof a)return a;console.warn("THREE.Obje...
function d (line 772) | function d(a){void 0===b[a]&&console.warn("THREE.ObjectLoader: Undefined...
function e (line 773) | function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.l...
function c (line 782) | function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new jb;f...
function d (line 782) | function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],...
method total (line 832) | get total(){return a._actions.length}
method inUse (line 832) | get inUse(){return a._nActiveActions}
method total (line 832) | get total(){return a._bindings.length}
method inUse (line 832) | get inUse(){return a._nActiveBindings}
method total (line 832) | get total(){return a._controlInterpolants.length}
method inUse (line 832) | get inUse(){return a._nActiveControlInterpolants}
function a (line 865) | function a(a,
FILE: src/utils/constants.js
constant WORLD_SIZE (line 1) | const WORLD_SIZE = 1024000;
constant MERCATOR_A (line 2) | const MERCATOR_A = 6378137.0;
FILE: src/utils/material.js
function material (line 18) | function material (options) {
FILE: src/utils/validate.js
function Validate (line 3) | function Validate(){
FILE: tests/threebox-tests-bundle.js
function r (line 1) | function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==...
function getLens (line 23) | function getLens (b64) {
function byteLength (line 43) | function byteLength (b64) {
function _byteLength (line 50) | function _byteLength (b64, validLen, placeHoldersLen) {
function toByteArray (line 54) | function toByteArray (b64) {
function tripletToBase64 (line 99) | function tripletToBase64 (num) {
function encodeChunk (line 106) | function encodeChunk (uint8, start, end) {
function fromByteArray (line 119) | function fromByteArray (uint8) {
function typedArraySupport (line 203) | function typedArraySupport () {
function createBuffer (line 230) | function createBuffer (length) {
function Buffer (line 250) | function Buffer (arg, encodingOrOffset, length) {
function from (line 276) | function from (value, encodingOrOffset, length) {
function assertSize (line 341) | function assertSize (size) {
function alloc (line 349) | function alloc (size, fill, encoding) {
function allocUnsafe (line 373) | function allocUnsafe (size) {
function fromString (line 391) | function fromString (string, encoding) {
function fromArrayLike (line 415) | function fromArrayLike (array) {
function fromArrayBuffer (line 424) | function fromArrayBuffer (array, byteOffset, length) {
function fromObject (line 447) | function fromObject (obj) {
function checked (line 472) | function checked (length) {
function SlowBuffer (line 482) | function SlowBuffer (length) {
function byteLength (line 573) | function byteLength (string, encoding) {
function slowToString (line 622) | function slowToString (encoding, start, end) {
function swap (line 700) | function swap (b, n, m) {
function bidirectionalIndexOf (line 840) | function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 896) | function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
function hexWrite (line 964) | function hexWrite (buf, string, offset, length) {
function utf8Write (line 989) | function utf8Write (buf, string, offset, length) {
function asciiWrite (line 993) | function asciiWrite (buf, string, offset, length) {
function latin1Write (line 997) | function latin1Write (buf, string, offset, length) {
function base64Write (line 1001) | function base64Write (buf, string, offset, length) {
function ucs2Write (line 1005) | function ucs2Write (buf, string, offset, length) {
function base64Slice (line 1087) | function base64Slice (buf, start, end) {
function utf8Slice (line 1095) | function utf8Slice (buf, start, end) {
function decodeCodePointsArray (line 1173) | function decodeCodePointsArray (codePoints) {
function asciiSlice (line 1191) | function asciiSlice (buf, start, end) {
function latin1Slice (line 1201) | function latin1Slice (buf, start, end) {
function hexSlice (line 1211) | function hexSlice (buf, start, end) {
function utf16leSlice (line 1224) | function utf16leSlice (buf, start, end) {
function checkOffset (line 1263) | function checkOffset (offset, ext, length) {
function checkInt (line 1438) | function checkInt (buf, value, offset, ext, max, min) {
function checkIEEE754 (line 1626) | function checkIEEE754 (buf, value, offset, ext, max, min) {
function writeFloat (line 1631) | function writeFloat (buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 1649) | function writeDouble (buf, value, offset, littleEndian, noAssert) {
function base64clean (line 1788) | function base64clean (str) {
function toHex (line 1802) | function toHex (n) {
function utf8ToBytes (line 1807) | function utf8ToBytes (string, units) {
function asciiToBytes (line 1887) | function asciiToBytes (str) {
function utf16leToBytes (line 1896) | function utf16leToBytes (str, units) {
function base64ToBytes (line 1912) | function base64ToBytes (str) {
function blitBuffer (line 1916) | function blitBuffer (src, dst, offset, length) {
function isInstance (line 1927) | function isInstance (obj, type) {
function numberIsNaN (line 1932) | function numberIsNaN (obj) {
function isArray (line 1963) | function isArray(arg) {
function isBoolean (line 1971) | function isBoolean(arg) {
function isNull (line 1976) | function isNull(arg) {
function isNullOrUndefined (line 1981) | function isNullOrUndefined(arg) {
function isNumber (line 1986) | function isNumber(arg) {
function isString (line 1991) | function isString(arg) {
function isSymbol (line 1996) | function isSymbol(arg) {
function isUndefined (line 2001) | function isUndefined(arg) {
function isRegExp (line 2006) | function isRegExp(re) {
function isObject (line 2011) | function isObject(arg) {
function isDate (line 2016) | function isDate(d) {
function isError (line 2021) | function isError(e) {
function isFunction (line 2026) | function isFunction(arg) {
function isPrimitive (line 2031) | function isPrimitive(arg) {
function objectToString (line 2043) | function objectToString(o) {
function isUndefinedOrNull (line 2078) | function isUndefinedOrNull(value) {
function isBuffer (line 2082) | function isBuffer (x) {
function objEquiv (line 2091) | function objEquiv(a, b, opts) {
function supported (line 2152) | function supported(object) {
function unsupported (line 2157) | function unsupported(object){
function shim (line 2171) | function shim (obj) {
function EventEmitter (line 2810) | function EventEmitter() {
function $getMaxListeners (line 2863) | function $getMaxListeners(that) {
function emitNone (line 2878) | function emitNone(handler, isFn, self) {
function emitOne (line 2888) | function emitOne(handler, isFn, self, arg1) {
function emitTwo (line 2898) | function emitTwo(handler, isFn, self, arg1, arg2) {
function emitThree (line 2908) | function emitThree(handler, isFn, self, arg1, arg2, arg3) {
function emitMany (line 2919) | function emitMany(handler, isFn, self, args) {
function _addListener (line 2987) | function _addListener(target, type, listener, prepend) {
function onceWrapper (line 3065) | function onceWrapper() {
function _onceWrap (line 3088) | function _onceWrap(target, type, listener) {
function _listeners (line 3215) | function _listeners(target, type, unwrap) {
function listenerCount (line 3248) | function listenerCount(type) {
function spliceOne (line 3269) | function spliceOne(list, index) {
function arrayClone (line 3275) | function arrayClone(arr, n) {
function unwrapListeners (line 3282) | function unwrapListeners(arr) {
function objectCreatePolyfill (line 3290) | function objectCreatePolyfill(proto) {
function objectKeysPolyfill (line 3295) | function objectKeysPolyfill(obj) {
function functionBindPolyfill (line 3302) | function functionBindPolyfill(context) {
function isBuffer (line 3566) | function isBuffer (obj) {
function isSlowBuffer (line 3571) | function isSlowBuffer (obj) {
function inspect (line 3678) | function inspect (value, from) {
function wrapQuotes (line 3755) | function wrapQuotes (s, defaultStyle, opts) {
function quote (line 3760) | function quote (s) {
function isArray (line 3764) | function isArray (obj) { return toStr(obj) === '[object Array]'; }
function isDate (line 3765) | function isDate (obj) { return toStr(obj) === '[object Date]'; }
function isRegExp (line 3766) | function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; }
function isError (line 3767) | function isError (obj) { return toStr(obj) === '[object Error]'; }
function isSymbol (line 3768) | function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; }
function isString (line 3769) | function isString (obj) { return toStr(obj) === '[object String]'; }
function isNumber (line 3770) | function isNumber (obj) { return toStr(obj) === '[object Number]'; }
function isBigInt (line 3771) | function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; }
function isBoolean (line 3772) | function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; }
function has (line 3775) | function has (obj, key) {
function toStr (line 3779) | function toStr (obj) {
function nameOf (line 3783) | function nameOf (f) {
function indexOf (line 3789) | function indexOf (xs, x) {
function isMap (line 3797) | function isMap (x) {
function isSet (line 3813) | function isSet (x) {
function isElement (line 3829) | function isElement (x) {
function inspectString (line 3839) | function inspectString (str, opts) {
function lowbyte (line 3844) | function lowbyte (c) {
function markBoxed (line 3851) | function markBoxed (str) {
function collectionOf (line 3855) | function collectionOf (type, size, entries) {
function arrObjKeys (line 3859) | function arrObjKeys (obj, inspect) {
function normalizeArray (line 4085) | function normalizeArray(parts, allowAboveRoot) {
function trim (line 4186) | function trim(arr) {
function basename (line 4255) | function basename(path) {
function filter (line 4342) | function filter (xs, f) {
function nextTick (line 4373) | function nextTick(fn, arg1, arg2, arg3) {
function defaultSetTimout (line 4421) | function defaultSetTimout() {
function defaultClearTimeout (line 4424) | function defaultClearTimeout () {
function runTimeout (line 4447) | function runTimeout(fun) {
function runClearTimeout (line 4472) | function runClearTimeout(marker) {
function cleanUpNextTick (line 4504) | function cleanUpNextTick() {
function drainQueue (line 4519) | function drainQueue() {
function Item (line 4557) | function Item(fun, array) {
function noop (line 4571) | function noop() {}
function Duplex (line 4662) | function Duplex(options) {
function onend (line 4689) | function onend() {
function onEndNT (line 4699) | function onEndNT(self) {
function PassThrough (line 4769) | function PassThrough(options) {
function _uint8ArrayToBuffer (line 4836) | function _uint8ArrayToBuffer(chunk) {
function _isUint8Array (line 4839) | function _isUint8Array(obj) {
function prependListener (line 4868) | function prependListener(emitter, event, fn) {
function ReadableState (line 4880) | function ReadableState(options, stream) {
function Readable (line 4957) | function Readable(options) {
function readableAddChunk (line 5032) | function readableAddChunk(stream, chunk, encoding, addToFront, skipChunk...
function addChunk (line 5068) | function addChunk(stream, state, chunk, addToFront) {
function chunkInvalid (line 5082) | function chunkInvalid(state, chunk) {
function needMoreData (line 5097) | function needMoreData(state) {
function computeNewHighWaterMark (line 5115) | function computeNewHighWaterMark(n) {
function howMuchToRead (line 5134) | function howMuchToRead(n, state) {
function onEofChunk (line 5253) | function onEofChunk(stream, state) {
function emitReadable (line 5271) | function emitReadable(stream) {
function emitReadable_ (line 5281) | function emitReadable_(stream) {
function maybeReadMore (line 5293) | function maybeReadMore(stream, state) {
function maybeReadMore_ (line 5300) | function maybeReadMore_(stream, state) {
function onunpipe (line 5344) | function onunpipe(readable, unpipeInfo) {
function onend (line 5354) | function onend() {
function cleanup (line 5367) | function cleanup() {
function ondata (line 5395) | function ondata(chunk) {
function onerror (line 5415) | function onerror(er) {
function onclose (line 5426) | function onclose() {
function onfinish (line 5431) | function onfinish() {
function unpipe (line 5438) | function unpipe() {
function pipeOnDrain (line 5455) | function pipeOnDrain(src) {
function nReadingNextTick (line 5542) | function nReadingNextTick(self) {
function resume (line 5559) | function resume(stream, state) {
function resume_ (line 5566) | function resume_(stream, state) {
function flow (line 5589) | function flow(stream) {
function fromList (line 5675) | function fromList(n, state) {
function fromListPartial (line 5695) | function fromListPartial(n, list, hasStrings) {
function copyFromBufferString (line 5715) | function copyFromBufferString(n, list) {
function copyFromBuffer (line 5744) | function copyFromBuffer(n, list) {
function endReadable (line 5771) | function endReadable(stream) {
function endReadableNT (line 5784) | function endReadableNT(state, stream) {
function indexOf (line 5793) | function indexOf(xs, x) {
function afterTransform (line 5877) | function afterTransform(er, data) {
function Transform (line 5902) | function Transform(options) {
function prefinish (line 5934) | function prefinish() {
function done (line 6001) | function done(stream, er, data) {
function WriteReq (line 6052) | function WriteReq(chunk, encoding, cb) {
function CorkedRequest (line 6061) | function CorkedRequest(state) {
function _uint8ArrayToBuffer (line 6101) | function _uint8ArrayToBuffer(chunk) {
function _isUint8Array (line 6104) | function _isUint8Array(obj) {
function nop (line 6114) | function nop() {}
function WritableState (line 6116) | function WritableState(options, stream) {
function Writable (line 6266) | function Writable(options) {
function writeAfterEnd (line 6303) | function writeAfterEnd(stream, cb) {
function validChunk (line 6313) | function validChunk(stream, state, chunk, cb) {
function decodeChunk (line 6380) | function decodeChunk(state, chunk, encoding) {
function writeOrBuffer (line 6400) | function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
function doWrite (line 6439) | function doWrite(stream, state, writev, len, chunk, encoding, cb) {
function onwriteError (line 6448) | function onwriteError(stream, state, sync, er, cb) {
function onwriteStateUpdate (line 6472) | function onwriteStateUpdate(state) {
function onwrite (line 6479) | function onwrite(stream, er) {
function afterWrite (line 6504) | function afterWrite(stream, state, finished, cb) {
function onwriteDrain (line 6514) | function onwriteDrain(stream, state) {
function clearBuffer (line 6522) | function clearBuffer(stream, state) {
function needFinish (line 6613) | function needFinish(state) {
function callFinal (line 6616) | function callFinal(stream, state) {
function prefinish (line 6627) | function prefinish(stream, state) {
function finishMaybe (line 6640) | function finishMaybe(stream, state) {
function endWritable (line 6652) | function endWritable(stream, state, cb) {
function onCorkedFinish (line 6662) | function onCorkedFinish(corkReq, state, err) {
function _classCallCheck (line 6708) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function copyBuffer (line 6713) | function copyBuffer(src, target, offset) {
function BufferList (line 6718) | function BufferList() {
function destroy (line 6794) | function destroy(err, cb) {
function undestroy (line 6835) | function undestroy() {
function emitErrorNT (line 6852) | function emitErrorNT(self, err) {
function copyProps (line 6920) | function copyProps (src, dst) {
function SafeBuffer (line 6933) | function SafeBuffer (arg, encodingOrOffset, length) {
function Stream (line 7020) | function Stream() {
function ondata (line 7027) | function ondata(chunk) {
function ondrain (line 7037) | function ondrain() {
function onend (line 7053) | function onend() {
function onclose (line 7061) | function onclose() {
function onerror (line 7069) | function onerror(er) {
function cleanup (line 7080) | function cleanup() {
function _normalizeEncoding (line 7207) | function _normalizeEncoding(enc) {
function normalizeEncoding (line 7237) | function normalizeEncoding(enc) {
function StringDecoder (line 7247) | function StringDecoder(encoding) {
function utf8CheckByte (line 7308) | function utf8CheckByte(byte) {
function utf8CheckIncomplete (line 7316) | function utf8CheckIncomplete(self, buf, i) {
function utf8CheckExtraBytes (line 7349) | function utf8CheckExtraBytes(self, buf, p) {
function utf8FillLast (line 7369) | function utf8FillLast(buf) {
function utf8Text (line 7384) | function utf8Text(buf, i) {
function utf8End (line 7395) | function utf8End(buf) {
function utf16Text (line 7405) | function utf16Text(buf, i) {
function utf16End (line 7428) | function utf16End(buf) {
function base64Text (line 7437) | function base64Text(buf, i) {
function base64End (line 7451) | function base64End(buf) {
function simpleWrite (line 7458) | function simpleWrite(buf) {
function simpleEnd (line 7462) | function simpleEnd(buf) {
function getHarness (line 7517) | function getHarness(opts) {
function createExitHarness (line 7525) | function createExitHarness(conf) {
function createHarness (line 7573) | function createHarness(conf_) {
function write (line 7638) | function write(buf) {
function flush (line 7649) | function flush() {
function Results (line 7682) | function Results() {
function encodeResult (line 7800) | function encodeResult(res, count) {
function getNextTest (line 7847) | function getNextTest(results) {
function invalidYaml (line 7861) | function invalidYaml(str) {
function Test (line 7909) | function Test(name_, opts_, cb_) {
function assert (line 8210) | function assert(value, msg, extra) {
function notOK (line 8224) | function notOK(value, msg, extra) {
function error (line 8238) | function error(err, msg, extra) {
function equal (line 8252) | function equal(a, b, msg, extra) {
function notEqual (line 8269) | function notEqual(a, b, msg, extra) {
function tapeDeepEqual (line 8289) | function tapeDeepEqual(a, b, msg, extra) {
function deepLooseEqual (line 8304) | function deepLooseEqual(a, b, msg, extra) {
function notDeepEqual (line 8318) | function notDeepEqual(a, b, msg, extra) {
function notDeepLooseEqual (line 8338) | function notDeepLooseEqual(a, b, msg, extra) {
function through (line 8438) | function through (write, end, opts) {
function Timeout (line 8555) | function Timeout(id, clearFn) {
function deprecate (line 8642) | function deprecate (fn, msg) {
function config (line 8673) | function config (name) {
function vector3Equals (line 8695) | function vector3Equals(t, input, expected, allowableError, epsilon) {
function precisionRound (line 8716) | function precisionRound(number, precision) {
FILE: tests/threebox-tests.js
function vector3Equals (line 9) | function vector3Equals(t, input, expected, allowableError, epsilon) {
function precisionRound (line 30) | function precisionRound(number, precision) {
FILE: tests/unit/camera.test.js
function cameraTest (line 1) | function cameraTest(instance){
FILE: tests/unit/material.test.js
function materialTest (line 1) | function materialTest(instance){
FILE: tests/unit/object.test.js
function objectTest (line 1) | function objectTest(instance){
FILE: tests/unit/utilities.test.js
function utilitiesTest (line 1) | function utilitiesTest(instance){
FILE: tests/unit/validate.test.js
function validateTest (line 1) | function validateTest(instance){
Condensed preview — 54 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,800K chars).
[
{
"path": "CHANGELOG.md",
"chars": 780,
"preview": "## 0.3.0\n\n#### Enhancements\n\n- Add an Object class: convenience methods to produce lines, spheres, tubes, and imported O"
},
{
"path": "LICENSE.txt",
"chars": 1066,
"preview": "MIT License\n\nCopyright (c) 2017 Peter Liu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "README.md",
"chars": 1303,
"preview": "# `threebox`\n\nA three.js plugin for Mapbox GL JS, using the custom layer feature. Provides convenient methods to manage "
},
{
"path": "dist/threebox.js",
"chars": 647266,
"preview": "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)ret"
},
{
"path": "docs/SymbolLayer3D.md",
"chars": 6772,
"preview": "\n\n## `SymbolLayer3D`\n\nThe `SymbolLayer3D` object lets you load in a GeoJ"
},
{
"path": "docs/Threebox.md",
"chars": 12638,
"preview": "# Documentation\n---\n## Background\n\nThreebox works by adding a Three.js scene to Mapbox GL, via a custom layer. The custo"
},
{
"path": "examples/Object3D.html",
"chars": 1926,
"preview": "<!doctype html>\n<head>\n <title>Threebox Basic Example</title>\n <script src=\"../dist/threebox.js\" type=\"text/javasc"
},
{
"path": "examples/basic.html",
"chars": 1556,
"preview": "<!doctype html>\n<head>\n\t\t<title>Sphere Example</title>\n\t\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></scri"
},
{
"path": "examples/config_template.js",
"chars": 37,
"preview": "var config = {\n accessToken: ''\n};"
},
{
"path": "examples/line.html",
"chars": 2547,
"preview": "<!doctype html>\n<head>\n\t<title>Line Example</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n"
},
{
"path": "examples/logistics.html",
"chars": 3488,
"preview": "<!doctype html>\n<head>\n\t<title>Animated truck</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script"
},
{
"path": "examples/mercator.html",
"chars": 3210,
"preview": "<!doctype html>\n<head>\n <title>Mercator projection</title>\n <script src=\"../dist/threebox.js\" type=\"text/javascrip"
},
{
"path": "examples/models/Truck.mtl",
"chars": 1307,
"preview": "# Blender MTL File: 'Truck.blend'\n# Material Count: 7\n\nnewmtl Black\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.0133"
},
{
"path": "examples/models/Truck.obj",
"chars": 101301,
"preview": "# Blender v2.78 (sub 0) OBJ File: 'Truck.blend'\n# www.blender.org\nmtllib Truck.mtl\no Truck_Cube\nv 0.298667 0.276472 0.01"
},
{
"path": "examples/old/basic.html",
"chars": 1953,
"preview": "<!doctype html>\n<head>\n <title>Threebox Basic Example</title>\n <script src=\"../dist/threebox.js\" type=\"text/javasc"
},
{
"path": "examples/old/flocking.html",
"chars": 10490,
"preview": "<!doctype html>\n<head>\n <title>Flocking Trucks SymbolLayer3D example</title>\n <script src=\"../dist/threebox.js\" ty"
},
{
"path": "examples/old/orientation.html",
"chars": 3913,
"preview": "<!doctype html>\n<head>\n <title>SymboLayer3D example</title>\n <script src=\"../dist/threebox.js\" type=\"text/javascri"
},
{
"path": "examples/raycaster.html",
"chars": 3639,
"preview": "<!doctype html>\n<head>\n <title>Raycaster</title>\n <script src=\"../dist/threebox.js\" type=\"text/javascript\"></scrip"
},
{
"path": "examples/tube.html",
"chars": 1954,
"preview": "<!doctype html>\n<head>\n\t<title>Tube Example</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n"
},
{
"path": "exports.js",
"chars": 89,
"preview": "window.Threebox = require('./src/Threebox.js'),\nwindow.THREE = require('./src/three.js')\n"
},
{
"path": "main.js",
"chars": 108,
"preview": "module.exports = exports = {\n Threebox: require('./src/Threebox'),\n THREE: require('./src/three.js')\n}"
},
{
"path": "package.json",
"chars": 979,
"preview": "{\n \"name\": \"threebox\",\n \"version\": \"0.2.0\",\n \"description\": \"A Mapbox GL JS plugin that combines the power of the Thr"
},
{
"path": "src/Animation/AnimationManager.js",
"chars": 7979,
"preview": "var threebox = require('../Threebox.js');\nvar utils = require(\"../utils/utils.js\");\nvar validate = require(\"../utils/val"
},
{
"path": "src/Camera/CameraSync.js",
"chars": 4360,
"preview": "var THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar ThreeboxConstants = require(\"../utils/"
},
{
"path": "src/Threebox.js",
"chars": 5271,
"preview": "var THREE = require(\"./three.js\");\nvar CameraSync = require(\"./camera/CameraSync.js\");\nvar utils = require(\"./utils/util"
},
{
"path": "src/Utils/Utils.js",
"chars": 7250,
"preview": "var THREE = require(\"../three.js\");\nvar Constants = require(\"./constants.js\");\nvar validate = require(\"./validate.js\");\n"
},
{
"path": "src/Utils/ValueGenerator.js",
"chars": 471,
"preview": "const ValueGenerator = function(input) {\n if(typeof input === 'object' && input.property !== undefined) // Value n"
},
{
"path": "src/objects/Object3D.js",
"chars": 400,
"preview": "var Objects = require('./objects.js');\nvar utils = require(\"../utils/utils.js\");\n\nfunction Object3D(options) {\n\toptions "
},
{
"path": "src/objects/customLines/Line2.js",
"chars": 576,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Line2 = function ( geometry, material ) {\n\n\tTHR"
},
{
"path": "src/objects/customLines/LineGeometry.js",
"chars": 1844,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineGeometry = function () {\n\n\tTHREE.LineSegmen"
},
{
"path": "src/objects/customLines/LineMaterial.js",
"chars": 7190,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n * color: <hex>,\n * linewidth: <float>"
},
{
"path": "src/objects/customLines/LineSegments2.js",
"chars": 1783,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegments2 = function ( geometry, material )"
},
{
"path": "src/objects/customLines/LineSegmentsGeometry.js",
"chars": 5033,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegmentsGeometry = function () {\n\n\tTHREE.In"
},
{
"path": "src/objects/customLines/Wireframe.js",
"chars": 1763,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Wireframe = function ( geometry, material ) {\n\n"
},
{
"path": "src/objects/customLines/WireframeGeometry2.js",
"chars": 545,
"preview": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.WireframeGeometry2 = function ( geometry ) {\n\n\t"
},
{
"path": "src/objects/line.js",
"chars": 19933,
"preview": "var THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\n\nfu"
},
{
"path": "src/objects/loadObj.js",
"chars": 1781,
"preview": "var utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\nconst OBJLoader = require(\"./loaders/OB"
},
{
"path": "src/objects/loaders/MTLLoader.js",
"chars": 13253,
"preview": "/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nconst THREE = require('../../t"
},
{
"path": "src/objects/loaders/OBJLoader.js",
"chars": 25297,
"preview": "/**\n * @author mrdoob / http://mrdoob.com/\n */\nconst THREE = require('../../three.js');\n\nconst OBJLoader = function ( ma"
},
{
"path": "src/objects/objects.js",
"chars": 4048,
"preview": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\n\nconst AnimationManager = requ"
},
{
"path": "src/objects/sphere.js",
"chars": 556,
"preview": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objec"
},
{
"path": "src/objects/tube.js",
"chars": 4518,
"preview": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objec"
},
{
"path": "src/three.js",
"chars": 545456,
"preview": "// threejs.org/license\n(function(k,za){\"object\"===typeof exports&&\"undefined\"!==typeof module?za(exports):\"function\"===t"
},
{
"path": "src/utils/constants.js",
"chars": 347,
"preview": "const WORLD_SIZE = 1024000;\nconst MERCATOR_A = 6378137.0;\n\nmodule.exports = exports = {\n WORLD_SIZE: WORLD_SIZE,\n "
},
{
"path": "src/utils/material.js",
"chars": 1404,
"preview": "// This module creates a THREE material from the options object provided into the Objects class.\n// Users can do this in"
},
{
"path": "src/utils/validate.js",
"chars": 2727,
"preview": "// Type validator\n\nfunction Validate(){\n\n};\n\nValidate.prototype = {\n\n Coords: function(input) {\n\n if (input.co"
},
{
"path": "tests/threebox-tests-bundle.js",
"chars": 257886,
"preview": "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)ret"
},
{
"path": "tests/threebox-tests.html",
"chars": 3395,
"preview": "<!doctype html>\n<head>\n <title>Threebox tests</title>\n <script src=\"threebox-tests-bundle.js\" type=\"text/javascrip"
},
{
"path": "tests/threebox-tests.js",
"chars": 1400,
"preview": "window.test = require('tape');\n// Threebox = require(\"../src/Threebox.js\");\n// THREE = require(\"../src/three.js\");\n\n// w"
},
{
"path": "tests/unit/camera.test.js",
"chars": 41,
"preview": "function cameraTest(instance){\n\n\n}\n\n \n"
},
{
"path": "tests/unit/material.test.js",
"chars": 2085,
"preview": "function materialTest(instance){\n\n var material;\n\n test('MATERIAL default type, color, opacity', function(t) { "
},
{
"path": "tests/unit/object.test.js",
"chars": 1771,
"preview": "function objectTest(instance){\n\n var mesh = new THREE.Mesh();\n var group \n\n test('OBJECT _makeGroup from one ob"
},
{
"path": "tests/unit/utilities.test.js",
"chars": 6672,
"preview": "function utilitiesTest(instance){\n\n test('PROJECTION project / unproject', function(t) {\n \n var coord, "
},
{
"path": "tests/unit/validate.test.js",
"chars": 1545,
"preview": "function validateTest(instance){\n\n var v = instance.utils.Validator;\n\n // Coords validation\n\n test('VALIDATE in"
}
]
About this extraction
This page contains the full source code of the peterqliu/threebox GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 54 files (1.7 MB), approximately 550.0k tokens, and a symbol index with 1020 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.